Skip to content

fix: correct DDP handling and backward gradients - #214

Open
chen2021673 wants to merge 1 commit into
masterfrom
fix/backend-independent-correctness
Open

fix: correct DDP handling and backward gradients#214
chen2021673 wants to merge 1 commit into
masterfrom
fix/backend-independent-correctness

Conversation

@chen2021673

Copy link
Copy Markdown
Contributor

Summary

Fix several backend-independent correctness issues in DDP, autograd, and CUDA linear backward.

Changes

  • honor average_in_collective across DDP reduction paths
  • validate DDP parameters and buffers against the process group device
  • fix Exp backward and avoid aliased gradients in Add backward
  • fix CUDA linear bias-gradient reduction
  • remove an unsupported distributed optimizer test
  • clean up related build configuration, diagnostics, and test documentation

- honor DDP reduction configuration and validate process group devices
- fix elementwise and CUDA linear backward correctness
- remove the unsupported distributed optimizer test
- clean up related build diagnostics and test documentation
EXPECT_TRUE(state.contains("adam.v.first"));
}

TEST_P(OptimizerParameterNamesTest, DistributedOptimizerPropagatesNamesToShardOptimizer) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当前测试体系不支持多进程,所以这个测试实际上被跳过了,没有真正运行


// Fast path: no broadcast — grad_a and grad_b are both just grad_output
if (a_dims_ == b_dims_) {
return {grad_output, grad_output};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里有问题,两个返回值指向同一个对象,梯度累积会出错。删掉。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant