Skip to content

Conversation

@sljlp
Copy link
Contributor

@sljlp sljlp commented Aug 30, 2021

PR types

Performance optimization

PR changes

OPs

Describe

shard_index_op for NPU
ernie3.0精度对齐
image
ernie3.0性能提升1%
image

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@wangxicoding wangxicoding left a 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());
Copy link
Contributor

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());
Copy link
Contributor

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());
Copy link
Contributor

Choose a reason for hiding this comment

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

same

Copy link
Contributor Author

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;
Copy link
Contributor

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);
可以换个好看点的写法

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的

@wangxicoding wangxicoding merged commit 5c27c2c into PaddlePaddle:develop Sep 1, 2021
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.

2 participants