Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
@@ -1,30 +1,57 @@
#!/usr/bin/env bash

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the point of this script? can this functionally be auto detected in mooncake or vllm instead?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Oren

I Don't think it's a suitable feature for vLLM, it's mostly a good UX script to identify devices on the fly vs specifying for the cluster of choice (which we already do in some of Bryans scripts). Usually the infrastructure people know best about them, than vLLM (which would be hard to consider all possible cases)

# Install the worker's Mooncake client and point its store at one active RDMA rail.
set -eo pipefail
bash "$(dirname "${BASH_SOURCE[0]}")/vllm-mooncake.sh"

# Rail-isolated nodes: two RNICs cannot reach each other even within a node, so
# every rank uses one rail. mlx5_0 is down on some nodes, and topology discovery
# then finds no HCA, so take the first active rail at runtime. DSXE nodes name
# their rails rdmap*.
rail=""
for device in mlx5_0 mlx5_1 mlx5_2 mlx5_3 mlx5_4 mlx5_5 mlx5_8 mlx5_9 \
mlx5_10 mlx5_11 mlx5_16 mlx5_17 mlx5_20 mlx5_21 mlx5_22 mlx5_23 \
$(ls /sys/class/infiniband 2>/dev/null | grep '^rdmap' | sort -V); do
if grep -q ACTIVE "/sys/class/infiniband/$device/ports/1/state" 2>/dev/null; then
rail="$device"
break
fi
done
if [[ -z "$rail" ]]; then
echo "Error: no active RDMA rail on $(hostname); Mooncake cannot initialise" >&2
for state in /sys/class/infiniband/*/ports/*/state; do
echo "$state: $(cat "$state" 2>&1)" >&2
# every rank uses one rail, the first ACTIVE InfiniBand port that mlx5_core drives.
# DSXE names its ConnectX-7 ports ibp*, and its EFA rdmap* devices have no RC queue
# pairs for Mooncake's rdma transport (segment registration fails with ENOMEM).
select_mooncake_rdma_device() {
local device
MOONCAKE_RAIL=""
for device in "$1"/*; do
[[ "$(readlink "$device/device/driver" 2>/dev/null)" == */mlx5_core ]] || continue
[[ "$(cat "$device/ports/1/state" 2>/dev/null)" == "4: ACTIVE" ]] || continue
[[ "$(cat "$device/ports/1/link_layer" 2>/dev/null)" == InfiniBand ]] || continue
MOONCAKE_RAIL="${device##*/}"
return 0
done
echo "Error: no ACTIVE InfiniBand mlx5_core port under $1; Mooncake cannot initialise" >&2
for device in "$1"/*; do
echo " ${device##*/}: driver=$(readlink "$device/device/driver" 2>&1)" \
"state=$(cat "$device/ports/1/state" 2>&1)" \
"link_layer=$(cat "$device/ports/1/link_layer" 2>&1)" >&2
done
return 1
}

# libibverbs loads "$RDMAV_DRIVERS-rdmav<ABI>.so". rdma-core installs that file as a
# relative link to ../libmlx5.so.1.*, so it resolves only when the provider's parent
# directory is mounted too; -f follows the link.
check_mooncake_verbs_provider() {
local providers=("$RDMAV_DRIVERS"-rdmav*.so)
if [[ ! -f "${providers[0]}" ]]; then
echo "Error: no verbs provider resolves for $RDMAV_DRIVERS-rdmav*.so" \
"(${providers[0]} -> $(readlink "${providers[0]}"))" >&2
return 1
fi
MOONCAKE_VERBS_PROVIDER="${providers[0]} -> $(readlink -f "${providers[0]}")"
}

# Sourcing only defines the functions.
[[ "${BASH_SOURCE[0]}" == "$0" ]] || return 0

source /infmax-workspace/benchmarks/check_env.sh
check_env_vars KV_OFFLOAD_BACKEND_VERSION MOONCAKE_CONFIG_PATH MC_GID_INDEX RDMAV_DRIVERS
# An InfiniBand port addresses peers by GID index 0.
if [[ "$MC_GID_INDEX" != 0 ]]; then
echo "Error: MC_GID_INDEX=$MC_GID_INDEX; the InfiniBand Mooncake rail needs GID index 0" >&2
exit 1
fi
config="${MOONCAKE_CONFIG_PATH:-/logs/mooncake_store_config.json}"
python3 - "$config" "$rail" <<'PY'
check_mooncake_verbs_provider
select_mooncake_rdma_device /sys/class/infiniband
bash "$(dirname "${BASH_SOURCE[0]}")/vllm-mooncake.sh"

