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

[fp16] fix fp16 support for nn.PairwiseDistance #50849

Merged
merged 22 commits into from
Feb 27, 2023

Conversation

Ainavo
Copy link
Contributor

@Ainavo Ainavo commented Feb 23, 2023

PR types

Bug fixes

PR changes

APIs

Describe

问题描述:在静态图模式下,输入FP16时,pairwise_distance会报错。

解决方案:在 pairwise_distance API 静态图模式下的类型检查中增加fp16支持,并修改 API doc。
修复对应API的中文文档 :PaddlePaddle/docs#5638
#50832

@paddle-bot
Copy link

paddle-bot bot commented Feb 23, 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 paddle-bot bot added the contributor External developers label Feb 23, 2023
@Ainavo Ainavo changed the title [fp 16] add fp16 support for nn.PairwiseDistance [wip][fp 16] add fp16 support for nn.PairwiseDistance Feb 24, 2023
@Ainavo Ainavo changed the title [wip][fp 16] add fp16 support for nn.PairwiseDistance [WIP][fp 16] add fp16 support for nn.PairwiseDistance Feb 24, 2023
@Ainavo Ainavo changed the title [WIP][fp 16] add fp16 support for nn.PairwiseDistance [WIP][fp16] add fp16 support for nn.PairwiseDistance Feb 24, 2023
@zhangting2020
Copy link
Contributor

有2处问题:

  • 不需要修改底层算子的内容:这个API是通过调用多个API组合实现的,其中GPU的算子均已支持FP16类型,CPU不需要支持。因此PR中cpu/gpu对于注册部分的修改需要恢复。
  • 单测的问题:由于不支持CPU FP16,需要限制fp16下的单测仅运行在GPU上

@Ainavo Ainavo changed the title [WIP][fp16] add fp16 support for nn.PairwiseDistance [fp16] add fp16 support for nn.PairwiseDistance Feb 25, 2023
@Ainavo Ainavo changed the title [fp16] add fp16 support for nn.PairwiseDistance [fp16] fix fp16 support for nn.PairwiseDistance Feb 25, 2023
@Ainavo
Copy link
Contributor Author

Ainavo commented Feb 25, 2023

有2处问题:

  • 不需要修改底层算子的内容:这个API是通过调用多个API组合实现的,其中GPU的算子均已支持FP16类型,CPU不需要支持。因此PR中cpu/gpu对于注册部分的修改需要恢复。
  • 单测的问题:由于不支持CPU FP16,需要限制fp16下的单测仅运行在GPU上

好的,完成了

Copy link
Contributor

@zhangting2020 zhangting2020 left a comment

Choose a reason for hiding this comment

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

LGTM

@luotao1 luotao1 merged commit 587120e into PaddlePaddle:develop Feb 27, 2023
@Ainavo Ainavo deleted the fix_fp16_for_pairwise_distance branch March 14, 2023 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants