-
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
[AutoParallel] PHI copy support auto parallel #58436
[AutoParallel] PHI copy support auto parallel #58436
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
test/auto_parallel/CMakeLists.txt
Outdated
@@ -130,6 +130,11 @@ if(WITH_DISTRIBUTE AND WITH_GPU) | |||
py_test_modules(test_gpt_with_newir MODULES test_gpt_with_newir) | |||
set_tests_properties(test_gpt_with_newir | |||
PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE" TIMEOUT 100) | |||
py_test_modules(test_semi_auto_parallel_functional_in_single_card MODULES |
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.
如果是单卡的话,可以看下注释,它这个cmake了做了分区,单卡的测试在最后
def test_tensor_copy_to(self): | ||
mesh = dist.ProcessMesh([0, 1], dim_names=["x"]) | ||
dense_tensor = paddle.randn([10, 20]) | ||
dist_tensor = dist.shard_tensor( |
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.
涉及切分的话,就有通信,单卡应该跑不过才对,或者用[None, None]不切分
paddle/phi/api/lib/tensor_copy.cc
Outdated
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.
phi/api下面的文件,在WITH_DISTRIBUTED=OFF
的cmake参数下,需要用ifdef PADDLE_WITH_DISTRIBUTE
宏,条件编译DistTensor相关分支
dense_tensor, | ||
dist_attr=dist.DistAttr(mesh=mesh, sharding_specs=[None, None]), | ||
) | ||
dist_tensor._copy_to(paddle.CPUPlace(), True) |
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.
copy的语义需要确定:1、mesh是否和设备相关,转cpu后,动半还缺少mesh和device的映射关系。2、如果是不同的distattr Dtensor,需要reshard 实现copy转换。
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
* PHI copy support auto parallel
* PHI copy support auto parallel
PR types
Others
PR changes
Others
Description
PHI API copy_to 支持 AutoParallel
Pcard-73145