Skip to content
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
ab1ffa1
feat(srt-slurm): select golden DSpark acceptance for TokenSpeed
Yu-Zhewen Nov 13, 2026
9ce1a93
feat(srt-slurm): add TokenSpeed ROCm wheel installer and bind TokenSp…
Yu-Zhewen Nov 13, 2026
c75daba
feat(config): add TokenSpeed Kimi-K3.1-Pro MXFP4 MI355X AgentX with D…
Yu-Zhewen Nov 13, 2026
94716b7
fix(eval): leave top_p unset in TokenSpeed's lm-eval requests
Yu-Zhewen Nov 13, 2026
68d63e6
chore(config): pin TokenSpeed nightly wheels
Yu-Zhewen Nov 16, 2026
8e71128
chore(config): adopt latest TokenSpeed c48 recipe
Yu-Zhewen Nov 16, 2026
b632275
chore(config): let SMG read the K3.1 tokenizer from the checkpoint
Yu-Zhewen Nov 16, 2026
03e1ef6
fix(config): let TokenSpeed K3.1 reach the Hub for missing metadata f…
Yu-Zhewen Nov 17, 2026
5ae6ba7
fix(eval): drop top_p from greedy lm-eval requests
Yu-Zhewen Nov 17, 2026
e167149
Merge main into zhewenyu/k31-tokenspeed-mi355x-dspark
Yu-Zhewen Nov 17, 2026
8e9616b
perf(config): raise TokenSpeed K3.1 c24/c32 prefill-decode-min-interv…
Yu-Zhewen Nov 17, 2026
fdfefca
chore(config): serve the released Kimi K3.1 DSpark draft on TokenSpeed
Yu-Zhewen Nov 18, 2026
5613df6
chore(config): pin the November 18 TokenSpeed nightly wheels
Yu-Zhewen Nov 18, 2026
e5e6fe3
Merge main into zhewenyu/k31-tokenspeed-mi355x-dspark
Yu-Zhewen Nov 18, 2026
bece4b0
Merge main into zhewenyu/k31-tokenspeed-mi355x-dspark
Yu-Zhewen Nov 18, 2026
632f9f6
Merge main into zhewenyu/k31-tokenspeed-mi355x-dspark
Yu-Zhewen Nov 18, 2026
521f21b
Run TokenSpeed K3.1 concurrency 1 and 4 without Host L2
Yu-Zhewen Nov 18, 2026
f981d44
Pin TokenSpeed K3.1 Host L2 from the GTT pool at 128 GB per GPU
Yu-Zhewen Nov 19, 2026
346936b
Merge remote-tracking branch 'origin/main' into zhewenyu/k31-tokenspe…
Yu-Zhewen Nov 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -eo pipefail
source /infmax-workspace/benchmarks/check_env.sh
check_env_vars TOKENSPEED_WHEEL_URL TOKENSPEED_KERNEL_WHEEL_URL TOKENSPEED_KERNEL_AMD_WHEEL_URL TOKENSPEED_ENGINE_WHEEL_URL TOKENSPEED_SCHEDULER_VERSION ROUTER_VERSION

pip_install=(python3 -m pip install)
if python3 -m pip install --help 2>/dev/null | grep -q -- --break-system-packages; then
pip_install+=(--break-system-packages)
fi
# The runner image provides ROCm torch. Upgrading only what the pinned wheels
# need keeps it: PyPI's torch is a CUDA build.
"${pip_install[@]}" --upgrade --upgrade-strategy only-if-needed \
--index-url https://pypi.org/simple \
"$TOKENSPEED_WHEEL_URL" "$TOKENSPEED_KERNEL_WHEEL_URL" \
"$TOKENSPEED_KERNEL_AMD_WHEEL_URL" "$TOKENSPEED_ENGINE_WHEEL_URL" \
"tokenspeed-scheduler==$TOKENSPEED_SCHEDULER_VERSION" \
"tokenspeed-smg==$ROUTER_VERSION"
python3 -c 'import torch, sys; sys.exit(0 if torch.version.hip else "torch is not a ROCm build")'
python3 -m pip check
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Kimi K3.1 Pro MXFP4 on TokenSpeed (MI355X)

