Skip to content

Conversation

@ooooo-create
Copy link
Contributor

@ooooo-create ooooo-create commented Sep 14, 2025

add unit tests for fused_hadamard_quant_fp8, moe_fused_hadamard_quant_fp8

@paddle-bot
Copy link

paddle-bot bot commented Sep 14, 2025

Thanks for your contribution!

@paddle-bot paddle-bot bot added the contributor External developers label Sep 14, 2025
@ooooo-create ooooo-create changed the title 【Hackathon 9th No.23】add unit tests for fused_hadamard_quant_fp8 【Hackathon 9th No.21、23】add unit tests for fused_hadamard_quant_fp8, moe_fused_hadamard_quant_fp8 Sep 14, 2025
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Sep 15, 2025
@luotao1 luotao1 added PaddlePaddle Hackathon and removed HappyOpenSource 快乐开源活动issue与PR labels Sep 15, 2025
paddle_output_fp32.numpy(),
actual_output_fp32.numpy(),
atol=1e-1,
rtol=1e-1,
Copy link
Collaborator

Choose a reason for hiding this comment

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

只能在1e-1的精度上对齐吗?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

我3060上测试是的,输出类型是 fp8,我转成 float32 比较的。
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

我之前没有完全按照 kernel 计算逻辑,低精度计算顺序什么的可能影响比较大,我重新实现一下

@ming1753
Copy link
Collaborator

融合算子中的hadamard只有一种实现,hadamard matrix的创建来自函数https://github.com/PaddlePaddle/FastDeploy/blob/develop/fastdeploy/model_executor/layers/utils.py#L197
第三方库的实现和这个等价也可。
算子精度确实存在一定问题,单测中只需要验证跑通性即可,精度问题我们之后自行修复。

@luotao1 luotao1 merged commit e36eccf into PaddlePaddle:develop Sep 25, 2025
15 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants