Skip to content
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

[AMP OP&Test]support prod、meshgrid、expand_as bf16 dtype #53865

Merged
merged 4 commits into from
May 18, 2023

Conversation

Charles-hit
Copy link
Contributor

@Charles-hit Charles-hit commented May 16, 2023

PR types

Others

PR changes

Others

Description

Pcard-66975
背景:

  • 为了组合算子P0优先级的算子可以全量支持bfloat16数据类型,需要补充拆解后不支持bfloat16的kernel。

PR改动:

  • 新增prod、meshgrid、expand_as前反向kernel bfloat16数据类型,并添加单测。
  • 在新增meshgrid bflaot16单测时OPTest对bfloat16数据类型的处理没有处理多输入多输出的情况,对OPtest这部分功能进行修复,报错如下:
    1725d8d1335dd54513659e9a984baa2e
  • 修复prod 组合算子单测的精度问题,主要是因为OPTest针对组合算子反向测试阈值设置不正确。

@paddle-bot
Copy link

paddle-bot bot commented May 16, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot
Copy link

paddle-bot bot commented May 16, 2023

❌ The PR is not created using PR's template. You can refer to this Demo.
Please use PR's template, it helps save our maintainers' time so that more developers get helped.

Copy link
Contributor

@cxxly cxxly left a comment

Choose a reason for hiding this comment

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

LGTM

or not core.is_bfloat16_supported(core.CUDAPlace(0)),
"core is not compiled with CUDA or not support the bfloat16",
)
class TestExpandAsOpRank2BFP16OP(TestExpandAsOpRank2):
Copy link
Contributor

@ZzSean ZzSean May 18, 2023

Choose a reason for hiding this comment

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

这个直接继承TestExpandAsBasicBFP16OP可以减少重复代码,下同

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"core is not compiled with CUDA or not support the bfloat16",
)
class TestMeshgridOpBFP16OP(TestMeshgridOp):
def init_data_type(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

这个函数好像没调用?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

感谢,在这个PR修复PR53951

Copy link
Contributor

@ZzSean ZzSean left a comment

Choose a reason for hiding this comment

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

Almost LGTM,两个问题下个PR需要改下

@Charles-hit Charles-hit merged commit 706503d into PaddlePaddle:develop May 18, 2023
@Charles-hit Charles-hit deleted the support_bf16_for_ops branch May 18, 2023 12:30
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.

4 participants