-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[NPU]shard index op for npu #35281
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
[NPU]shard index op for npu #35281
Conversation
|
Thanks for your contribution! |
wangxicoding
left a comment
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. 变量名称需要规范一下
| out->set_lod(in->lod()); | ||
| out->mutable_data<T>(place); | ||
|
|
||
| Tensor tmp(in->type()); |
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.
后面换个名吧,shard_size_tensor或者tmp_shard_size
| Tensor condition(framework::proto::VarType::BOOL); | ||
| condition.mutable_data<bool>(in->dims(), place); | ||
|
|
||
| Tensor tmp2(in->type()); |
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.
这个名字也换一下,mod_out、out_mod啥的
| Tensor tmp2(in->type()); | ||
| tmp2.mutable_data<T>(in->dims(), place); | ||
|
|
||
| Tensor tmp3(in->type()); |
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.
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.
好的
| context.template device_context<paddle::platform::NPUDeviceContext>() | ||
| .stream(); | ||
|
|
||
| NpuOpRunner runner; |
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.
NpuOpRunner("Mod", {*in, tmp}, {tmp2}).Run(stream);
可以换个好看点的写法
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 types
Performance optimization
PR changes
OPs
Describe
shard_index_op for NPU


ernie3.0精度对齐
ernie3.0性能提升1%