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

add cross mesh r_to_s reshard func for auto parrallel. #63962

Merged
merged 2 commits into from
May 3, 2024

Conversation

winter-wang
Copy link
Contributor

@winter-wang winter-wang commented Apr 28, 2024

PR Category

Auto Parallel

PR Types

New features

Description

  • 增加跨mesh的 r_to_s reshard函数。
  • 修改reshard函数的函数签名:dst_value = reshard(self, src_dist_attr, dst_dist_attr, src_value, dst_type):
    • self为reshard对象自身

    • src_dist_attr, dst_dist_attr表示要示reshard行为的源分布式属性和目标分布式属性

    • src_value表示要被reshard的变量。
      该函数会在当前插入点插入相应的算子,根据src_value得到一个dst_value并返回。 对于一些仅插入sendOp的场景,返回值为None。

    • 该函数仅负责插入,不负责删除。删除任务交给调用方去处理。

  • 修改apply_reshard_pass函数,改为原地修改输入的program。

Other

Pcard-67164

Copy link

paddle-bot bot commented Apr 28, 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.

new_ops = [op.name() for op in dist_program.global_block().ops]

assert 'pd_op.slice' in new_ops
assert 'dist_op.reshard' not in new_ops
Copy link
Contributor

Choose a reason for hiding this comment

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

需要更细粒度的check每个 op 的 dist attr

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, thanks!

elif self._backend == "gpu":
place = paddle.CUDAPlace(dist.get_rank())

BATCH_SIZE = 2
Copy link
Contributor

Choose a reason for hiding this comment

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

不需要,非network 组网

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, thanks!

@winter-wang winter-wang force-pushed the cf_develop branch 15 times, most recently from 455c757 to ec74702 Compare April 30, 2024 08:54
JZ-LIANG
JZ-LIANG previously approved these changes Apr 30, 2024
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

@From00 From00 merged commit 2562f58 into PaddlePaddle:develop May 3, 2024
30 checks passed
co63oc pushed a commit to co63oc/Paddle that referenced this pull request May 6, 2024
…63962)

* add cross mesh r_to_s reshard func for auto parrallel.

* fix ci
co63oc pushed a commit to co63oc/Paddle that referenced this pull request May 10, 2024
…63962)

* add cross mesh r_to_s reshard func for auto parrallel.

* fix ci
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.

3 participants