python3 - "$MOONCAKE_CONFIG_PATH" "$MOONCAKE_RAIL" <<'PY'
import json, sys
path, rail = sys.argv[1:]
with open(path) as handle:
Expand All @@ -33,4 +60,6 @@ config["device_name"] = rail
with open(path, "w") as handle:
json.dump(config, handle, indent=2)
PY
echo "Mooncake rail: $rail"
echo "Mooncake rail: $MOONCAKE_RAIL (InfiniBand, MC_GID_INDEX=$MC_GID_INDEX);" \
"host verbs provider $MOONCAKE_VERBS_PROVIDER; image mlx5 provider" \
/usr/lib/x86_64-linux-gnu/libibverbs/libmlx5-rdmav*.so
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,31 @@ base:
health_check:
interval_seconds: 10
max_attempts: 360
# Embedded Mooncake: each TP rank contributes TOTAL_CPU_DRAM_GB / 8 GB. The
# setup script installs the master config's Mooncake and fills in the node's
# active RDMA rail. DSXE rails are InfiniBand without a netdev, so the transfer
# engine picks its own GID (a RoCE v2 index 3 does not exist).
# Embedded Mooncake ("GB" is GiB): 8 TP ranks x (256 GiB segment + 4 GiB buffer)
# = 2233.4 GB stay within TOTAL_CPU_DRAM_GB (2249 GB).
# The setup script installs the master config's Mooncake and writes the node's
# first ACTIVE InfiniBand port that mlx5_core drives (ibp* on DSXE, never EFA)
# into the store config, failing the worker when there is none.
setup_script: kimik3-b300-mooncake.sh
# The whole host library directory, for RDMAV_DRIVERS: the host's
# libibverbs/libmlx5-rdmav<ABI>.so is a relative link to ../libmlx5.so.1.*.
extra_mount:
- /usr/lib/x86_64-linux-gnu:/host-usr-lib:ro
services:
- name: mooncake-master
type: mooncake-master
# The first container import on a node plus the in-container install outlast
# the default 120 s readiness window.
readiness:
port: 8700
timeout_seconds: 900
preamble: bash /configs/vllm-mooncake.sh
args: ["--eviction_high_watermark_ratio=0.95", "--eviction_ratio=0.10"]
options:
store_config:
mode: embedded
metadata_server: P2PHANDSHAKE
global_segment_size: 281GB
global_segment_size: 256GB
local_buffer_size: 4GB
protocol: rdma
device_name: ""
Expand All @@ -55,11 +65,14 @@ base:
reasoning-parser: kimi_k3
load-format: fastsafetensors
moe-backend: auto
no-enable-flashinfer-autotune: true
enable-flashinfer-autotune: true
enable-cumem-allocator: true
enable-prefix-caching: true
prefix-match-unit: 128
kv-cache-dtype: fp8
# KDA recurrent state only (the DSpark draft is dense MLA). Leave the conv state at
# SD: FlashInfer's packed KDA spec decode rejects VLLM_SSM_CONV_STATE_LAYOUT=DS on SM10x.
mamba-ssm-cache-dtype: bfloat16
Comment on lines +73 to +75

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesnt this hurt long context evals signficiantly?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's been used in all submissions across the board ...