The `agentic.yaml` recipe backs the
`kimik3.1-fp4-mi355x-tokenspeed-agentic-dspark` matrix: one TokenSpeed worker
on eight MI355X GPUs with attention and MoE TP8 and EP1, so every GPU holds all
experts. The `Inferact/Kimi-K3.1-Pro-DSpark-preview` draft proposes three to
seven tokens per step and is served as it ships, in BF16. The KV cache is FP8
with the MXFP4 DSA indexer key cache, and the KDA recurrent state stays in
TokenSpeed's default FP32, as the K3.1 week-1 precision policy requires. The
context is 1,048,560 tokens, prefill runs in 8K chunks, and the Host L2 KV
store holds eight times the GPU KV blocks (`kvstore-ratio: 8`), up to 294.86 GB
per GPU.

Each concurrency has its own override:

| Concurrency | KVP / DCP | `max-num-seqs` | DSpark drafts | `prefill-decode-interval` | `prefill-decode-min-interval` | Other |
| ----------- | --------- | -------------- | ------------- | ------------------------- | ----------------------------- | ----- |
| 1 | 1 | 1 | 7 | 0 | 0 | no prefill graphs |
| 4 | 1 | 2 | 5 | 0 | 0 | no prefill graphs |
| 8 | 8 | 8 | 5 | 64 | 0 | |
| 16 | 8 | 8 | 5 | 80 | 8 | |
| 24 | 8 | 12 | 4 | 64 | 16 | short prefill first |
| 32 | 8 | 16 | 3 | 64 | 16 | short prefill first, mixed batches |
| 48 | 8 | 48 | 3 | 80 | 4 | mixed batches |

Decode graphs are captured up to `max-num-seqs`, and a cap below the
concurrency queues the extra sessions. From concurrency 8, each GPU stores one
eighth of every request's KV pages (KV parallel 8) and decode attends each
shard where it lives (DCP8). Those points also capture breakable prefill graphs
for chunks up to 3072 tokens.

With an interval of N, the scheduler runs up to N decode rounds after each
prefill chunk; the minimum interval keeps at least that many decode rounds
after every chunk, also for a prompt that has waited the full interval. Short
prefill first admits prompts with less uncached work first, and mixed batches
let prefill and decode share an iteration. The caps keep decode batches small
and the intervals keep prefill from interrupting decode; both lower TPOT at the
cost of time to first token.

The recipe installs the November 16 TokenSpeed, kernel, kernel-amd and engine
wheels by release URL and SHA256, `tokenspeed-scheduler` `0.1.57` from PyPI,
and `tokenspeed-smg` `1.16.0.post20261115`, the gateway that TokenSpeed
revision pins. The runner image, pinned by digest in the master config,
provides ROCm torch; `tokenspeed-nightly-rocm.sh` installs the pinned packages
without replacing it and checks that torch is still a ROCm build. The worker
pins the checkpoint with `revision` and the draft with
`speculative-draft-model-revision`.

The independent November 16 nightly jobs captured different source revisions:
TokenSpeed was built from `919f49c0`, while the ROCm kernel was built from
`f92e94c6`, two commits later, so the upstream ROCm index coherence check did
not publish this pair. Re-pin to a coherent nightly before marking the
submission ready.

Workers launch through `python3 -m tokenspeed.cli serve --headless` with SMG's
ZMQ transport. srtctl runs SMG directly, so the recipe passes the gateway
settings `ts serve` applies: passthrough reasoning and tool-call parsers,
round-robin routing, L0 and L1 tokenizer caches, warn logging, and no retries,
circuit breaker or load monitoring. The engine also receives the passthrough
reasoning parser, as under `ts serve`.

