Skip to content

special deal with the inplace case in auto parallel pass. #65060

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

Merged
merged 1 commit into from
Jun 16, 2024

Conversation

winter-wang
Copy link
Contributor

@winter-wang winter-wang commented Jun 12, 2024

PR Category

Auto Parallel

PR Types

New features

Description

  • support inplace case in auto parallel pir pass.
    • as follows, the partition pass will insert pd_op.assign_out_ op for inplace value.
    .........
    (%930) = "dist_op.reshard" (%3) {.......}
    (%931) = "dist_op.reshard" (%2) {.......}
    
    # 其中 %930和%933, %931和%934为相应的inplace变量,即在算子执行中会被修改。
    (%932, %933, %934, %935, %936, %937) = "pd_op.adamw_"  (%108, %655, %656, %930, %931,,,,,,,,,,,) 
    
    # %930在pd_op.adamw_中发生了变化,因此需要同步到原始的%3变量
    (%938) = "dist_op.reshard"(%930) {.......}
    "pd_op.assign_out_"  (%938, %3) {.......}
    # %931在pd_op.adamw_中发生了变化,因此需要同步到原始的%2变量
    (%939) = "dist_op.reshard" (%931) {.......}
    "pd_op.assign_out_"  (%939, %2) {.......}
  • add distribute branch for assign_out_ op.
  • replace "pd_op.c_allreduce_sum_" with "pd_op.c_allreduce_sum" in p_to_r_reshard_func. Because the semantics of reshard op is non-inplace。
  • alignment the precision for llama demo with 8 card 3D mix parallel.

Other

Pcard-67164

Copy link

paddle-bot bot commented Jun 12, 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.

@winter-wang winter-wang force-pushed the develop branch 2 times, most recently from 9ec470e to ba221cf Compare June 12, 2024 11:11
Copy link
Contributor

@JZ-LIANG JZ-LIANG left a comment

Choose a reason for hiding this comment

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

LGTM

@winter-wang winter-wang merged commit 02be1a8 into PaddlePaddle:develop Jun 16, 2024
30 of 33 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.

2 participants