-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
move dgc_momentum kernel to phi #56158
Conversation
} else if (param_var->IsType<phi::SelectedRows>() && | ||
grad_var->IsType<phi::SelectedRows>() && |
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.
@GhostScreaming,帮忙看一下这种情况怎么处理,输入参数 param
和 grad
可能是 DenseTensor
也可能是 SelectedRows
,但是改造成函数式 Kernel 后需要在参数列表中明确类型,我这个 PR 里只保留了 DenseTensor
的情况,本地跑单测也能通过,如果还需要保留 SelectedRows
的情况的话,需要像 sgd_kernel.cc 一样实现并注册多个 Kernel,但是我看 sgd_kernel.cc
每一个 Kernel 都有对应的 op,而 dgc_momentum
只有一个 op,所以不太清楚要怎么处理
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.
SelectedRows可以不用再适配。python侧的DGCMomentumOptimizer
在param
和grad
类型是SelectedRows
,会调用momentum
而不是dgc_momentum
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.
LGTM
} else if (param_var->IsType<phi::SelectedRows>() && | ||
grad_var->IsType<phi::SelectedRows>() && |
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.
SelectedRows可以不用再适配。python侧的DGCMomentumOptimizer
在param
和grad
类型是SelectedRows
,会调用momentum
而不是dgc_momentum
Get. |
@luotao1 , 帮忙豁免一下 CI ~ |
PR types
Others
PR changes
Others
Description