Skip to content

Commit 6897c45

Browse files
edwingao28hyukjlee
authored andcommitted
feat(amd): add Kimi-K3 DSpark AgentX variant
Add the MI355X DSpark wrapper, TP8 vLLM configuration, synthetic golden-AL handling, and performance changelog entry. 中文:新增 MI355X Kimi-K3 DSpark AgentX 包装脚本与 TP8 vLLM 配置,接入合成黄金接受长度,并登记性能变更日志。
1 parent 73e1467 commit 6897c45

6 files changed

Lines changed: 98 additions & 7 deletions

File tree

.github/workflows/e2e-tests.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,14 +310,15 @@ jobs:
310310
dp-attn: ${{ matrix.config.dp-attn }}
311311
conc: ${{ matrix.config.conc }}
312312
kv-offloading: ${{ matrix.config.kv-offloading }}
313-
kv-offload-backend: ${{ matrix.config.kv-offload-backend }}
313+
kv-offload-backend: ${{ matrix.config['kv-offload-backend'].name }}
314+
kv-offload-backend-metadata: ${{ matrix.config['kv-offload-backend'] && toJson(matrix.config['kv-offload-backend']) || '' }}
314315
total-cpu-dram-gb: ${{ matrix.config.total-cpu-dram-gb }}
315316
duration: ${{ inputs.agentx-fast && '1200' || (inputs.duration-override != '' && inputs.duration-override || matrix.config.duration) }}
316317
agentx-fast: ${{ inputs.agentx-fast }}
317318
isl: '0'
318319
osl: '0'
319320
max-model-len: '0'
320-
spec-decoding: 'none'
321+
spec-decoding: ${{ matrix.config.spec-decoding }}
321322
disagg: ${{ 'false' }}
322323
run-eval: true
323324
eval-only: true

benchmarks/single_node/agentic/kimik3_fp4_mi355x.sh

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ set -x
4747
# LANGUAGE_MODEL_ONLY false (reference loads the vision tower)
4848
# KV_CACHE_DTYPE fp8 (default for every arm; =auto for a bf16 A/B)
4949
# MAX_MODEL_LEN unset (unset -> vLLM derives K3's 1M context)
50-
# SPEC_DECODE false (DSpark; UNVALIDATED on ROCm)
50+
# SPEC_DECODE false (enabled by the _mtp DSpark wrapper)
51+
# ENFORCE_EAGER false (enabled by the _mtp DSpark wrapper)
5152

5253
source "$(dirname "$0")/../../benchmark_lib.sh"
5354

@@ -543,6 +544,11 @@ if [ -n "${MAX_MODEL_LEN:-}" ] && [ "${MAX_MODEL_LEN}" != "0" ]; then
543544
MAX_MODEL_LEN_ARGS=(--max-model-len "$MAX_MODEL_LEN")
544545
fi
545546

547+
EAGER_ARGS=()
548+
if [ "${ENFORCE_EAGER:-false}" = "true" ]; then
549+
EAGER_ARGS=(--enforce-eager)
550+
fi
551+
546552
# The reference command passes neither --enable-prefix-caching nor
547553
# --no-enable-prefix-caching, and this build's default is None (vLLM decides
548554
# internally), so by default we pass nothing and stay aligned. Two reasons this
@@ -579,17 +585,36 @@ fi
579585

