[XPU]Fix w4a8 precision bug && rollback moe algo #4463
Merged
EmmonsCurse merged 4 commits intoPaddlePaddle:developfrom Oct 17, 2025
Merged
[XPU]Fix w4a8 precision bug && rollback moe algo #4463EmmonsCurse merged 4 commits intoPaddlePaddle:developfrom
EmmonsCurse merged 4 commits intoPaddlePaddle:developfrom
Conversation
|
Thanks for your contribution! |
| cache_v_scale = self.cache_quant_config.max_bound / cache_v_scale_tensor | ||
| cache_k_out_scale = cache_k_scale_tensor / self.cache_quant_config.max_bound | ||
| cache_v_out_scale = cache_v_scale_tensor / self.cache_quant_config.max_bound | ||
| cache_k_out_scale = cache_k_scale_tensor |
Collaborator
There was a problem hiding this comment.
cache_k_out_scale 和 cache_k_scale 不是倒数关系吗?
Collaborator
Author
There was a problem hiding this comment.
在对称量化里面,实际上block_attn算子的cache_k_out_scale需要max值。之前就是理解错了,导致会有乱码。
/**
- qkv shape: [token_num, (num_heads + 2 * kv_num_heads) * head_dim]
- k_scales/v_scales value: 127 / max (type = TS)
- k_scales_inv/v_scales_inv value:
-
- perchannel with zp: max / 127 (type = TS)
-
- perchannel without zp: max (type = float)
**/
- perchannel without zp: max (type = float)
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.
1、由于使用新的EP MOE算子导致显存占用增加,导致300B 128K 8卡模型启动过程报OOM的问题,回退MOE算子
2、修复W4A8C8模型的精度问题