Model accuracy alignment 2#2
Open
zhengshengning wants to merge 1 commit into
Open
Conversation
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.
问题9: permute 反向
index_select的 fp32 反向累积实现diff描述:forward 与原生 tokens.index_select(0, sorted_indices) 完全一致。backward 时,多个 permuted 行会回写到同一个原始 token 行(一个 token 被 topk 个 expert 选中),原生 index_select 的 backward 走 bf16 index_add/scatter_add,atomic 累加顺序不可复现,与 PaddleFleet 末位 diff。这里把 grad 提升到 fp32 后 scatter_add 累加,再 cast 回原 dtype,单次 round,复刻 PF 侧确定性 fp32 累加路径。