CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
support llama2-7b model run in sharding case. #65606
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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
e571d9c
to
1e4b209
Compare
bd309ba
to
524f0a5
Compare
2565f90
to
1d69b8c
Compare
#include "paddle/phi/infermeta/spmd_rules/utils.h" | ||
|
||
namespace phi::distributed { | ||
SpmdInfo AddNInferSpmd( |
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.
变长输入在 paddle/phi/infermeta/spmd_rules/utils.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.
add_n的输入并不是变长,他是一个TensorList. 目前似乎也没有其它的算子适应这个spmd函数。感觉实现为变长模板似乎没有啥意义
f13b724
to
a6b93e9
Compare
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
const std::vector<phi::distributed::DistMetaTensor>& inputs) { | ||
auto N = inputs.size(); | ||
PADDLE_ENFORCE_GT( | ||
N, 0, phi::errors::InvalidArgument("The inputs tensor's size of AddNOp")); |
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.
these error msg is not complete
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,thanks!
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
bool AddN_Op::InferSymbolicShape( | ||
pir::InferSymbolicShapeContext *infer_context) { | ||
return details::AddNOpInferSymbolicShape(this->operation(), infer_context); | ||
return AddNOpInferSymbolicShape(this->operation(), infer_context); | ||
} |
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.
为啥留下了AddN_
?
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.
AddN_里面的inplace特性目前的yaml体系无法描述。所以yaml里面只定义了AddN, AddN_仍然是manual的。
@@ -110,6 +110,45 @@ bool AddOpInferSymbolicShape(pir::Operation *op, | |||
[](const symbol::DimExpr &x, const symbol::DimExpr &y) { return x + y; }); | |||
} | |||
|
|||
bool AddNOpInferSymbolicShape(pir::Operation *op, |
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.
函数放的文件位置有些不太匹配,AddN不算是binary elementwise类型,更偏向是mutinary类型
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, thanks!
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
PR Category
Auto Parallel
PR Types
Bug fixes
Description
support llama2-7b model run in sharding case.
Other
Pcard-67164