Skip to content

Adopt the canonical MoE fold in the Qwen exact trainer combine (fixes trainer/sampler K3 divergence) - #56

Open
kiddyboots216 wants to merge 1 commit into
pr/gdn-cp-hybrid-u8from
pr/qwen-moe-canonical-fold
Open

Adopt the canonical MoE fold in the Qwen exact trainer combine (fixes trainer/sampler K3 divergence)#56
kiddyboots216 wants to merge 1 commit into
pr/gdn-cp-hybrid-u8from
pr/qwen-moe-canonical-fold

Conversation

@kiddyboots216

@kiddyboots216 kiddyboots216 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Pair the Qwen exact MoE combine with the serving canonical fold

Stacked on #55. This PR contains production code and conventional tests only.

Root cause

The exact Qwen trainer still reduced exchanged expert contributors with a reverse-rank BF16 chain after serving moved to canonical_moe_fold_v1, a balanced adjacent-pair BF16 tree. Matched per-rank partials were bitwise equal, but the two folds differed in 148,286/296,960 elements at the first MoE block, producing token-level K3 of 1.4e-3.

Fix

  • Name and export the trainer's independent transcription of canonical_moe_fold_v1.
  • Replace the Qwen trainer chain with the canonical fold after the unchanged contributor exchange.
  • Keep transport and backward semantics unchanged.
  • Remove stale ordered-combine assumptions from exact-lane validation.

Gates

  • Production-path replay: 124,720/124,720 decision tokens bitwise equal; K3 exactly 0.0.
  • Trainer fold equals the serving arithmetic on matched partials.
  • The canonical fold remains distinguishable from the retired chain at the measured discrimination profile.
  • Gradient engagement and existing Qwen exact-model suites pass.

Generality follow-up

Native-EP combine qualification is a per-family registry of admitted EP sizes, with the existing Qwen validator retained as a compatibility shim. Canonical-MoE trainer admission is table-driven by exact-contract family, certified layer count, and topology. Historical GLM-5.2 cases retain identical validation, while unknown families and unqualified sizes fail closed; a new family requires an explicit registry entry plus byte evidence.

@broly-code-security-scanner

Copy link
Copy Markdown

Broly Security Scan

Note

Clean scan
No vulnerabilities detected in this PR.

Note

Re-scan this PR anytime with /broly scan — useful after /broly undismiss, or to refresh findings without a new push.

Broly — SAST (zai-org/GLM-5.2) · Secrets · SCA · IaC · GH Actions · Base Images · Supply Chain Threats · Exploit Chains · Adversarial Verification

We're continuously improving Broly's accuracy and finding quality — your feedback is valuable. False positives, missed findings, bugs, and feature requests all welcome.

Ask in #security-engineering   Powered by Together AI

@kiddyboots216
kiddyboots216 force-pushed the pr/qwen-moe-canonical-fold branch 2 times, most recently from 0d8482b to 981ba80 Compare August 13, 2026 09:19
@kiddyboots216
kiddyboots216 force-pushed the pr/qwen-moe-canonical-fold branch from 981ba80 to 6f1609b Compare August 13, 2026 10:44
Use the serving-paired adjacent-tree fold for native-EP Qwen contributions and table-drive family and EP-size admission. Add arithmetic discrimination, gradient engagement, registry validation, and model-wiring tests.
@kiddyboots216
kiddyboots216 force-pushed the pr/qwen-moe-canonical-fold branch from 6f1609b to 9f114d3 Compare August 13, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant