Repository navigation
[graph_trainer] Add bitwise numerics coverage for Muse Glimmer - #5836
Merged
Merged
Conversation
ydwu4
approved these changes
Nov 5, 2026
GraphTrainer already ran Muse Glimmer through its integration tests, but nothing checked its numerics against eager. Add the bitwise harness classes (Varlen and FlexAttention) and a four-GPU eager vs GraphTrainer loss compare. The vision flavor (debugmodel_mm) failed deep in tracing with a data-dependent-shape error; the GraphTrainer config now rejects a vision encoder with a ValueError. The loss compare uses FlexAttention: FA4's Varlen backward is not deterministic for full causal attention on Blackwell, so two Varlen eager runs with FSDP2+TP2 already differ in grad_norm at step 1. Testing: - test_bitwise_deterministic.py::TestMuseGlimmerBitwiseDeterministic and TestMuseGlimmerFlexAttnBitwiseDeterministic: eager vs aot_fx_trace, trace vs precompile, and numerics_changing_optim run-to-run are bitwise identical in loss, model hash, and gradient hash (GB300). - test_numerics.py::test_dense_muse_glimmer_aot_fx_trace_vs_eager: eager FSDP2 vs GraphTrainer with FSDP2+TP2 on 4 GPUs, loss and grad_norm bitwise identical for 20 steps. - Local: Interleaved1F1B PP2 eager vs GraphTrainer on 2 GPUs, loss and grad_norm bitwise identical for 10 steps.
SherlockNoMad
changed the base branch from
SherlockNoMad/gt_kimi_k2_7
to
main
November 9, 2026 20:42
SherlockNoMad
force-pushed
the
SherlockNoMad/gt_muse_glimmer
branch
from
November 9, 2026 20:42
7664160 to
6c86f1b
Compare
SherlockNoMad
marked this pull request as ready for review
November 9, 2026 20:43
SherlockNoMad
requested review from
IvanKobzarev,
acisseJZhong,
aditvenk,
fegin,
felipemello1,
sanketpurandare,
shuhuayu,
tianyu-l and
wwwjn
as code owners
November 9, 2026 20:43
aditvenk
approved these changes
Nov 9, 2026
| pass | ||
| def __post_init__(self) -> None: | ||
| MuseGlimmerModel.Config.__post_init__(self) | ||
| # TODO: The vision encoder reads image grids on the host and builds |
Contributor
There was a problem hiding this comment.
Do we want to support this in GT in the future?
Contributor
Author
There was a problem hiding this comment.
sure, depending if anyone needs it.
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.
Stacked on #5835.
Summary (human-written)
Why
GraphTrainer already runs Muse Glimmer in its integration tests, but nothing
checks its numerics against eager, so a GraphTrainer change could silently
alter Muse Glimmer's loss. The vision flavor (
debugmodel_mm) also fails deepin tracing with a data-dependent-shape error instead of a clear message.
Example.
What changed
graph_trainer/muse_glimmer/model.py: the config rejects a vision encoderwith
ValueError, like Kimi K3, Kimi K2.7, and Qwen3.5 earlier in this stack.recipe; 4-GPU numerics configs (FSDP2 + TP2); README row.
Numerics
Eager FSDP2 vs GraphTrainer, seed 42, deterministic,
scripts/loss_compare.py --assert-equal. Measured on base0f3481537.Rebasing onto
d0ab95e46changed only recipe field names in this diff(#5776, #5779); re-verification on the new base is in progress.
debugmodel, FlexAttention, FSDP2 + TP2, 20 stepsdebugmodel, PP2 Interleaved1F1B, 10 stepsThe 4-GPU comparison uses FlexAttention. FA4's Varlen backward is not
deterministic for full causal attention on Blackwell, so two Varlen eager runs
with FSDP2 + TP2 already differ in grad_norm at step 1.
Testing
test_bitwise_deterministic.py::TestMuseGlimmerBitwiseDeterministicandTestMuseGlimmerFlexAttnBitwiseDeterministic(1 GPU): eager vsaot_fx_trace, trace vs precompile, and
numerics_changing_optimrun-to-runproduce bitwise identical loss, model hash, and gradient hash.
test_numerics.py::test_dense_muse_glimmer_aot_fx_trace_vs_eager(4 GPUs):the FSDP2 + TP2 row above.
Known issues / follow-ups