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

[SemiAuto] add static branch for shard_tensor #56561

Merged
merged 4 commits into from
Aug 24, 2023

Conversation

zhiqiu
Copy link
Contributor

@zhiqiu zhiqiu commented Aug 23, 2023

PR types

New features

PR changes

APIs

Description

add static branch for shard_tensor and support dy2static
Pcard-73145

Get process_mesh of the dist_attr

Returns:
paddle.distributed.ProcessMesh: process_mesh
Copy link
Contributor

Choose a reason for hiding this comment

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

还需要补充下示例吗

Copy link
Contributor Author

Choose a reason for hiding this comment

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

感觉不加也可以,比较简单的property函数。如果需要,后续我补一下。

dims_mapping = [
mesh.dim_names.index(dim_name) if dim_name is not None else -1
for dim_name in sharding_specs
]

# 2. init core.TensorDistAttr
core.TensorDistAttr.__init__(self)
self.process_mesh = mesh
self.dims_mapping = dims_mapping
self._process_mesh = mesh
Copy link
Contributor

Choose a reason for hiding this comment

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

the process_mesh field in c++ TensorDistAttr might remain unchanged ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Contributor

@chenwhql chenwhql left a comment

Choose a reason for hiding this comment

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

LGTM

@zhiqiu zhiqiu merged commit dadfb09 into PaddlePaddle:develop Aug 24, 2023
BeingGod pushed a commit to BeingGod/Paddle that referenced this pull request Sep 9, 2023
* shard_tensor support static graph

* add comments

* add dy2static ut

* use property in c++ side
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.

4 participants