-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PRIM][PIR]Support no grad in vjp #57294
[PRIM][PIR]Support no grad in vjp #57294
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
std::vector<std::vector<Tensor>> ConstructVjpResultByStopGradients( | ||
const std::vector<std::vector<Tensor>>& outputs, | ||
const std::vector<std::vector<bool>>& stop_gradients) { | ||
SetOutputWithNoGrads(outputs, stop_gradients); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stop_gradients=true 和 no_grad语义不是一个意思吧,set_empty_type 是代表什么
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这儿应该是前向stop_gradient来表示创不创建反向变量,ir层面是一定会创建,这个函数名改成SetEmptyGrad吧,表示这个变量应该是空的,set_empty_type在ir中就是表示这个变量为空。
@@ -21,9 +21,34 @@ void set_output<LazyTensor>(const paddle::Tensor& x_tmp, paddle::Tensor* x) { | |||
x->set_impl(x_tmp.impl()); | |||
} | |||
|
|||
/** | |||
* @brief set output with no grads in new ir. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @brief set output with no grads in new ir. | |
* @brief set output with no grads in pir. |
/** | ||
* @brief set output with no grads in new ir. | ||
* | ||
* In new ir, we use None type to express |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* In new ir, we use None type to express | |
* In pir, we use None type to express |
PR types
New features
PR changes
Others
Description
Pcard-66975
support no grad in vjp.