stream-interval: 10
attention-backend: TOKENSPEED_MLA
attention-config: '{"mla_prefill_backend":"TRTLLM_RAGGED","use_prefill_query_quantization":true}'
Expand All @@ -74,6 +87,8 @@ base:
VLLM_USE_DIRECT_DCP_Q_GATHER: '1'
VLLM_USE_DIRECT_DCP_KV_GATHER: '1'
VLLM_RPC_TIMEOUT: '600000'
# Mooncake loads can block inside execute_model past the 300 s default.
VLLM_EXECUTE_MODEL_TIMEOUT_SECONDS: '1800'
VLLM_PREFIX_CACHE_RETENTION_INTERVAL: '0'
VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS: '0'
PYTHONNOUSERSITE: '1'
Expand All @@ -86,6 +101,10 @@ base:
MC_ENABLE_DEST_DEVICE_AFFINITY: '1'
MC_SLICE_SIZE: '1048576'
MC_WORKERS_PER_CTX: '4'
# The setup script selects only InfiniBand rails, which use GID index 0.
MC_GID_INDEX: '0'
# libibverbs appends -rdmav<ABI>.so and loads it before the image's providers.
RDMAV_DRIVERS: /host-usr-lib/libibverbs/libmlx5
WITH_NVIDIA_PEERMEM: '0'
VLLM_MOONCAKE_LOAD_RECV_THREADS: '4'
benchmark:
Expand All @@ -95,11 +114,10 @@ base:
KV_OFFLOADING: dram
TOTAL_CPU_DRAM_GB: '2249'

# One variant per point. Admission is 2x CONC; CONC 56 and 70 keep more memory
# headroom. Graphs capture (1 + drafts) x 1..min(2x CONC, 128) tokens, then the
# larger powers of two to 8192. Throughput runs switch DSpark to synthetic
# rejection at the golden acceptance length; points above CONC 16 do not draft
# and keep the matrix's mtp label.
# One variant per point. Admission is 2x CONC. Graphs capture (1 + drafts) x
# 1..2x CONC tokens (to 96 at CONC 4, to 252 at CONC 28), then the larger powers
# of two to 8192. Throughput runs switch DSpark to synthetic rejection at the
# golden acceptance length.
override_c1:
roles:
agg:
Expand All @@ -112,26 +130,14 @@ override_c1:
env:
CONC: '1'

override_c2:
roles:
agg:
args:
max-num-seqs: 4
gpu-memory-utilization: 0.92
compilation-config: '{"cudagraph_mode":"FULL_AND_PIECEWISE","cudagraph_capture_sizes":[8,16,24,32,64,128,256,512,1024,2048,4096,8192]}'
speculative-config: '{"method":"dspark","model":"Inferact/Kimi-K3-DSpark","num_speculative_tokens":7,"attention_backend":"TOKENSPEED_MLA","draft_sample_method":"probabilistic","rejection_sample_method":"block"}'
benchmark:
env:
CONC: '2'

override_c4:
roles:
agg:
args:
max-num-seqs: 8
gpu-memory-utilization: 0.92
compilation-config: '{"cudagraph_mode":"FULL_AND_PIECEWISE","cudagraph_capture_sizes":[8,16,24,32,40,48,56,64,128,256,512,1024,2048,4096,8192]}'
speculative-config: '{"method":"dspark","model":"Inferact/Kimi-K3-DSpark","num_speculative_tokens":7,"attention_backend":"TOKENSPEED_MLA","draft_sample_method":"probabilistic","rejection_sample_method":"block"}'
compilation-config: '{"cudagraph_mode":"FULL_AND_PIECEWISE","cudagraph_capture_sizes":[6,12,18,24,30,36,42,48,54,60,66,72,78,84,90,96,128,256,512,1024,2048,4096,8192]}'
speculative-config: '{"method":"dspark","model":"Inferact/Kimi-K3-DSpark","num_speculative_tokens":5,"attention_backend":"TOKENSPEED_MLA","draft_sample_method":"probabilistic","rejection_sample_method":"block"}'
benchmark:
env:
CONC: '4'
Expand All @@ -142,92 +148,61 @@ override_c8:
args:
max-num-seqs: 16
gpu-memory-utilization: 0.92
compilation-config: '{"cudagraph_mode":"FULL_AND_PIECEWISE","cudagraph_capture_sizes":[8,16,24,32,40,48,56,64,72,80,88,96,104,112,120,128,256,512,1024,2048,4096,8192]}'
speculative-config: '{"method":"dspark","model":"Inferact/Kimi-K3-DSpark","num_speculative_tokens":7,"attention_backend":"TOKENSPEED_MLA","draft_sample_method":"probabilistic","rejection_sample_method":"block"}'
compilation-config: '{"cudagraph_mode":"FULL_AND_PIECEWISE","cudagraph_capture_sizes":[6,12,18,24,30,36,42,48,54,60,66,72,78,84,90,96,128,256,512,1024,2048,4096,8192]}'
speculative-config: '{"method":"dspark","model":"Inferact/Kimi-K3-DSpark","num_speculative_tokens":5,"attention_backend":"TOKENSPEED_MLA","draft_sample_method":"probabilistic","rejection_sample_method":"block"}'
benchmark:
env:
CONC: '8'

