-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
【PaddlePaddle Hackathon 3 No.48】为 Paddle 新增 elementwise op support fp16 #45496
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@xiaohemaikoo 可以先解决下代码冲突的问题,请 @zhangting2020 继续审核 |
float result = tmp_dout * tmp_y * std::pow(tmp_x, tmp_y - 1.0f); | ||
return static_cast<dtype::float16>(result); | ||
} | ||
}; |
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.
这里可以参考你前向的修改方式,在原始的functor上进行修改就可以,不必要单独增加实现。
float result = tmp_pow * tmp_dout * std::log(tmp_x); | ||
return static_cast<dtype::float16>(result); | ||
} | ||
}; |
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.
同上
self.check_output(check_eager=True) | ||
|
||
def test_check_grad(self): | ||
if self.dtype not in [np.int32, np.int64]: |
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.
这个判断应该不需要,因为这个class是fp16类型的测试,其他类型不会涉及到这里面的逻辑
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/python/paddle/tensor/math.py Lines 4668 to 4669 in 871e332
|
24c299d
to
aa4d996
Compare
aa4d996
to
d356103
Compare
python api部分,中英文档中的数据类型均已提交PR增加float16类型。 最新代码已经修改大部分comments,可能部分comments修改不够完美。 |
PR修改已经符合要求,感谢你的贡献!待性能数据补充验证没有问题,CI通过,我们会给予approve并合入。 |
请在对应的中文API文档中也添加支持fp16数据类型支持的说明哈~中文API文档放在 https://github.com/PaddlePaddle/docs/tree/develop/docs/api/paddle |
我修改了math.py英文文档英文注释,PR-CI-Static-Check 需要approval。 另: |
你好,性能对比测试数据已经更新到 PR描述 性能对比测试数据表格中。 |
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
OK, thanks. CI 还有几个没通过的,好像和我没关系,我不需要关注了吧。 |
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 for docs,中文文档还有一个小问题需要修改下
PR types
New features
PR changes
OPs
Describe
elementwise op support fp16
performance
diff = FP32 / FP16
docs:PaddlePaddle/docs#5249