Skip to content

feat(moe): add hash-based token routing - #5938

Closed
FDecaYed wants to merge 1 commit into
NVIDIA:mainfrom
FDecaYed:codex/hash-moe-routing
Closed

feat(moe): add hash-based token routing#5938
FDecaYed wants to merge 1 commit into
NVIDIA:mainfrom
FDecaYed:codex/hash-moe-routing

Conversation

@FDecaYed

@FDecaYed FDecaYed commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

What

Add model-neutral Hash MoE routing:

  • persistent token-to-expert lookup tables for the leading MoE layers;
  • softmax, sigmoid, and sqrt-softplus combination scores;
  • forced benchmark routing override and inference fallback;
  • input_ids plumbing through TransformerBlock, TransformerLayer, recompute, partial CUDA graphs, and MoELayer;
  • validation for vocabulary size, PP placement, MTP exclusion, and unsupported EP overlap;
  • focused router and real TransformerLayer/MoE coverage.

This is an independent root. It intentionally stops before HybridModel/HybridStack, training CLI, attention, Clamp/SwiGLU, mHC, and recipe wiring.

Stack

Provenance

Testing

  • isort --check-only, ruff, Black --check, Python compilation, and git diff --check passed for the slice.
  • The 8-rank focused pytest was attempted locally; collection is blocked on this macOS host by missing Triton/CUDA (CUDA device count is zero), not by a test assertion.

Add token-to-expert hash routing with TransformerBlock/Layer plumbing, recompute and CUDA-graph support, inference fallback, and focused coverage.

Signed-off-by: Deyu Fu <Deyu.Foo@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@FDecaYed

Copy link
Copy Markdown
Contributor Author

/ok to test da1b6f4

Copy link
Copy Markdown
Contributor Author

Closing this draft until Round 2. Its logical successor is P4: complete HybridModel-only Hash MoE, rebuilt after P2 and absorbing #5945. GPTModel/TransformerBlock-only support is intentionally excluded. Tracking PR: #5795.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant