Skip to content

feat(low_latency): support top-16 routing and hidden-dim 3584 - #731

Draft
samsja wants to merge 1 commit into
deepseek-ai:mainfrom
samsja:fix/k3-topk16-hidden3584
Draft

feat(low_latency): support top-16 routing and hidden-dim 3584#731
samsja wants to merge 1 commit into
deepseek-ai:mainfrom
samsja:fix/k3-topk16-hidden3584

Conversation

@samsja

@samsja samsja commented Aug 18, 2026

Copy link
Copy Markdown

Problem

The low_latency internode dispatch/combine kernels hard-cap top-k at 11 and only
template-specialize on a fixed set of a2a hidden dims. Two MoE configs don't fit
(both hit by Kimi-K3 — 896 experts, top-16, routed-expert hidden 3584):

  • top-16 routing trips EP_HOST_ASSERT(num_topk <= kNumMaxTopK) (dispatch) and the
    kNumMaxTopk equivalent (combine).
  • routed-expert hidden 3584 falls through SWITCH_HIDDEN's default → "Unsupported
    hidden". (This is the a2a hidden dim, not the model hidden_size.)

Change

  • kNumMaxTopK / kNumMaxTopk 11 → 16 (dispatch + combine).
  • Add case 3584 to SWITCH_HIDDEN — 3584 satisfies the LL alignment invariants
    (%128, %256 = 32·kNumElemsPerRead, %512 for the combine kNumSendUnrolls=2 path).

Follows #458 (hidden-dim 3072).

Validation

mini-K3 (2 nodes, EP16, --deepep-mode auto, cuda-graph ON): decode cuda-graph capture
passes SWITCH_HIDDEN and serves without crash; greedy A/B vs the naive-a2a baseline
agrees token-for-token into the low_latency decode region. Draft pending a full-model
multi-node coherence run.

The low_latency internode dispatch/combine kernels cap top-k at 11 and only
template-specialize on a fixed set of a2a hidden dims. Two configs don't fit
(both hit by Kimi-K3 — 896 experts, top-16, routed-expert hidden 3584):

- top-16 routing trips EP_HOST_ASSERT(num_topk <= kNumMaxTopK) (dispatch) and the
  kNumMaxTopk equivalent (combine) -> raise both 11 -> 16.
- routed-expert hidden 3584 falls through SWITCH_HIDDEN's default -> add case 3584
  (satisfies the LL alignment invariants: %128, %256, and %512 for the combine
  kNumSendUnrolls=2 path).

Follows deepseek-ai#458 (hidden-dim 3072).
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