Repository navigation
Compute Step-3.7 router in float32 - #51521
qgallouedec wants to merge 3 commits into
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
zucchini-nlp
left a comment
There was a problem hiding this comment.
can we do it with _keep_in_fp32_modules_strict, i think that is the recommended way as per https://github.com/huggingface/transformers/pull/50722/changes
|
Thanks @zucchini-nlp! Tried it on a 288-expert, top-8 router loaded from a bf16 checkpoint. Share of tokens routed to the same experts as an fp32 reference:
So keeping the gate in fp32 fixes inference, but under autocast |
|
[For maintainers] Suggested jobs to run (before merge) run-slow: step3p7 |
zucchini-nlp
left a comment
There was a problem hiding this comment.
ahh i see, makes sense! Looing at the linked ai slop issues, seems like DS models also would need autocast guard tho? in main we force fp32 and have th weights in keep_fp32_strict but no autocast
I just want to make sure we're fixing it once for all models. Approving so i'm not blocking you, feel free to merge if DS routers don't need that
Resolves #50440.
Compute Step-3.7 router logits in FP32 with autocast disabled, matching the reference implementation and its
need_fp32_gate=truecheckpoint. The cast is unconditional: FP32 weights are unaffected, and BF16 autocast no longer downcasts the matmul.Who can review?
@zucchini-nlp