You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
One shape-agnostic entry per op: callers should not import shape packages #11
Callers (vLLM) should not need to know which shape package serves a call. Today that holds for the dense MXFP8 GEMM only.
Where it holds. vLLM calls gemm/mxfp8_common (mxfp8_linear, mxfp8_gemm_prequant) with tensors. The entry reads (N, K) from the weight and routes to the shape's folder gemm/mxfp8_n<N>_k<K> (_SHAPE_HOSTS, #9). tuned_shapes() tells the caller which shapes are covered.
Where it does not. Other packages are imported by their shape path, for example amd_kernels.gemm.mxfp8_bmm_mxfp8_out_n1024_k4096 (#7) or amd_kernels.norm.gemma_rmsnorm_bf16_mxfp8_h6144.host. Another model's shape, or another TP size, then needs a code change in vLLM.
Proposal. One entry per op contract:
it takes tensors and reads the shape from them;
it routes to the shape package (the packages stay as they are, one per shape);
for a call no package covers, it returns a reason, and the caller falls back to its own path.
The batched MXFP8 GEMM with MXFP8 output (#7) could be the first one, e.g. mxfp8_bmm(x, x_scale, w, w_scale, ...) in front of gemm/mxfp8_bmm_mxfp8_out_n1024_k4096. Related: #4 (a provider's select(op, args, kwargs) could sit on the same entries).
PR #10 now follows this: each Kimi-K3.1 op has one shape-agnostic entry, and the shape packages are unchanged. Head is 5659622.
The entries follow the gemm/mxfp8_common pattern:
Routing: a _SHAPE_HOSTS table maps a key read from tensor dims (plus the world size for communicating kernels) to a
shape-package module string. importlib loads that package on the first call of its key.
Fallback: <op>_unsupported_reason takes the op's arguments. It returns None or a one-line reason, host-only and
safe in graph capture. Off the table, <op> raises ValueError with the same text.
Coverage: <op>_shapes() lists the covered keys.
Factories (*_comm / *_workspace / *_runner) take the key dims as keywords and read the world size from the
group.
Entry packages (amd_kernels. ...):
sampling.top_p_mask_common: top_p_mask. Routes to top_p_mask_f32_v163840 and upstream top_p_mask_f32_v200064.
The PR body's "Entries (issue #11)" table lists each op's routed packages and reason functions.
Our vLLM integration now imports only these entries, with no shape package. Its c16 gsm8k smoke (250 questions, real
acceptance) matched the stock reference: 98.8%, acceptance length 3.628.
Activity
Kimi-K3.1 kernels: one shape-agnostic entry per op (Inferact#11)
Fangzhou-Ai commentedon Nov 21, 2026
PR #10 now follows this: each Kimi-K3.1 op has one shape-agnostic entry, and the shape packages are unchanged. Head is 5659622.
The entries follow the
gemm/mxfp8_commonpattern:_SHAPE_HOSTStable maps a key read from tensor dims (plus the world size for communicating kernels) to ashape-package module string.
importlibloads that package on the first call of its key.<op>_unsupported_reasontakes the op's arguments. It returnsNoneor a one-line reason, host-only andsafe in graph capture. Off the table,
<op>raisesValueErrorwith the same text.<op>_shapes()lists the covered keys.*_comm/*_workspace/*_runner) take the key dims as keywords and read the world size from thegroup.
Entry packages (
amd_kernels....):sampling.top_p_mask_common:top_p_mask. Routes totop_p_mask_f32_v163840and upstreamtop_p_mask_f32_v200064.sampling.markov_gumbel_common:markov_gumbel_fusedembedding.vocab_gather_common:vocab_gather_comm. Routes tovocab_gather_h7168_v163840_ranks8and upstreamvocab_gather_h6144(2 / 4 ranks).attention.kda_common:kda_decode_fb_gate_spec,kda_prefill,kda_mono_decodeattention.mla_decode_common:qkv_a_norm_kv_insert,indexer_prep,q_bproj_wuk_gather,fp8_sparse_mla_decode,lse_combine_vup,fp8_dense_mla_decodeindexer.mxfp4_indexer_common:mxfp4_paged_score_topk,mxfp4_prefill_score,mxfp4_prefill_topkcollectives.topk_gather_merge_common:topk_gather_merge_commcollectives.logits_exchange_common:logits_exchange_comm(gemm_exchange)moe.latent_moe_common:router_sigmoid_bias_topk,mxfp4_moe_experts,allreduce_latent_rmsnorm_up_proj,allreduce_slots_rmsnorm_up_proj,layer_tail_launchnorm.attnres_rmsnorm_common:attnres_comm(allreduce_attnres_rmsnorm)gemm.bf16_common:bf16_latent_down_mxfp4_quant,bf16_linear_gatherdecoder.bf16_dense_mlp_common:bf16_dense_mlpThe PR body's "Entries (issue #11)" table lists each op's routed packages and reason functions.
Our vLLM integration now imports only these entries, with no shape package. Its c16 gsm8k smoke (250 questions, real
acceptance) matched the stock reference: 98.8%, acceptance length 3.628.
Not part of this PR:
mxfp8_bmm([Kernel][DSv4.1] Add batched MXFP8 GEMM with fused MXFP8 output on MI355X #7)select(op, args, kwargs)could call<op>_unsupported_reasondirectly.🤖 Generated with Claude Code
[ROCm][DeepSeek-V4.1-Flash] amd_kernels routes for DEP8 on MI355X (fu…
[ROCm][DeepSeek-V4.1-Flash] amd_kernels routes for DEP8 on MI355X (fu…
attention: RMS norm + RoPE + bf16 / fp8 KV insert of 64-dim heads, an…
[ROCm][DeepSeek-V4.1-Flash] amd_kernels routes for DEP8 on MI355X (fu…
[ROCm][Kimi-K3.1] amd_kernels routes for TP8/DCP8 on MI355X
Kimi-K3.1-Pro TP8/DCP8 kernels for MI355X (#10)
[gfx950] DeepSeek-V4.1-Flash DEP8 kernel set (MI355X): sparse MLA, in…