Skip to content
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

Merged
merged 2 commits into from
Aug 16, 2023

Conversation

huangjiyi
Copy link
Member

PR types

Others

PR changes

Others

Description

Comment on lines -174 to -175
} else if (param_var->IsType<phi::SelectedRows>() &&
grad_var->IsType<phi::SelectedRows>() &&
Copy link
Member Author

@huangjiyi huangjiyi Aug 10, 2023

Choose a reason for hiding this comment

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

@GhostScreaming,帮忙看一下这种情况怎么处理,输入参数 paramgrad 可能是 DenseTensor 也可能是 SelectedRows,但是改造成函数式 Kernel 后需要在参数列表中明确类型,我这个 PR 里只保留了 DenseTensor 的情况,本地跑单测也能通过,如果还需要保留 SelectedRows 的情况的话,需要像 sgd_kernel.cc 一样实现并注册多个 Kernel,但是我看 sgd_kernel.cc 每一个 Kernel 都有对应的 op,而 dgc_momentum 只有一个 op,所以不太清楚要怎么处理

Copy link
Contributor

Choose a reason for hiding this comment

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

SelectedRows可以不用再适配。python侧的DGCMomentumOptimizerparamgrad类型是SelectedRows,会调用momentum而不是dgc_momentum

@paddle-bot paddle-bot bot added the contributor External developers label Aug 10, 2023
@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Aug 11, 2023
Copy link
Contributor

@GhostScreaming GhostScreaming left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines -174 to -175
} else if (param_var->IsType<phi::SelectedRows>() &&
grad_var->IsType<phi::SelectedRows>() &&
Copy link
Contributor

Choose a reason for hiding this comment

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

SelectedRows可以不用再适配。python侧的DGCMomentumOptimizerparamgrad类型是SelectedRows,会调用momentum而不是dgc_momentum

@huangjiyi
Copy link
Member Author

SelectedRows可以不用再适配。python侧的DGCMomentumOptimizer在param和grad类型是SelectedRows,会调用momentum而不是dgc_momentum

Get.

@huangjiyi
Copy link
Member Author

@luotao1 , 帮忙豁免一下 CI ~

@luotao1 luotao1 merged commit baa4fb4 into PaddlePaddle:develop Aug 16, 2023
@huangjiyi huangjiyi deleted the migrate_dgc_momentum branch January 9, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants