Repository navigation
Fix float8 filter_fqns to exclude lm_head, not output - #4008
Merged
Merged
Conversation
Float8LinearConverter.filter_fqns is an exclude-list: Linear modules whose FQN matches any entry are kept in bf16 and not quantized to fp8. The LM head module is named `lm_head`, but llama3 (405b) and deepseek_v3 (671b) filtered on `output` -- the old llama head name -- which matches no FQN in the current models. As a result the precision-sensitive LM head was silently quantized to fp8 instead of being left in bf16. Point the filter at `lm_head` so the head stays bf16 as intended. kimi_k2_5 has the same issue and is fixed separately in its own PR.
shuhuayu
requested review from
fegin,
tianyu-l,
wconstab and
wwwjn
as code owners
July 29, 2026 07:17
tianyu-l
approved these changes
Jul 29, 2026
weifengpy
approved these changes
Jul 29, 2026
saforem2
added a commit
to saforem2/torchtitan
that referenced
this pull request
Jul 29, 2026
Replays upstream deepseek_v3 fix pytorch#4008 onto ezpz/moe per the sync protocol. Float8LinearConverter.filter_fqns is an EXCLUDE-list: matched Linear FQNs stay in bf16. Our 671B float8 config filtered on 'output' (the old head name), which matches no module in the current model -- the head is 'lm_head' -- so the precision-sensitive LM head was silently quantized to fp8 instead of kept bf16. Point the filter at 'lm_head' (keeping 'router.gate') to match the head's actual FQN. Only affects the float8 671B MoE path.
saforem2
added a commit
to saforem2/torchtitan
that referenced
this pull request
Jul 29, 2026
pytorch#4008 float8 filter_fqns -> replayed onto ezpz/moe (2db11d1). pytorch#4012 FA4 Blackwell varlen -> CUDA-gated, XPU-inert, no replay.
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.
Float8LinearConverter.filter_fqnsis an exclude-list: Linear modules whose FQN matches any entry are kept in bf16 and not quantized to fp8. The LM head module is namedlm_head, but llama3 (405b) and deepseek_v3 (671b) filtered onoutput-- the old llama head name -- which matches no FQN in the current models. As a result the precision-sensitive LM head was silently quantized to fp8 instead of being left in bf16. Point the filter atlm_headso the head stays bf16 as intended.