override_c16:
override_c14:
roles:
agg:
args:
max-num-seqs: 32
max-num-seqs: 28
gpu-memory-utilization: 0.92
compilation-config: '{"cudagraph_mode":"FULL_AND_PIECEWISE","cudagraph_capture_sizes":[4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,256,512,1024,2048,4096,8192]}'
compilation-config: '{"cudagraph_mode":"FULL_AND_PIECEWISE","cudagraph_capture_sizes":[4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,128,256,512,1024,2048,4096,8192]}'
speculative-config: '{"method":"dspark","model":"Inferact/Kimi-K3-DSpark","num_speculative_tokens":3,"attention_backend":"TOKENSPEED_MLA","draft_sample_method":"probabilistic","rejection_sample_method":"block"}'
benchmark:
env:
CONC: '16'
CONC: '14'

override_c24:
override_c28:
roles:
agg:
args:
max-num-seqs: 48
max-num-seqs: 56
gpu-memory-utilization: 0.92
compilation-config: '{"cudagraph_mode":"FULL_AND_PIECEWISE","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,64,128,256,512,1024,2048,4096,8192]}'
benchmark:
env:
CONC: '24'
SPEC_DECODING: mtp

override_c32:
roles:
agg:
args:
max-num-seqs: 64
gpu-memory-utilization: 0.92
compilation-config: '{"cudagraph_mode":"FULL_AND_PIECEWISE","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,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,128,256,512,1024,2048,4096,8192]}'
compilation-config: '{"cudagraph_mode":"FULL_AND_PIECEWISE","cudagraph_capture_sizes":[4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,256,512,1024,2048,4096,8192]}'
speculative-config: '{"method":"dspark","model":"Inferact/Kimi-K3-DSpark","num_speculative_tokens":3,"attention_backend":"TOKENSPEED_MLA","draft_sample_method":"probabilistic","rejection_sample_method":"block"}'
benchmark:
env:
CONC: '32'
SPEC_DECODING: mtp
CONC: '28'

override_c40:
services:
- name: mooncake-master
type: mooncake-master
readiness:
port: 8700
timeout_seconds: 900
preamble: bash /configs/vllm-mooncake.sh
args: ["--eviction_high_watermark_ratio=0.95", "--eviction_ratio=0.10", "--default_kv_lease_ttl=60000"]
options:
store_config:
mode: embedded
metadata_server: P2PHANDSHAKE
global_segment_size: 256GB
local_buffer_size: 4GB
protocol: rdma
device_name: ""
enable_offload: false
roles:
agg:
args:
max-num-seqs: 80
gpu-memory-utilization: 0.92
compilation-config: '{"cudagraph_mode":"FULL_AND_PIECEWISE","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,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,128,256,512,1024,2048,4096,8192]}'
compilation-config: '{"cudagraph_mode":"FULL_AND_PIECEWISE","cudagraph_capture_sizes":[4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,256,260,264,268,272,276,280,284,288,292,296,300,304,308,312,316,320,512,1024,2048,4096,8192]}'
speculative-config: '{"method":"dspark","model":"Inferact/Kimi-K3-DSpark","num_speculative_tokens":3,"attention_backend":"TOKENSPEED_MLA","draft_sample_method":"probabilistic","rejection_sample_method":"block"}'
benchmark:
env:
CONC: '40'
SPEC_DECODING: mtp

override_c48:
roles:
agg:
args:
max-num-seqs: 96
gpu-memory-utilization: 0.92
compilation-config: '{"cudagraph_mode":"FULL_AND_PIECEWISE","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,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,128,256,512,1024,2048,4096,8192]}'
benchmark:
env:
CONC: '48'
SPEC_DECODING: mtp