For synthetic throughput, the golden-AL connector derives acceptance from the
committed Kimi K3.1 Pro DSpark curve (probabilistic draft, block verification)
at each override's draft count and selects the greedy sampler, which verifies
by exact match. Because the greedy sampler rejects speculative sampling and the
synthetic length is itself the rejection method, the connector also removes the
speculative-sampling and block-verification settings. Eval runs keep the
recipe's real verification: the triton sampler with speculative sampling and
block verification.
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
base:
schema: 2
name: kimik3.1-fp4-mi355x-tokenspeed-agentic-dspark
identity:
model:
revision: d9e99b0792a5e93b78ea9bea62a68167e36ddd9e
container: {}
frameworks:
tokenspeed: 0.1.1.post20261116
tokenspeed-kernel: 0.1.5.post20261116
tokenspeed-kernel-amd: 0.1.4.post20261116
tokenspeed-scheduler: 0.1.57
tokenspeed-engine: 0.1.0.post20261118
resources:
gpu_type: mi355x
gpus_per_node: 8
observability:
enabled: false
tachometer:
enabled: false
# Up to two hours to load the 1.56 TB checkpoint, capture graphs and compile the first kernels.
health_check:
max_attempts: 720
interval_seconds: 10
frontend:
type: smg
enable_multiple_frontends: false
# srtctl runs SMG directly: these are the gateway settings `ts serve` applies.
args:
reasoning-parser: passthrough
tool-call-parser: passthrough
policy: round_robin
disable-circuit-breaker: true
disable-retries: true
disable-load-monitoring: true
tokenizer-cache-enable-l0: true
tokenizer-cache-enable-l1: true
log-level: warn
engine: tokenspeed
setup_script: tokenspeed-nightly-rocm.sh
environment:
TOKENSPEED_WHEEL_URL: https://github.com/lightseekorg/whl/releases/download/tokenspeed-nightly-v0.1.1.post20261116/tokenspeed-0.1.1.post20261116-py3-none-any.whl#sha256=de862f270b2c92590e3c8226b027c3fc0de9a271842e4a28ab96155c56e4a683
TOKENSPEED_KERNEL_WHEEL_URL: https://github.com/lightseekorg/whl/releases/download/tokenspeed-kernel-nightly-v0.1.5.post20261116-rocm72/tokenspeed_kernel-0.1.5.post20261116-cp312-cp312-manylinux_2_28_x86_64.whl#sha256=8cb0329bbe85ce10042b172c685a6144557357be83eed042ea2db55b717fd584
TOKENSPEED_KERNEL_AMD_WHEEL_URL: https://github.com/lightseekorg/whl/releases/download/tokenspeed-kernel-amd-nightly-v0.1.4.post20261116/tokenspeed_kernel_amd-0.1.4.post20261116-py3-none-any.whl#sha256=1c0ec9eb8e5d2635ff69c36332149177ff486a1d74b2efd5ddf961ac42edcd69
TOKENSPEED_SCHEDULER_VERSION: 0.1.57
TOKENSPEED_ENGINE_WHEEL_URL: https://github.com/lightseekorg/whl/releases/download/tokenspeed-engine-v0.1.0.post20261118/tokenspeed_engine-0.1.0.post20261118-cp312-abi3-manylinux_2_28_x86_64.whl#sha256=b1e817b8008d06835698b7d95f1a9d10b9ae4787f6d4d3b47781ebf1087b30b3
roles:
agg:
nodes: 1
workers: 1
gpus: 8
env:
GPU_MAX_HW_QUEUES: '2'
PYTHONNOUSERSITE: '1'
# Serve from the pre-seeded shared HF cache with no Hub API calls.
HF_HUB_OFFLINE: '1'
args:
served-model-name: moonshotai/Kimi-K3.1-Pro
revision: d9e99b0792a5e93b78ea9bea62a68167e36ddd9e
trust-remote-code: true
# Attention and MoE TP8; EP1 keeps every expert on every GPU.
attn-tp-size: 8
data-parallel-size: 1
ep-size: 1
pipeline-parallel-size: 1
moe-backend: auto
kv-cache-dtype: fp8
# The K3.1 precision policy's FP4 DSA indexer key cache.
dsa-index-k-format: mxfp4
language-model-only: true
max-model-len: 1048560
chunked-prefill-size: 8192
max-prefill-tokens: 8192
gpu-memory-utilization: 0.95
enable-prefix-caching: true
# Host L2 holds eight times the GPU KV blocks: 294.86 GB per GPU without KV
# parallelism, 217.95 GB with KVP8.
kvstore-ratio: 8
reasoning-parser: passthrough
drafter-attention-backend: gluon
speculative-algorithm: DSPARK
speculative-draft-model-path: Inferact/Kimi-K3.1-Pro-DSpark-preview
speculative-draft-model-revision: 6a2ef20a05efe88aabbf9ecaa12d020c3b0edf94
# Drafts per step (overrides change it); the verify window adds the current token.
speculative-num-steps: 5
speculative-num-draft-tokens: 6
speculative-eagle-topk: 1
# Real verification. The connector selects greedy sampling and the golden acceptance
# length for synthetic throughput.
sampling-backend: triton
enable-speculative-sampling: true
speculative-rejection-sample-method: block
enable-metrics: true
metrics-host: 0.0.0.0
benchmark:
env:
# Warmup can leave bytes unacknowledged past AIPerf's 30 s default.
AIPERF_HTTP_TCP_USER_TIMEOUT: '900000'
AIPERF_REQUIRED_SERVER_METRIC_PREFIX: 'tokenspeed:'

