Repository navigation
Conversation
Extract the existing working fork feature for first maintainer feedback. Preserve carried code and tests; limit validation to lightweight structural checks. See the linked mechanism reference for actual API/call and failure paths.
Qubitium
force-pushed
the
upstream/25-dots3-separate-experts-20261108
branch
from
November 9, 2026 09:47
53677b6 to
5b50937
Compare
Qubitium
reviewed
Nov 9, 2026
Qubitium
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed against current main.
The separate-expert adapter is sound:
_SeparateDots3Expertsreplaces the upstream stacked projection with oneDots3NoteTextMLPper routed expert, sonamed_modules()exposes.experts.<id>.<proj>and each expert can own its Hessian/EXL3 payload. The forward scatters only the experts the router actually selected (torch.unique(top_k_index)), which keeps a 256-expert calibration forward bounded, and it validates out-of-range ids.before_model_loadswaps the Transformers class and guards_init_weightsfor the already-initialized per-expert Linears;after_model_loadbinds learned-router recovery and fails closed when the patched router count does not match the sparse layer count.out_of_model_tensorsretains the vision/audio/MTP and extra-layer tensors that the text-only calibration shell does not instantiate, which is required for a usable vLLM export.- The
module_treeentry usesexperts: {"#": (...)}, matching the per-expert layout, and the registered-plan/fusable fixtures were updated consistently.
Cleanup: import ordering in the new definition.
Environment note (non-blocking): transformers.models.dots3_note is not present in the installed Transformers 5.22.1, so the definition is forward-looking for the Transformers version that ships this model. The module-tree plan tests do not import it and pass.
Validation: ruff check clean; pytest tests/module_tree/test_dots3_note_fork_plan.py tests/module_tree/test_registered_module_plans.py tests/module_tree/test_fusable_models.py reports 769 passed.
Qubitium
marked this pull request as ready for review
November 9, 2026 09:47
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
Register Dots3 Note with separate per-expert checkpoint names, native top-k scatter, auxiliary tensor passthrough, and grouped-router recovery. Preserve the existing model adapter; do not refactor the expert implementation in this extraction.
This is layer 25/36, extracted from an already-used fork for initial maintainer feedback. It depends on #3604. Review only this feature; the cross-fork Files changed view is cumulative because the PR targets upstream
main.Incremental change: 8 files, +195/−1 lines, including carried tests and the mechanism reference. No merge is automatic. Review value and API shape first; substantial rework can follow that feedback.
Flow and existing-code boundary
flowchart TD S0["Dots3NoteQModel"] M0_0["Dots3NoteQModel.before_model_load"] M0_1["Dots3NoteQModel.after_model_load"] M0_2["Dots3NoteQModel.zero_route_recovery_context"] S1["_SeparateDots3Experts"] M1_0["_SeparateDots3Experts.__init__"] M1_1["_SeparateDots3Experts.forward"] E["IndexError, RuntimeError"] S0 -. "exposes" .-> M0_0 S0 -. "exposes" .-> M0_1 S0 -. "exposes" .-> M0_2 S0 -->|"raises on rejected input/state"| E S1 -. "exposes" .-> M1_0 S1 -. "exposes" .-> M1_1 S1 -->|"raises on rejected input/state"| E style E fill:#fee,stroke:#b22gptqmodel/models/definitions/dots3_note.py:44:Dots3NoteQModelgptqmodel/models/definitions/dots3_note.py:13:_SeparateDots3ExpertsCommitted reference: docs/dots3-separate-experts.md, linked from README. Class entry points/calls and rejected-state paths describe code present in this branch, rather than planned integrations.
Validation
Carried test files:
tests/module_tree/test_dots3_note_fork_plan.pyThis packaging pass checked Python parsing, whitespace, dependency order and balanced Mermaid blocks. The author reports successful prior use of these features. Per the requested resource limit and feedback-first scope, existing model quantization, GPU/ROCm tests, heavyweight CPU workloads and full model benchmarks were not rerun; no new performance or model-accuracy claim is made. Tests accompanying earlier stack layers retain their previously reported results.
New registrations include explicit module-plan inventory entries, targeted plan tests and unqualified fusion entries. Three model-specific plan tests plus the selected registry/consumer metadata cases passed as part of the 10-test CPU metadata group; actual checkpoint/hardware tests were not rerun.