Repository navigation
[Accuracy diff No.89] Fix accuracy diff for paddle.incubate.nn.functional.fused_bias_act API - #389
Merged
Conversation
|
Thanks for your contribution! |
Collaborator
|
能定位是 torch 算错了还是 paddle 算错了呀?127 很大了 |
Comment on lines
-2283
to
-2284
| paddle.incubate.nn.functional.fused_bias_act(Tensor([2, 22016],"int32"), None, act_method="swiglu", compute_dtype="fp16", dequant_scales=Tensor([22016],"float32"), shift=None, smooth=None, quant_scale=0.0009313154732808471, quant_round_type=0, quant_max_bound=127.0, quant_min_bound=-127.0, ) | ||
| paddle.incubate.nn.functional.fused_bias_act(Tensor([2, 22016],"int32"), None, act_method="swiglu", compute_dtype="fp16", dequant_scales=Tensor([22016],"float32"), shift=None, smooth=None, quant_scale=0.0009654839523136616, quant_round_type=0, quant_max_bound=127.0, quant_min_bound=-127.0, ) |
Collaborator
There was a problem hiding this comment.
这些case不需要删除,还在这个文件里放着就可以。这里放着:
- 可以用于未来小范围的回归测试
- 如果所有问题都修复后,可以改变文件名。但这些case都是宝贵的测试用例还是需要保留下来的。
Author
已经更新第二个 commit,现在 atol 只需要设为 1 了 |
cangtianhuang
requested changes
Jul 17, 2025
cangtianhuang
approved these changes
Jul 17, 2025
|
|
||
| if quant_scale > 0: | ||
| x = x / quant_scale | ||
| x = quant_max_bound * quant_scale * x |
Collaborator
There was a problem hiding this comment.
这个地方乘以 quant_max_bound 的原因有待确定,此处与 paddle 源码写法一致,但是尚不清楚为什么会如此设计,需要进一步向 api 开发者确定~
乘以 quant_max_bound 后,所有精度测试能过通过
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
现有
paddle_to_torch的paddle.incubate.nn.functional.fused_bias_actAPI 实现有错误,已修复。在 fp16 精度测试下需要设置atol = 1(因为在量化时涉及round()操作会四舍五入)。tester/api_config/5_accuracy/accuracy_gpu_error.txt中的 20 个错误 case 现在可以通过。