override_c56:
roles:
agg:
args:
max-num-seqs: 112
gpu-memory-utilization: 0.9
compilation-config: '{"cudagraph_mode":"FULL_AND_PIECEWISE","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,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,128,256,512,1024,2048,4096,8192]}'
benchmark:
env:
CONC: '56'
SPEC_DECODING: mtp

override_c70:
roles:
agg:
args:
max-num-seqs: 140
gpu-memory-utilization: 0.9
compilation-config: '{"cudagraph_mode":"FULL_AND_PIECEWISE","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,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,256,512,1024,2048,4096,8192]}'
benchmark:
env:
CONC: '70'
SPEC_DECODING: mtp
23 changes: 12 additions & 11 deletions inferencex-e2e/configs/nvidia-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1492,14 +1492,15 @@ dsr1-fp8-b300-sglang-mtp:

kimik3-fp4-b300-vllm-agentic-dspark:
# TP8 x DCP8 with Mooncake as the external KV tier. The recipe drafts with
# DSpark level 7 at conc <= 8 and stops above it; synthetic acceptance is
# pinned to the committed golden AL 3.84 (infx/golden_al_distribution/
# DSpark level 7 at conc 1, level 5 at conc 4-8 and level 3 at conc 14-40;
# synthetic acceptance is pinned to the committed golden
# AL for each level (3.84, 3.62, 3.00; infx/golden_al_distribution/
# kimik3_dspark_probabilistic_sample_method_block_rejection_sample_method.yaml),
# and EVAL_ONLY switches to real block verification.
#
# Kimi-K3 runtime from vllm-project/vllm @ 3696c772aae308f2420a8f307b0971e6986c4818.
# This replaces the unavailable 5894fdf build; new results use a new runtime baseline.
image: vllm/vllm-openai:nightly-dev-x86_64-cu13-3696c77
# vllm/vllm-openai:nightly-49cb2bbf71cfd36ee5aa33d1e184b1cddff55294 (vllm-project/vllm
# @ 49cb2bbf), pinned to its linux/amd64 manifest digest.
image: vllm/vllm-openai@sha256:8c1434bfee7d7626eef78ef70600434ffba4a1b8813cb1d1c8707ad25f47035e
model: moonshotai/Kimi-K3
model-prefix: kimik3
runner: cluster:b300-dsxe
Expand All @@ -1510,15 +1511,15 @@ kimik3-fp4-b300-vllm-agentic-dspark:
scenarios:
# Agentic-coding only: no fixed-seq-len (1k1k / 8k1k) arms for this recipe.
agentic-coding:
# Sizes the Mooncake segment: this resolves to total-cpu-dram-gb, which
# the recipe divides across the 8 TP ranks.
# Resolves to TOTAL_CPU_DRAM_GB, which caps the recipe's 8 Mooncake
# segments and buffers.
- dram-utilization: 0.75
search-space:
# TP8-only: a ~1.5 TB MXFP4 checkpoint does not fit below 8 GPUs.
# One entry for every arm: the recipe drafts at DSpark 7 up to conc 8,
# DSpark 3 at conc 16, and not at all above. Keep the concurrencies
# disjoint across arms so exp-names stay unique.
- { tp: 8, ep: 1, dcp-size: 8, spec-decoding: mtp, kv-offloading: dram, kv-offload-backend: { name: mooncake, version: "0.3.11.post1" }, conc-list: [1, 2, 4, 8, 16, 24, 32, 40, 48, 56, 70], srt-recipe: agentic.yaml }
# One entry for every arm: DSpark 7 at conc 1, DSpark 5 at conc 4-8 and
# DSpark 3 at conc 14-40.
# Keep the concurrencies disjoint across arms so exp-names stay unique.
- { tp: 8, ep: 1, dcp-size: 8, spec-decoding: mtp, kv-offloading: dram, kv-offload-backend: { name: mooncake, version: "0.3.11.post1" }, conc-list: [1, 4, 8, 14, 28, 40], srt-recipe: agentic.yaml }

dsr1-fp8-b200-trt:
image: nvcr.io#nvidia/tensorrt-llm/release:1.3.0rc14
Expand Down
Loading
Loading