-
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
[Semi-Auto] SPMD Parallel Rule Base #53863
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
❌ The PR is not created using PR's template. You can refer to this Demo. |
… semi-auto/rule-base
aced5ea
to
ef92dc4
Compare
void DistTensorSpec::set_shape(const std::vector<int64_t>& shape) { | ||
shape_ = shape; | ||
} | ||
const TensorDistAttr& DistTensorSpec::get_dist_attr() const { |
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.
const TensorDistAttr& DistTensorSpec::get_dist_attr() const { | |
const TensorDistAttr& DistTensorSpec::dist_attr() const { |
U can skip get
in get method, same for others
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.
done
#include <glog/logging.h> | ||
|
||
#include "paddle/fluid/distributed/auto_parallel/spmd_rules/common.h" | ||
#include "paddle/fluid/distributed/auto_parallel/spmd_rules/rules.h" |
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.
#include <glog/logging.h> | |
#include "paddle/fluid/distributed/auto_parallel/spmd_rules/common.h" | |
#include "paddle/fluid/distributed/auto_parallel/spmd_rules/rules.h" | |
#include "paddle/fluid/distributed/auto_parallel/spmd_rules/common.h" | |
#include <glog/logging.h> | |
#include "paddle/fluid/distributed/auto_parallel/spmd_rules/rules.h" |
Put the related header first.
|
||
// Merge the DistAttr of input tensors and infer the DistAttr of the output | ||
// tensors from the merged input information. The input are DistAttr and Shape | ||
// (wrapp as DistTensorSpec) of the input tensors (tensors follow the same |
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.
wrapp -> Wrapped
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.
done
} | ||
} | ||
|
||
TensorDistAttr CopyTensorDistAttrForOutput( |
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.
Better add a copy constructor.
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 constructor is not fit in this case since part of data member would be changed after "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
@@ -379,6 +379,8 @@ def source_include(header_file_path): | |||
#include "paddle/phi/api/profiler/event_tracing.h" | |||
#include "paddle/phi/api/profiler/supplement_tracing.h" | |||
|
|||
#include "paddle/fluid/distributed/auto_parallel/spmd_rules/dist_tensor_spec.h" |
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需要独立编译使用,不能依赖fluid目录,如果确实需要使用该文件,建议将这个文件加到phi算子库目录下
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.
将在下一PR 立即 Revert 这个依赖
PR types
New features
PR changes
Others
Description
Pcard-70448
A Experimental new mechanism for parallel operator in semi-auto parallel.