override_tp8_c1:
roles:
agg:
args:
max-num-seqs: 1
max-cudagraph-capture-size: 1
cudagraph-capture-sizes: [1]
disable-prefill-graph: true
speculative-num-steps: 7
speculative-num-draft-tokens: 8
benchmark:
env:
CONC: '1'
KV_OFFLOADING: dram
TOTAL_CPU_DRAM_GB: '2360'

override_tp8_c4:
roles:
agg:
args:
# Running cap below concurrency: the other sessions wait for their first token.
max-num-seqs: 2
max-cudagraph-capture-size: 2
cudagraph-capture-sizes: [1, 2]
disable-prefill-graph: true
benchmark:
env:
CONC: '4'
KV_OFFLOADING: dram
TOTAL_CPU_DRAM_GB: '2360'

override_tp8_dcp8_c8:
roles:
agg:
args:
max-num-seqs: 8
max-cudagraph-capture-size: 8
cudagraph-capture-sizes: [1, 2, 3, 4, 5, 6, 7, 8]
# Each GPU stores one eighth of every request's KV pages and decode attends its own shard.
kv-parallel-size: 8
decode-context-parallel-size: 8
prefill-graph-capture-sizes: [256, 512, 1024, 1536, 2048, 3072]
prefill-graph-max-tokens: 3072
# Up to 64 decode rounds run after each prefill chunk before the next prefill round.
prefill-decode-interval: 64
benchmark:
env:
CONC: '8'
KV_OFFLOADING: dram
TOTAL_CPU_DRAM_GB: '2360'

override_tp8_dcp8_c16:
roles:
agg:
args:
max-num-seqs: 8
max-cudagraph-capture-size: 8
cudagraph-capture-sizes: [1, 2, 3, 4, 5, 6, 7, 8]
kv-parallel-size: 8
decode-context-parallel-size: 8
prefill-graph-capture-sizes: [256, 512, 1024, 1536, 2048, 3072]
prefill-graph-max-tokens: 3072
prefill-decode-interval: 80
# At least 8 decode rounds after every prefill chunk, also once a prompt waited the full interval.
prefill-decode-min-interval: 8
benchmark:
env:
CONC: '16'
KV_OFFLOADING: dram
TOTAL_CPU_DRAM_GB: '2360'

override_tp8_dcp8_c24:
roles:
agg:
args:
max-num-seqs: 12
max-cudagraph-capture-size: 12
cudagraph-capture-sizes: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
kv-parallel-size: 8
decode-context-parallel-size: 8
prefill-graph-capture-sizes: [256, 512, 1024, 1536, 2048, 3072]
prefill-graph-max-tokens: 3072
prefill-decode-interval: 64
prefill-decode-min-interval: 16
enable-short-prefill-first: true
speculative-num-steps: 4
speculative-num-draft-tokens: 5
benchmark:
env:
CONC: '24'
KV_OFFLOADING: dram
TOTAL_CPU_DRAM_GB: '2360'

override_tp8_dcp8_c32:
roles:
agg:
args:
max-num-seqs: 16
max-cudagraph-capture-size: 16
cudagraph-capture-sizes: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
kv-parallel-size: 8
decode-context-parallel-size: 8
prefill-graph-capture-sizes: [256, 512, 1024, 1536, 2048, 3072]
prefill-graph-max-tokens: 3072
prefill-decode-interval: 64
prefill-decode-min-interval: 16
enable-short-prefill-first: true
enable-mixed-batch: true
speculative-num-steps: 3
speculative-num-draft-tokens: 4
benchmark:
env:
CONC: '32'
KV_OFFLOADING: dram
TOTAL_CPU_DRAM_GB: '2360'

override_tp8_dcp8_c48:
roles:
agg:
args:
max-num-seqs: 48
max-cudagraph-capture-size: 48
cudagraph-capture-sizes: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48]
kv-parallel-size: 8
decode-context-parallel-size: 8
prefill-graph-capture-sizes: [256, 512, 1024, 1536, 2048, 3072]
prefill-graph-max-tokens: 3072
prefill-decode-interval: 80
prefill-decode-min-interval: 4
enable-mixed-batch: true
speculative-num-steps: 3
speculative-num-draft-tokens: 4
benchmark:
env:
CONC: '48'
KV_OFFLOADING: dram
TOTAL_CPU_DRAM_GB: '2360'
23 changes: 23 additions & 0 deletions inferencex-e2e/configs/amd-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1216,6 +1216,29 @@ kimik3.1-fp4-mi355x-sglang-agentic-dflash-disagg:
prefill: { num-worker: 1, tp: 8, ep: 1, dp-attn: false, dcp-size: 8 }
decode: { num-worker: 1, tp: 8, ep: 1, dp-attn: false, dcp-size: 8 }

