-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Auto Parallel]: Support optional, inplace input and output for DistTensor. #57092
[Auto Parallel]: Support optional, inplace input and output for DistTensor. #57092
Conversation
Concat forward and backward are verified.
… dist_tensor_support
… dist_tensor_support
…Tensor> -> std::vector<Tensor>.
… dist_tensor_support
…or output of operators. Following testcases are passed. 1. concat: std::vector<phi::Tensor> -> phi::Tensor 2. unbind: phi::Tensor -> std::vector<phi::Tensor> 3. broadcast_tensors: std::vector<phi::Tensor> -> std::vector<phi::Tensor>
… dist_tensor_support
paddle::optional<std::vector<phi::Tensor>> input and output for DistTensor.
你的PR提交成功,感谢你对开源项目的贡献! |
… dist_tensor_support
OPTIONAL_GLOBAL_VECTOR_META_IN_TEMPLATE = """ | ||
OPTIONAL_GLOBAL_SINGLE_META_IN_TEMPLATE = """meta_dist_{}, """ | ||
OPTIONAL_GLOBAL_SINGLE_META_IN_DECL_TEMPLATE = """ | ||
phi::MetaTensor meta_dist_{name} = {name} ? MakeMetaTensor(*(*{name}).impl()) : phi::MetaTensor(); |
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.
其实我们现在做了两遍meta tensor的构造,前面MakeDistMetaTensor也构造了一遍,后面我们可以看下能否在下面复用前面MakeDistMetaTensor的结果,从而降低调度开销
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.
收到~
1, # align_mode | ||
) | ||
# print("local_out: ", local_out) | ||
dist_out = paddle._C_ops.linear_interp( |
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.
这个用正式api paddle.nn.functional.interpolate 可以测试吗
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.
需要测试linear_interp
的paddle::optional<phi::Tensor> out_size
和paddle::optional<std::vector<phi::Tensor>> size_tensor
类型的输入,看了一下paddle.nn.functional.interpolate
的代码实现,size_tensor
是传不进去的。
…:optional<Tensor> and paddle::optional<std::vector<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.
LGTM
…ensor. (PaddlePaddle#57092) * [WIP] Support std::vector<phi::Tensor> input and output for DistTensor. Concat forward and backward are verified. * Polish code for new dist tensor implementation. * Fix bug of DistTensor upgrade. Add support functions for std::vector<Tensor> -> std::vector<Tensor>. * Add support for DistTensor type of std::vector<phi::Tensor> as input or output of operators. Following testcases are passed. 1. concat: std::vector<phi::Tensor> -> phi::Tensor 2. unbind: phi::Tensor -> std::vector<phi::Tensor> 3. broadcast_tensors: std::vector<phi::Tensor> -> std::vector<phi::Tensor> * Polish code. Remove useless comments. * Add update_loss_scaling in skip_op_lists. * Polish code. * [Auto Parallel]: Support paddle::optional<Tensor> and paddle::optional<std::vector<phi::Tensor>> input and output for DistTensor. * Polish code. * Polish code. And support inplace Tensor, std::vector<Tensor>, paddle::optional<Tensor> and paddle::optional<std::vector<Tensor>> * Polish testcase code. Add testcase for inplace paddle::optional<phi::Tensor>. * Remove useless codes in testcase code. * Polish code style. * Polish code style. And fix problems of testcases.
PR types
Others
PR changes
Others
Description
Pcard-73145
paddle::optional<phi::Tensor>
andpaddle::optional<std::vector<phi::Tensor>>
input and output forDistTensor
.Expand_As
,Bincount
,Linear_Interp
forward and backward are verified.inplace phi::Tensor
,inplace std::vector<phi::Tensor>
,inplace paddle::optional<phi::Tensor>
andinplace paddle::optional<std::vector<phi::Tensor>>
type of outputs.check_finite_and_unscale_
,adamax_
andmerged_adam_
are verified.std::tuple<...>
are supported now as all type of output are supported.