Skip to content

feat(low_latency): support top-16 routing and hidden-dim 3584 (Kimi-K3) - #11

Merged
Fridge003 merged 1 commit into
sgl-project:sgl-deepepfrom
samsja:fix/k3-topk16-hidden3584-sgldeepep
Aug 19, 2026
Merged

feat(low_latency): support top-16 routing and hidden-dim 3584 (Kimi-K3)#11
Fridge003 merged 1 commit into
sgl-project:sgl-deepepfrom
samsja:fix/k3-topk16-hidden3584-sgldeepep

Conversation

@samsja

@samsja samsja commented Aug 19, 2026

Copy link
Copy Markdown

Problem

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

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

Change (+4/−2)

  • 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).

Validation

mini-K3 (2 nodes, EP16, --deepep-mode auto, cuda-graph ON): decode cuda-graph capture passes SWITCH_HIDDEN and serves; greedy A/B vs the naive-a2a baseline agrees token-for-token into the low_latency decode region.

Opened against this fork per the sglang team's request (sglang vendors sgl-project/DeepEP:sgl-deepep); an equivalent PR is open against deepseek-ai/DeepEP (deepseek-ai#731).

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).
@Fridge003
Fridge003 merged commit e5a7a86 into sgl-project:sgl-deepep Aug 19, 2026
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.

2 participants