kimik3.1-fp4-mi355x-tokenspeed-agentic-dspark:
image: lightseekorg/tokenspeed-runner-amd:rocm7.2.4-pytorch-2.14.0-gfx950@sha256:25949b7a6306e9fbc0165091cc67d9bded9965ed1d664b55f9966e7df0b05e51
model: moonshotai/Kimi-K3.1-Pro
model-prefix: kimik3.1
runner: cluster:mi355x-amds
precision: fp4
framework: tokenspeed
multinode: false
router: { name: smg, version: 1.16.0.post20261115 }
srt-recipe-dir: kimik3.1/tokenspeed/mi355x-fp4
scenarios:
agentic-coding:
# The recipe's Host L2 pins up to 8 x 294.86 GB = 2358.88 GB (c1, c4); 0.787 resolves to 2360 GB.
- dram-utilization: 0.787
search-space:
- { tp: 8, ep: 1, dcp-size: 1, spec-decoding: mtp, kv-offloading: dram, kv-offload-backend: { name: kvstore }, conc-list: [1], srt-recipe: agentic.yaml:override_tp8_c1 }
- { tp: 8, ep: 1, dcp-size: 1, spec-decoding: mtp, kv-offloading: dram, kv-offload-backend: { name: kvstore }, conc-list: [4], srt-recipe: agentic.yaml:override_tp8_c4 }
- { tp: 8, ep: 1, dcp-size: 8, spec-decoding: mtp, kv-offloading: dram, kv-offload-backend: { name: kvstore }, conc-list: [8], srt-recipe: agentic.yaml:override_tp8_dcp8_c8 }
- { tp: 8, ep: 1, dcp-size: 8, spec-decoding: mtp, kv-offloading: dram, kv-offload-backend: { name: kvstore }, conc-list: [16], srt-recipe: agentic.yaml:override_tp8_dcp8_c16 }
- { tp: 8, ep: 1, dcp-size: 8, spec-decoding: mtp, kv-offloading: dram, kv-offload-backend: { name: kvstore }, conc-list: [24], srt-recipe: agentic.yaml:override_tp8_dcp8_c24 }
- { tp: 8, ep: 1, dcp-size: 8, spec-decoding: mtp, kv-offloading: dram, kv-offload-backend: { name: kvstore }, conc-list: [32], srt-recipe: agentic.yaml:override_tp8_dcp8_c32 }
- { tp: 8, ep: 1, dcp-size: 8, spec-decoding: mtp, kv-offloading: dram, kv-offload-backend: { name: kvstore }, conc-list: [48], srt-recipe: agentic.yaml:override_tp8_dcp8_c48 }

glm5.3flash-fp8-mi325x-sglang-agentic-mtp:
image: lmsysorg/sglang:v0.5.22-rocm10-mi30x@sha256:5658cd0d8de0c68de10d2e349296f55ceff98053182fa87b2a7e942e5e7f3c2a
model: zai-org/GLM-5.3-Flash
Expand Down
7 changes: 6 additions & 1 deletion inferencex-e2e/infx/bench/eval/lm_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,17 @@ def run(ctx: EvalContext) -> EvalOutcome:
"tokenized_requests=False",
f"max_length={ctx.context_length}",
]
# TokenSpeed's gateway (SMG) refuses any top_p but the one a model pins (Kimi K3: 0.95),
# and temperature 0 decodes greedily without reading top_p.
sampling = f"max_tokens={max_tokens},temperature=0"
if ctx.env.get("FRAMEWORK") != "tokenspeed":
sampling += ",top_p=1"
argv = [
sys.executable, "-m", "lm_eval", "--model", "local-chat-completions",
"--apply_chat_template", "--tasks", tasks(ctx.env),
"--output_path", str(ctx.results_dir), "--log_samples",
"--model_args", ",".join(model_args),
"--gen_kwargs", f"max_tokens={max_tokens},temperature=0,top_p=1",
"--gen_kwargs", sampling,
] # fmt: skip
if limit := env.optional("EVAL_LIMIT", env=ctx.env):
argv += ["--limit", limit]
Expand Down
Loading
Loading