Skip to content

Conversation

@deepllz
Copy link
Contributor

@deepllz deepllz commented Dec 13, 2024

PR Category

Auto Parallel

PR Types

Performance

Description

dropout切分推导规则添加
Pcard-73145
dropout切分推导会导致dp情况下精度无法诸位对齐,gpt中使用了dropout,因此gpt3个开启dp的单测会无法通过。暂时先禁止这3个测试,待此PR合入之后,再修改paddleNLP中gpt的测试。

@paddle-bot
Copy link

paddle-bot bot commented Dec 13, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.


// args : (Tensor x, Tensor seed_tensor, Scalar p, bool is_test, str mode, int
// seed, bool fix_seed) output : Tensor(out), Tensor(mask)
SpmdInfo DropoutFwdInferSpmd(const DistMetaTensor& x,
Copy link
Contributor

Choose a reason for hiding this comment

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

In general, the naming of forward spmd rule is DropoutInferSpmd

Copy link
Contributor Author

Choose a reason for hiding this comment

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

由于现在不需要写reverse,所以命名为fwd和bwd更合理,已经有部分spmd是如此命名的了


// args : (Tensor mask, Tensor out_grad, Scalar p, bool is_test, str mode)
// output : Tensor(x_grad)
SpmdInfo DropoutBwdInferSpmd(const DistMetaTensor& mask,
Copy link
Contributor

Choose a reason for hiding this comment

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

In general, the naming of backward spmd rule is DropoutGradInferSpmd

Copy link
Contributor Author

Choose a reason for hiding this comment

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

同上

bool is_test,
const std::string& mode) {
return ElementwiseBinaryInferSpmd(mask, out_grad);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

shall we add DropoutInferSpmdReverse to support reverse spmd rule in forward when use static mode

Copy link
Contributor Author

Choose a reason for hiding this comment

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

现在不需要添加reverse的切分推导了

Copy link
Contributor

@zhiqiu zhiqiu left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@liym27 liym27 left a comment

Choose a reason for hiding this comment

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

LGTM

@From00 From00 merged commit 9fcf8c8 into PaddlePaddle:develop Dec 16, 2024
28 checks passed
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.

6 participants