580586
# The upstream DSpark config pins "attention_backend": "FLASHINFER_MLA", which
581587
# is CUDA-only and cannot be used verbatim on gfx950; SPEC_ATTN_BACKEND
582-
# overrides it. Golden AL on B300 is 3.78 at 7 draft tokens
583-
# (golden_al_distribution/kimik3_dspark.yaml), so this is the largest decode-side
584-
# lever if it can be made to run here.
588+
# overrides it. AgentX throughput uses synthetic acceptance pinned to the
589+
# committed golden curve. Eval-only runs use real block verification because
590+
# synthetic acceptance bypasses correctness verification.
585591
SPEC_ARGS=()
586592
if [ "${SPEC_DECODE:-false}" = "true" ]; then
587593
SPEC_DRAFT_MODEL="${SPEC_DRAFT_MODEL:-Inferact/Kimi-K3-DSpark}"
588594
SPEC_NUM_TOKENS="${SPEC_NUM_TOKENS:-7}"
589595
SPEC_ATTN_BACKEND="${SPEC_ATTN_BACKEND:-TRITON_MLA}"
596+
SPEC_GOLDEN_AL="${SPEC_GOLDEN_AL:-3.84}"
597+
SPEC_GOLDEN_AL_FILE="${SPEC_GOLDEN_AL_FILE:-golden_al_distribution/kimik3_dspark_probabilistic_sample_method_block_rejection_sample_method.yaml}"
598+
FILE_GOLDEN_AL=$(awk -v k="$SPEC_NUM_TOKENS" '
599+
/^kimi-k3:/ { in_model = 1; next }
600+
/^[^[:space:]#]/ { in_model = 0 }
601+
in_model && /thinking_on:/ { in_thinking = 1; next }
602+
in_thinking && $1 == k":" { print $2; exit }
603+
' "$SPEC_GOLDEN_AL_FILE" 2>/dev/null)
604+
if [ "$FILE_GOLDEN_AL" != "$SPEC_GOLDEN_AL" ]; then
605+
echo "Error: DSpark golden AL mismatch: $SPEC_GOLDEN_AL_FILE gives" >&2
606+
echo " '${FILE_GOLDEN_AL:-<unreadable>}' for k=$SPEC_NUM_TOKENS," >&2
607+
echo " but the recipe pins $SPEC_GOLDEN_AL." >&2
608+
exit 1
609+
fi
610+
if [ "${EVAL_ONLY:-false}" = "true" ]; then
611+
SPEC_REJECTION_CONFIG="\"rejection_sample_method\":\"block\""
612+
else
613+
SPEC_REJECTION_CONFIG="\"rejection_sample_method\":\"synthetic\",\"synthetic_acceptance_length\":$SPEC_GOLDEN_AL"
614+
fi
590615
SPEC_ARGS=(
591616
--speculative-config
592-
"{\"model\":\"$SPEC_DRAFT_MODEL\",\"num_speculative_tokens\":$SPEC_NUM_TOKENS,\"method\":\"dspark\",\"attention_backend\":\"$SPEC_ATTN_BACKEND\",\"draft_sample_method\":\"probabilistic\",\"rejection_sample_method\":\"block\"}"
617+
"{\"model\":\"$SPEC_DRAFT_MODEL\",\"num_speculative_tokens\":$SPEC_NUM_TOKENS,\"method\":\"dspark\",\"attention_backend\":\"$SPEC_ATTN_BACKEND\",\"draft_sample_method\":\"probabilistic\",$SPEC_REJECTION_CONFIG}"
593618
)
594619
fi
595620

@@ -694,6 +719,7 @@ VLLM_CMD=(
694719
"${MAX_MODEL_LEN_ARGS[@]}"
695720
"${PREFIX_CACHE_ARGS[@]}"
696721
"${KV_CACHE_DTYPE_ARGS[@]}"
722+
"${EAGER_ARGS[@]}"
697723
"${SPEC_ARGS[@]}"
698724
"${EVAL_SERVE_ARGS[@]}"
699725
"${OFFLOAD_ARGS[@]}"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# DSpark variant of kimik3_fp4_mi355x.sh. The MI355X launcher routes
5+
# spec-decoding=mtp rows to this suffix, while the shared base recipe owns the
6+
# model, KV-offload, AgentX replay, and eval plumbing.
7+
#
8+
# These overrides are the DSpark + SimpleCPUOffloadConnector combination
9+
# validated on gfx950 in PR #2367. Keep them together: widening the batch or
10+
# re-enabling CUDA graphs reproduced an eight-rank GPU memory access fault.
11+
export SPEC_DECODE=true
12+
export KV_CACHE_DTYPE="${KV_CACHE_DTYPE:-auto}"
13+
export MAX_NUM_SEQS="${MAX_NUM_SEQS:-32}"
14+
export EVAL_MAX_NUM_SEQS="${EVAL_MAX_NUM_SEQS:-32}"
15+
export MAX_NUM_BATCHED_TOKENS="${MAX_NUM_BATCHED_TOKENS:-1024}"
16+
export LANGUAGE_MODEL_ONLY="${LANGUAGE_MODEL_ONLY:-true}"
17+
export SIMPLE_LAZY_OFFLOAD="${SIMPLE_LAZY_OFFLOAD:-true}"
18+
export ENFORCE_EAGER="${ENFORCE_EAGER:-true}"
19+
20+
exec "$(dirname "$0")/kimik3_fp4_mi355x.sh" "$@"

configs/amd-master.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,25 @@ kimik3-fp4-mi355x-vllm-agentic:
652652
# far the 2234 GiB host tier extends the concurrency ceiling.
653653
- { tp: 8, kv-offloading: dram, kv-offload-backend: { name: vllm-simple }, conc-list: [4, 8, 16, 32] }
654654

655+
kimik3-fp4-mi355x-vllm-agentic-mtp:
656+
image: vllm/vllm-openai-rocm:kimi-k3
657+
model: moonshotai/Kimi-K3
658+
model-prefix: kimik3
659+
runner: cluster:mi355x-amds
660+
precision: fp4
661+
framework: vllm
662+
multinode: false
663+
scenarios:
664+
agentic-coding:
665+
- dram-utilization: 0.80
666+
search-space:
667+
# DSpark speculative decoding with Inferact/Kimi-K3-DSpark, seven draft
668+
# tokens, probabilistic draft sampling, and the committed thinking-on
669+
# golden AL. The _mtp wrapper applies the gfx950 settings validated in
670+
# PR #2367 as one unit: eager execution, max-num-batched-tokens 1024,
671+
# max-num-seqs 32, bf16 KV, and lazy SimpleCPUOffloadConnector allocation.
672+
- { tp: 8, kv-offloading: dram, kv-offload-backend: { name: vllm-simple }, spec-decoding: mtp, conc-list: [1, 2, 4, 8] }
673+
655674
kimik3-fp4-mi355x-vllm-agentic-fp8kvtest:
656675
image: vllm/vllm-openai-rocm:kimi-k3
657676
model: moonshotai/Kimi-K3

perf-changelog.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5273,3 +5273,11 @@
52735273
- "Add 8 checked-in srt-slurm recipes with EAGLE speculative decoding and chat-template inputs"
52745274
- "Image: lmsysorg/sglang:nightly-dev-cu13-20260721-8905cbd4"
52755275
pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/2363
5276+
5277+
- config-keys:
5278+
- kimik3-fp4-mi355x-vllm-agentic-mtp
5279+
description:
5280+
- "Add the Kimi-K3 MXFP4 MI355X AgentX DSpark variant with Inferact/Kimi-K3-DSpark, seven draft tokens, probabilistic draft sampling, and TRITON_MLA on ROCm."
5281+
- "Pin throughput to the committed thinking-on golden acceptance length 3.84 with synthetic rejection sampling; eval-only runs retain real block verification."
5282+
- "Run TP8 with SimpleCPUOffloadConnector at concurrency 1/2/4/8. The _mtp wrapper keeps the gfx950 bring-up settings validated in PR #2367 together: --enforce-eager, --max-num-batched-tokens 1024, --max-num-seqs 32, bf16 KV cache, language-model-only mode, and lazy host allocation."
5283+
pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/2403

utils/changelog_gate_tests/test_run_sweep_gating.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,23 @@ def test_e2e_workflow_cannot_dispatch_database_ingest() -> None:
409409
assert "INFX_FRONTEND_PAT" not in workflow
410410

411411

412+
def test_e2e_agentic_eval_preserves_matrix_transport_settings() -> None:
413+
workflow = yaml.load(
414+
(REPO_ROOT / ".github/workflows/e2e-tests.yml").read_text(),
415+
Loader=yaml.BaseLoader,
416+
)
417+
inputs = workflow["jobs"]["test-sweep-agentic-evals"]["with"]
418+
419+
assert inputs["kv-offload-backend"] == (
420+
"${{ matrix.config['kv-offload-backend'].name }}"
421+
)
422+
assert inputs["kv-offload-backend-metadata"] == (
423+
"${{ matrix.config['kv-offload-backend']"
424+
" && toJson(matrix.config['kv-offload-backend']) || '' }}"
425+
)
426+
assert inputs["spec-decoding"] == "${{ matrix.config.spec-decoding }}"
427+
428+
412429
def test_priority_classifier_runs_for_enabled_actions() -> None:
413430
scenario = {
414431
**_PR,

0 commit comments

Comments
 (0)