fix(glm): align and diagnose cross-framework router parity - #3635
Draft
yuhezhang-ai wants to merge 4 commits into
Draft
fix(glm): align and diagnose cross-framework router parity#3635yuhezhang-ai wants to merge 4 commits into
yuhezhang-ai wants to merge 4 commits into
Conversation
Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
Contributor
Author
|
/ok to test 50b6edd |
Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
Contributor
Author
|
/ok to test aca8222 |
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.
Summary
relaxedprofile only for this EP8 model's HF source and HF-export comparisons; AutoModel reload and native resume remainstandard.This PR is stacked on #3620.
Diagnosis
The 2,048-token identical-input probe found no single discontinuous layer: every local block stayed close to HF (cosine at least about 0.99993), while exact router-set agreement was about 98.4-99.7% per routed layer. The production-fix scoped run then measured:
The 70 tokens with no self-route flips had mean KL 0.0101, versus 0.3290 for tokens with one or more flips. This is an empirical floor rather than a pure routing-free control because causal attention can propagate earlier-token route differences.
Route replay controls
All replay controls include the three production precision fixes.
AutoModel replaying its own captured indices and weights was exactly identical (max logit difference and KL both zero, cosine 1). This rules out corruption in the replay/forced-dispatch mechanism for fixed AutoModel targets. Route bifurcation is the dominant tail amplifier, route-weight differences also matter, and a continuous cross-framework arithmetic/hidden-state residual still accumulates across 46 routed layers. The probes found no single broken layer or known semantic mismatch, although they cannot prove that no smaller mismatch remains.
Shape sensitivity and Qwen control
Changing only vanilla HF's total forward length reproduced GLM's failure shape: at 512 tokens,
KL(HF@4096[:512] || HF@512)was 0.1498, versus matched-shape HF-to-AutoModel KL 0.1528. Qwen3-30B-A3B showed why route-flip count itself must not gate:The models flip near-tied routes at similar rates, but GLM amplifies sustained route differences by roughly three orders of magnitude while Qwen re-converges. The new shape report therefore records both self-flip context and the final-token mean KL of sustained-flip tokens.
Scoped CI
The first exact scoped run (parent 64048635, job 407983121) ran the ordinary 50-step recipe and all robustness phases:
Native DCP resume was exact on all eight ranks: steps 5-7 had zero loss difference, and all parameter, buffer, optimizer, gradient, and post-step digests matched. The job failed only because the two cross-framework comparisons were still configured as
standard; this PR now selectsrelaxedfor those two phases only.Local validation