From f3dc0f8b90da39bffd630ededa0c81c0837b4bbd Mon Sep 17 00:00:00 2001 From: hshrivastava-droid Date: Thu, 13 Aug 2026 11:15:08 -0700 Subject: [PATCH 1/6] feat(config): add H200 MTP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加 H200 MTP 配置。 --- .../agentic/qwen3.5_fp8_h200_sglang_mtp.sh | 160 ++++++++++++++++++ configs/nvidia-master.yaml | 16 ++ perf-changelog.yaml | 9 + 3 files changed, 185 insertions(+) create mode 100755 benchmarks/single_node/agentic/qwen3.5_fp8_h200_sglang_mtp.sh diff --git a/benchmarks/single_node/agentic/qwen3.5_fp8_h200_sglang_mtp.sh b/benchmarks/single_node/agentic/qwen3.5_fp8_h200_sglang_mtp.sh new file mode 100755 index 000000000..f0fee4946 --- /dev/null +++ b/benchmarks/single_node/agentic/qwen3.5_fp8_h200_sglang_mtp.sh @@ -0,0 +1,160 @@ +#!/usr/bin/env bash +set -euo pipefail +set -x + +# Agentic trace replay for Qwen3.5 FP8 on H200 with native NEXTN MTP and +# DRAM HiCache. Throughput pins the committed golden acceptance length; evals +# retain target-model verification. + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +source "$SCRIPT_DIR/../../benchmark_lib.sh" + +check_env_vars \ + MODEL MODEL_PREFIX TP CONC KV_OFFLOADING TOTAL_CPU_DRAM_GB RESULT_DIR \ + DURATION EP_SIZE EVAL_ONLY SPEC_DECODING + +if ! require_agentic_kv_offload_backend hicache; then + echo "Error: this H200 MTP recipe requires KV_OFFLOADING=dram with HiCache" >&2 + exit 1 +fi + +if [ "$TP" -ne 8 ] || [ "$EP_SIZE" -ne 1 ]; then + echo "Error: this H200 MTP recipe requires TP=8 and EP_SIZE=1" >&2 + exit 1 +fi + +if [ "$SPEC_DECODING" != "mtp" ]; then + echo "Error: this launcher requires SPEC_DECODING=mtp" >&2 + exit 1 +fi + +if [ "$TOTAL_CPU_DRAM_GB" -lt 1200 ]; then + echo "Error: TP8 requires at least 1200 GB host DRAM; generated budget is ${TOTAL_CPU_DRAM_GB} GB" >&2 + exit 1 +fi + +if [[ -n "${SLURM_JOB_ID:-}" ]]; then + echo "JOB $SLURM_JOB_ID running on ${SLURMD_NODENAME:-unknown}" +fi + +if [[ -n "${MODEL_PATH:-}" ]]; then + if [[ ! -d "$MODEL_PATH" || -z "$(ls -A "$MODEL_PATH" 2>/dev/null)" ]]; then + hf download "$MODEL" --local-dir "$MODEL_PATH" + fi +else + hf download "$MODEL" + export MODEL_PATH="$MODEL" +fi +nvidia-smi + +export WEKA_LOADER_OVERRIDE=semianalysis_cc_traces_weka_with_subagents_256k +resolve_trace_source +install_agentic_deps + +# Pin the published FlashInfer 0.6.15 CUDA 13 wheels used by this launcher. +agentic_pip_install --no-deps --force-reinstall flashinfer_python==0.6.15 +agentic_pip_install \ + --no-deps --force-reinstall flashinfer-cubin==0.6.15 \ + --index-url https://flashinfer.ai/whl +agentic_pip_install \ + --no-deps --force-reinstall flashinfer-jit-cache==0.6.15+cu130 \ + --index-url https://flashinfer.ai/whl/cu130 + +SERVER_LOG="$RESULT_DIR/server.log" +mkdir -p "$RESULT_DIR" + +export TORCH_CUDA_ARCH_LIST=9.0 +export PYTHONNOUSERSITE=1 +export PYTHONUNBUFFERED=1 +export FLASHINFER_DISABLE_VERSION_CHECK=1 +export FLASHINFER_WORKSPACE_BASE=/tmp/flashinfer-cache +export SGL_ENABLE_JIT_DEEPGEMM=false +export SGLANG_ENABLE_FLASHINFER_GEMM=true +export SGLANG_ENABLE_SPEC_V2=1 + +# Three speculative tokens per verification step. For agentic throughput, pin +# the committed Qwen3.5 MTP golden AL (thinking_on, K=3); evals use real +# verification because simulated acceptance does not produce accuracy data. +if [ "$EVAL_ONLY" != "true" ]; then + export SGLANG_SIMULATE_ACC_LEN=3.39 + export SGLANG_SIMULATE_ACC_METHOD=match-expected + export SGLANG_SIMULATE_ACC_TOKEN_MODE=real-draft-token +fi + +SGLANG_CMD=( + python3 -m sglang.launch_server + --model-path "$MODEL_PATH" + --served-model-name "$MODEL" + --host 0.0.0.0 + --port "$PORT" + --trust-remote-code + --tensor-parallel-size "$TP" + --data-parallel-size 1 + --expert-parallel-size "$EP_SIZE" + --quantization fp8 + --kv-cache-dtype fp8_e4m3 + --mamba-ssm-dtype bfloat16 + --mamba-scheduler-strategy extra_buffer + --mamba-track-interval 8192 + --mamba-max-states-per-path 1 + --attention-backend flashinfer + --cuda-graph-max-bs 32 + --max-running-requests 128 + --max-prefill-tokens 16384 + --chunked-prefill-size 16384 + --mem-fraction-static 0.78 + --max-mamba-cache-size 360 + --allow-auto-truncate + --stream-interval 50 + --scheduler-recv-interval 10 + --tokenizer-worker-num 6 + --enable-cache-report + --enable-symm-mem + --enable-metrics + --page-size 64 + --enable-hierarchical-cache + --hicache-ratio 0.9 + --hicache-io-backend kernel + --hicache-mem-layout page_first_direct + --hicache-write-policy write_back + --speculative-algorithm NEXTN + --speculative-num-steps 3 + --speculative-eagle-topk 1 + --speculative-num-draft-tokens 4 +) + +printf '%q ' "${SGLANG_CMD[@]}" | tee "$RESULT_DIR/sglang_command.txt" +printf '\n' | tee -a "$RESULT_DIR/sglang_command.txt" + +SERVER_PID="" +cleanup_agentic_services() { + local exit_code=$? + trap - EXIT INT TERM + set +e + stop_background_process_tree "$SERVER_PID" "SGLang server" 60 + exit "$exit_code" +} +trap cleanup_agentic_services EXIT +trap 'exit 130' INT +trap 'exit 143' TERM + +{ + echo "=== SGLANG_* env vars at launch ===" + env | grep -E '^SGLANG_' | sort + echo "===================================" +} > "$SERVER_LOG" + +"${SGLANG_CMD[@]}" >> "$SERVER_LOG" 2>&1 & +SERVER_PID=$! +echo "Server PID: $SERVER_PID" + +wait_for_server_ready --port "$PORT" --server-log "$SERVER_LOG" --server-pid "$SERVER_PID" + +if [ "$EVAL_ONLY" = "true" ]; then + run_eval --port "$PORT" +else + build_replay_cmd "$RESULT_DIR" + REPLAY_CMD+=" --apply-chat-template" + REPLAY_CMD+=" --server-metrics http://localhost:$PORT/metrics" + run_agentic_replay_and_write_outputs "$RESULT_DIR" +fi diff --git a/configs/nvidia-master.yaml b/configs/nvidia-master.yaml index b95f59618..6544e66c7 100644 --- a/configs/nvidia-master.yaml +++ b/configs/nvidia-master.yaml @@ -7151,6 +7151,22 @@ qwen3.5-fp8-h200-sglang-agentic-mtp: - { tp: 8, ep: 8, spec-decoding: mtp, kv-offloading: none, conc-list: [4, 8, 12, 16] } - { tp: 8, ep: 8, spec-decoding: mtp, kv-offloading: dram, kv-offload-backend: { name: hicache }, conc-list: [4, 8, 12, 16] } +# H200 AgentX MTP frontier with DRAM HiCache. This is intentionally an MTP-only +# submission; the model's non-speculative AgentX arm is not included. +qwen3.5-fp8-h200-sglang-agentic-hicache-mtp: + image: lmsysorg/sglang:nightly-dev-cu13-20260716-b0b2dfbd + model: Qwen/Qwen3.5-397B-A17B-FP8 + model-prefix: qwen3.5 + runner: cluster:h200-dgxc + precision: fp8 + framework: sglang + multinode: false + scenarios: + agentic-coding: + - dram-utilization: 0.80 + search-space: + - { tp: 8, ep: 1, spec-decoding: mtp, kv-offloading: dram, kv-offload-backend: { name: hicache }, conc-list: [2, 4, 8, 10, 12, 16, 20, 24] } + qwen3.5-fp8-h100-sglang-agentic-mtp: image: lmsysorg/sglang:v0.5.16-cu130 diff --git a/perf-changelog.yaml b/perf-changelog.yaml index 6082f2b86..656994384 100644 --- a/perf-changelog.yaml +++ b/perf-changelog.yaml @@ -5918,3 +5918,12 @@ - "Add a TEP2 arm (tp 2, ep 2) to the qwen3.5-fp4-b200-sglang-mtp 8k/1k sweep at concurrency 16, 32, and 64" - "Rides on the NVFP4-V2 checkpoint switch from #2205" pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/2550 + +- config-keys: + - qwen3.5-fp8-h200-sglang-agentic-hicache-mtp + scenario-type: + - agentic-coding + description: + - "Add Qwen3.5 FP8 H200 SGLang AgentX MTP points with DRAM HiCache" + - "Use TP8/EP1 concurrency 2 through 24, published FlashInfer 0.6.15 CUDA 13 wheels, and golden MTP acceptance length 3.39" + pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/XXX From 9faefbbd5aa9d8f751cf2f9bd3159cbe04389425 Mon Sep 17 00:00:00 2001 From: hshrivastava-droid Date: Thu, 13 Aug 2026 11:15:42 -0700 Subject: [PATCH 2/6] chore(changelog): link PR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 补充性能变更日志中的 PR 链接。 --- perf-changelog.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perf-changelog.yaml b/perf-changelog.yaml index 656994384..12d2df312 100644 --- a/perf-changelog.yaml +++ b/perf-changelog.yaml @@ -5596,7 +5596,7 @@ - "Image ghcr.io/tile-ai/tilert:0.1.5 (tilert 0.1.5.post2 installed at container start); commands aligned to TileRT README Topology A -- NIXL KV transfer, --kv-cache-dtype fp8_ds_mla (prefill) <-> fp8 (decode), max-seq-len 202752; MTP speculative-config wired via spec-decoding=mtp" - "Topology: 1 prefill node (TP8) + 1 decode node (TP8), each 8xB200 exclusive; TileRT decode is bs=1 only so conc-list is a single point [1], ISL 1k/8k OSL 1k" - "Runner: launch_b200-dgxc.sh tilert early-return branch (zero impact on the dynamo path); tilert_utils/submit.sh issues two srun --ntasks=1, one per role, because prefill and decode need different container images; roles are dispatched by the TILERT_ROLE it exports, and torn down across nodes via a sentinel file on the shared /workspace" - pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/XXX + pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/2592 - config-keys: - qwen3.5-fp8-b200-sglang-agentic-mtp From e222ad48f9594c087f8333010aef153f0b8d33fe Mon Sep 17 00:00:00 2001 From: hshrivastava-droid Date: Thu, 13 Aug 2026 11:30:57 -0700 Subject: [PATCH 3/6] Revert "chore(changelog): link PR" This reverts commit 9faefbbd5aa9d8f751cf2f9bd3159cbe04389425. --- perf-changelog.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perf-changelog.yaml b/perf-changelog.yaml index 12d2df312..656994384 100644 --- a/perf-changelog.yaml +++ b/perf-changelog.yaml @@ -5596,7 +5596,7 @@ - "Image ghcr.io/tile-ai/tilert:0.1.5 (tilert 0.1.5.post2 installed at container start); commands aligned to TileRT README Topology A -- NIXL KV transfer, --kv-cache-dtype fp8_ds_mla (prefill) <-> fp8 (decode), max-seq-len 202752; MTP speculative-config wired via spec-decoding=mtp" - "Topology: 1 prefill node (TP8) + 1 decode node (TP8), each 8xB200 exclusive; TileRT decode is bs=1 only so conc-list is a single point [1], ISL 1k/8k OSL 1k" - "Runner: launch_b200-dgxc.sh tilert early-return branch (zero impact on the dynamo path); tilert_utils/submit.sh issues two srun --ntasks=1, one per role, because prefill and decode need different container images; roles are dispatched by the TILERT_ROLE it exports, and torn down across nodes via a sentinel file on the shared /workspace" - pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/2592 + pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/XXX - config-keys: - qwen3.5-fp8-b200-sglang-agentic-mtp From 15b43f211cb339c72e33b2242983d9635cfe026a Mon Sep 17 00:00:00 2001 From: hshrivastava-droid Date: Thu, 13 Aug 2026 14:20:42 -0700 Subject: [PATCH 4/6] fix(h200): update cache path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新 H200 缓存路径。 --- .../agentic/qwen3.5_fp8_h200_mtp.sh | 209 ++++++++---------- .../agentic/qwen3.5_fp8_h200_sglang_mtp.sh | 160 -------------- runners/launch_h200-dgxc-slurm.sh | 2 +- 3 files changed, 92 insertions(+), 279 deletions(-) delete mode 100755 benchmarks/single_node/agentic/qwen3.5_fp8_h200_sglang_mtp.sh diff --git a/benchmarks/single_node/agentic/qwen3.5_fp8_h200_mtp.sh b/benchmarks/single_node/agentic/qwen3.5_fp8_h200_mtp.sh index 62982a397..1ed9ef9ca 100755 --- a/benchmarks/single_node/agentic/qwen3.5_fp8_h200_mtp.sh +++ b/benchmarks/single_node/agentic/qwen3.5_fp8_h200_mtp.sh @@ -2,44 +2,34 @@ set -euo pipefail set -x -# Agentic trace replay benchmark for Qwen3.5 FP8 on H200 using SGLang with MTP -# speculative decoding. First Qwen3.5 AgentX recipe on H200; it is spec-decode -# only, per the AgentX policy that new agentic arms ship with speculative -# decoding enabled rather than as an STP/MTP A/B (MODELS.md). -# -# Structure follows the proven agentic/qwen3.5_fp8_h100.sh replay path -# (HiCache host-DRAM offload, the multi_tokenizer cached_tokens_details patch, -# aiperf-driven trace replay). H200's 141 GB HBM3e is roomier than H100's 80 GB, -# so --mem-fraction-static is 0.8 rather than 0.75, matching -# fixed_seq_len/qwen3.5_fp8_h200_mtp.sh. Attention backend stays flashinfer -# (sm_90); the trtllm_mha path is Blackwell-only. -# -# Speculative decoding mirrors fixed_seq_len/qwen3.5_fp8_h100_mtp.sh: -# SGLANG_ENABLE_SPEC_V2=1 with --speculative-algorithm EAGLE, 3 steps, eagle-topk -# 1 and 4 draft tokens, i.e. 3 speculative tokens per verification step. -# -# Throughput runs pin acceptance to the committed golden AL through SGLang's -# simulated-acceptance path; the EVAL_ONLY accuracy run leaves it off and keeps -# real verification. See the SGLANG_SIMULATE_ACC_* block. -# -# Required env vars: -# MODEL, TP, CONC, KV_OFFLOADING, TOTAL_CPU_DRAM_GB, RESULT_DIR -# -# KV_OFFLOADING=dram requires KV_OFFLOAD_BACKEND=hicache. - -source "$(dirname "$0")/../../benchmark_lib.sh" - -check_env_vars MODEL TP CONC KV_OFFLOADING TOTAL_CPU_DRAM_GB RESULT_DIR DURATION EP_SIZE - -SCHEDULER_RECV_INTERVAL=${SCHEDULER_RECV_INTERVAL:-10} +# Agentic trace replay benchmark for Qwen3.5 FP8 on H200 with SGLang MTP. + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +source "$SCRIPT_DIR/../../benchmark_lib.sh" + +check_env_vars \ + MODEL MODEL_PREFIX TP CONC KV_OFFLOADING TOTAL_CPU_DRAM_GB RESULT_DIR \ + DURATION EP_SIZE EVAL_ONLY SPEC_DECODING + +if ! require_agentic_kv_offload_backend hicache; then + echo "Error: the H200 MTP recipe requires KV_OFFLOADING=dram with HiCache" >&2 + exit 1 +fi + +if [ "$TP" -ne 8 ] || [ "$EP_SIZE" -ne 1 ] || [ "$SPEC_DECODING" != "mtp" ]; then + echo "Error: the H200 MTP recipe requires TP=8, EP_SIZE=1, and SPEC_DECODING=mtp" >&2 + exit 1 +fi + +if [ "$TOTAL_CPU_DRAM_GB" -lt 1200 ]; then + echo "Error: TP8 requires at least 1200 GB host DRAM; generated budget is ${TOTAL_CPU_DRAM_GB} GB" >&2 + exit 1 +fi if [[ -n "${SLURM_JOB_ID:-}" ]]; then echo "JOB $SLURM_JOB_ID running on ${SLURMD_NODENAME:-unknown}" fi -# `hf download` creates the target dir if missing and is itself idempotent. -# When MODEL_PATH is unset (stand-alone runs), fall back to the HF_HUB_CACHE -# Either way, MODEL_PATH is what the server is launched with. if [[ -n "${MODEL_PATH:-}" ]]; then if [[ ! -d "$MODEL_PATH" || -z "$(ls -A "$MODEL_PATH" 2>/dev/null)" ]]; then hf download "$MODEL" --local-dir "$MODEL_PATH" @@ -50,134 +40,117 @@ else fi nvidia-smi -# ---- Resolve traces and install deps ---------------------------------------- -# Keep the 256k-capped with-subagents corpus the H100 Qwen3.5 AgentX recipe -# uses (470 traces, max in+out <= 256k). The unfiltered corpus has requests up -# to ~1M proxy tokens that the server would reject; H200's extra HBM raises the -# context ceiling but not past 256k for this model at TP8. export WEKA_LOADER_OVERRIDE=semianalysis_cc_traces_weka_with_subagents_256k - resolve_trace_source install_agentic_deps -# ---- Server config ---------------------------------------------------------- +agentic_pip_install --no-deps --force-reinstall flashinfer_python==0.6.15 +agentic_pip_install \ + --no-deps --force-reinstall flashinfer-cubin==0.6.15 \ + --index-url https://flashinfer.ai/whl +agentic_pip_install \ + --no-deps --force-reinstall flashinfer-jit-cache==0.6.15+cu130 \ + --index-url https://flashinfer.ai/whl/cu130 + SERVER_LOG="$RESULT_DIR/server.log" mkdir -p "$RESULT_DIR" -CACHE_ARGS=() -if require_agentic_kv_offload_backend hicache; then - # HiCache extends RadixAttention, so do not pass --disable-radix-cache. - # Hybrid GDN/Mamba allocates one KV and one Mamba host pool per rank. - REQUESTED_HICACHE_TOTAL_GB="${HICACHE_TOTAL_CPU_DRAM_GB:-$TOTAL_CPU_DRAM_GB}" - if [ "$REQUESTED_HICACHE_TOTAL_GB" -gt "$TOTAL_CPU_DRAM_GB" ]; then - echo "Error: requested HiCache pool ${REQUESTED_HICACHE_TOTAL_GB} GB exceeds configured capacity ${TOTAL_CPU_DRAM_GB} GB" >&2 - exit 1 - fi - TOTAL_CPU_DRAM_GB="$REQUESTED_HICACHE_TOTAL_GB" - HICACHE_HOST_POOL_COUNT="${HICACHE_HOST_POOL_COUNT:-2}" - HICACHE_WRITE_POLICY="${HICACHE_WRITE_POLICY:-write_through_selective}" - MAX_HICACHE_SIZE_GB=$((TOTAL_CPU_DRAM_GB / TP / HICACHE_HOST_POOL_COUNT)) - HICACHE_SIZE_GB="${HICACHE_SIZE_GB:-$MAX_HICACHE_SIZE_GB}" - if [ "$HICACHE_SIZE_GB" -gt "$MAX_HICACHE_SIZE_GB" ]; then - echo "Error: HICACHE_SIZE_GB=$HICACHE_SIZE_GB exceeds configured per-pool limit $MAX_HICACHE_SIZE_GB" >&2 - exit 1 - fi - if [ "$HICACHE_SIZE_GB" -lt 1 ]; then - echo "Error: computed HICACHE_SIZE_GB=$HICACHE_SIZE_GB from TOTAL_CPU_DRAM_GB=$TOTAL_CPU_DRAM_GB, TP=$TP, HICACHE_HOST_POOL_COUNT=$HICACHE_HOST_POOL_COUNT" >&2 - exit 1 - fi - echo "HiCache CPU pool: ${HICACHE_SIZE_GB} GB per rank per host pool across TP=${TP}, host_pool_count=${HICACHE_HOST_POOL_COUNT}" - CACHE_ARGS=( - --page-size 64 - --enable-hierarchical-cache - --hicache-size "$HICACHE_SIZE_GB" - --hicache-io-backend kernel - --hicache-mem-layout page_first - --hicache-write-policy "$HICACHE_WRITE_POLICY" - ) -fi - -echo "Starting SGLang server..." +export TORCH_CUDA_ARCH_LIST=9.0 export PYTHONNOUSERSITE=1 +export PYTHONUNBUFFERED=1 +export FLASHINFER_DISABLE_VERSION_CHECK=1 +export FLASHINFER_WORKSPACE_BASE=/tmp/flashinfer-cache +export SGL_ENABLE_JIT_DEEPGEMM=false +export SGLANG_ENABLE_FLASHINFER_GEMM=true export SGLANG_ENABLE_SPEC_V2=1 -# 3 speculative tokens per step (num-steps 3, eagle-topk 1, 4 draft tokens), -# the same MTP shape as the fixed-seq-len Qwen3.5 recipes. SPEC_ARGS=( - --speculative-algorithm EAGLE + --speculative-algorithm NEXTN --speculative-num-steps 3 --speculative-eagle-topk 1 --speculative-num-draft-tokens 4 ) -# AgentX pins acceptance to the committed golden AL so submissions are compared -# on system performance at a fixed acceptance target rather than on draft-head -# quality (golden_al_distribution/README.md). 3.39 is the Qwen3.5 MTP curve at -# num_speculative_tokens=3, thinking_on (golden_al_distribution/qwen3.5_mtp.yaml) -# -- the same value the GB300 Qwen3.5 AgentX srt-slurm recipes pin. -# SGLANG_SIMULATE_ACC_TOKEN_MODE landed in SGLang v0.5.16, which is why this -# recipe pins that image rather than the non-MTP agentic sibling's v0.5.12. -# -# EVAL_ONLY leaves simulated acceptance off: it commits drafted tokens -# regardless of the target logits, so generated text is wrong and the eval would -# score ~0. -if [ "${EVAL_ONLY:-false}" != "true" ]; then +if [ "$EVAL_ONLY" != "true" ]; then export SGLANG_SIMULATE_ACC_LEN=3.39 export SGLANG_SIMULATE_ACC_METHOD=match-expected export SGLANG_SIMULATE_ACC_TOKEN_MODE=real-draft-token fi -SGLANG_MULTI_TOKENIZER=/sgl-workspace/sglang/python/sglang/srt/managers/multi_tokenizer_mixin.py -if ! sed -n '/elif isinstance(output, BatchStrOutput):/,/input_token_logprobs_val=_extract_field_by_index/p' "$SGLANG_MULTI_TOKENIZER" \ - | grep -q 'cached_tokens_details=_extract_field_by_index'; then - sed -i '/elif isinstance(output, BatchStrOutput):/,/input_token_logprobs_val=_extract_field_by_index/ { - /cached_tokens=_extract_field_by_index(output, "cached_tokens", i),/a\ - cached_tokens_details=_extract_field_by_index(\ - output, "cached_tokens_details", i\ - ), - }' "$SGLANG_MULTI_TOKENIZER" -fi +CACHE_ARGS=( + --page-size 64 + --enable-hierarchical-cache + --hicache-ratio 0.9 + --hicache-io-backend kernel + --hicache-mem-layout page_first_direct + --hicache-write-policy write_back +) -{ set +x; } 2>/dev/null SGLANG_CMD=( python3 -m sglang.launch_server - --model-path="$MODEL_PATH" --served-model-name="$MODEL" - --host=0.0.0.0 - --port="$PORT" - --served-model-name "Qwen/Qwen3.5-397B-A17B-FP8" + --model-path "$MODEL_PATH" + --served-model-name "$MODEL" + --host 0.0.0.0 + --port "$PORT" --trust-remote-code - --tensor-parallel-size="$TP" - --data-parallel-size=1 - --expert-parallel-size="$EP_SIZE" + --tensor-parallel-size "$TP" + --data-parallel-size 1 + --expert-parallel-size "$EP_SIZE" --quantization fp8 --kv-cache-dtype fp8_e4m3 --mamba-ssm-dtype bfloat16 + --mamba-scheduler-strategy extra_buffer + --mamba-track-interval 8192 --attention-backend flashinfer - --enable-flashinfer-allreduce-fusion - # --cuda-graph-max-bs "$CONC" - # --max-running-requests "$CONC" - # --max-prefill-tokens 8192 - # --chunked-prefill-size 8192 - --mem-fraction-static 0.8 + --cuda-graph-max-bs 32 + --max-running-requests 128 + --max-prefill-tokens 16384 + --chunked-prefill-size 16384 + --mem-fraction-static 0.78 + --max-mamba-cache-size 360 + --allow-auto-truncate --stream-interval 50 - --scheduler-recv-interval "$SCHEDULER_RECV_INTERVAL" + --scheduler-recv-interval 10 --tokenizer-worker-num 6 - --tokenizer-path "$MODEL" + --enable-cache-report + --enable-symm-mem --enable-metrics - "${SPEC_ARGS[@]}" "${CACHE_ARGS[@]}" + "${SPEC_ARGS[@]}" ) + printf '%q ' "${SGLANG_CMD[@]}" | tee "$RESULT_DIR/sglang_command.txt" printf '\n' | tee -a "$RESULT_DIR/sglang_command.txt" -"${SGLANG_CMD[@]}" > "$SERVER_LOG" 2>&1 & + +SERVER_PID="" +cleanup_agentic_services() { + local exit_code=$? + trap - EXIT INT TERM + set +e + stop_background_process_tree "$SERVER_PID" "SGLang server" 60 + exit "$exit_code" +} +trap cleanup_agentic_services EXIT +trap 'exit 130' INT +trap 'exit 143' TERM + +{ + echo "=== SGLANG_* env vars at launch ===" + env | grep -E '^SGLANG_' | sort + echo "===================================" +} > "$SERVER_LOG" + +"${SGLANG_CMD[@]}" >> "$SERVER_LOG" 2>&1 & SERVER_PID=$! echo "Server PID: $SERVER_PID" wait_for_server_ready --port "$PORT" --server-log "$SERVER_LOG" --server-pid "$SERVER_PID" -if [ "${EVAL_ONLY}" = "true" ]; then +if [ "$EVAL_ONLY" = "true" ]; then run_eval --port "$PORT" else build_replay_cmd "$RESULT_DIR" + REPLAY_CMD+=" --apply-chat-template" + REPLAY_CMD+=" --server-metrics http://localhost:$PORT/metrics" run_agentic_replay_and_write_outputs "$RESULT_DIR" fi diff --git a/benchmarks/single_node/agentic/qwen3.5_fp8_h200_sglang_mtp.sh b/benchmarks/single_node/agentic/qwen3.5_fp8_h200_sglang_mtp.sh deleted file mode 100755 index f0fee4946..000000000 --- a/benchmarks/single_node/agentic/qwen3.5_fp8_h200_sglang_mtp.sh +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -set -x - -# Agentic trace replay for Qwen3.5 FP8 on H200 with native NEXTN MTP and -# DRAM HiCache. Throughput pins the committed golden acceptance length; evals -# retain target-model verification. - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -source "$SCRIPT_DIR/../../benchmark_lib.sh" - -check_env_vars \ - MODEL MODEL_PREFIX TP CONC KV_OFFLOADING TOTAL_CPU_DRAM_GB RESULT_DIR \ - DURATION EP_SIZE EVAL_ONLY SPEC_DECODING - -if ! require_agentic_kv_offload_backend hicache; then - echo "Error: this H200 MTP recipe requires KV_OFFLOADING=dram with HiCache" >&2 - exit 1 -fi - -if [ "$TP" -ne 8 ] || [ "$EP_SIZE" -ne 1 ]; then - echo "Error: this H200 MTP recipe requires TP=8 and EP_SIZE=1" >&2 - exit 1 -fi - -if [ "$SPEC_DECODING" != "mtp" ]; then - echo "Error: this launcher requires SPEC_DECODING=mtp" >&2 - exit 1 -fi - -if [ "$TOTAL_CPU_DRAM_GB" -lt 1200 ]; then - echo "Error: TP8 requires at least 1200 GB host DRAM; generated budget is ${TOTAL_CPU_DRAM_GB} GB" >&2 - exit 1 -fi - -if [[ -n "${SLURM_JOB_ID:-}" ]]; then - echo "JOB $SLURM_JOB_ID running on ${SLURMD_NODENAME:-unknown}" -fi - -if [[ -n "${MODEL_PATH:-}" ]]; then - if [[ ! -d "$MODEL_PATH" || -z "$(ls -A "$MODEL_PATH" 2>/dev/null)" ]]; then - hf download "$MODEL" --local-dir "$MODEL_PATH" - fi -else - hf download "$MODEL" - export MODEL_PATH="$MODEL" -fi -nvidia-smi - -export WEKA_LOADER_OVERRIDE=semianalysis_cc_traces_weka_with_subagents_256k -resolve_trace_source -install_agentic_deps - -# Pin the published FlashInfer 0.6.15 CUDA 13 wheels used by this launcher. -agentic_pip_install --no-deps --force-reinstall flashinfer_python==0.6.15 -agentic_pip_install \ - --no-deps --force-reinstall flashinfer-cubin==0.6.15 \ - --index-url https://flashinfer.ai/whl -agentic_pip_install \ - --no-deps --force-reinstall flashinfer-jit-cache==0.6.15+cu130 \ - --index-url https://flashinfer.ai/whl/cu130 - -SERVER_LOG="$RESULT_DIR/server.log" -mkdir -p "$RESULT_DIR" - -export TORCH_CUDA_ARCH_LIST=9.0 -export PYTHONNOUSERSITE=1 -export PYTHONUNBUFFERED=1 -export FLASHINFER_DISABLE_VERSION_CHECK=1 -export FLASHINFER_WORKSPACE_BASE=/tmp/flashinfer-cache -export SGL_ENABLE_JIT_DEEPGEMM=false -export SGLANG_ENABLE_FLASHINFER_GEMM=true -export SGLANG_ENABLE_SPEC_V2=1 - -# Three speculative tokens per verification step. For agentic throughput, pin -# the committed Qwen3.5 MTP golden AL (thinking_on, K=3); evals use real -# verification because simulated acceptance does not produce accuracy data. -if [ "$EVAL_ONLY" != "true" ]; then - export SGLANG_SIMULATE_ACC_LEN=3.39 - export SGLANG_SIMULATE_ACC_METHOD=match-expected - export SGLANG_SIMULATE_ACC_TOKEN_MODE=real-draft-token -fi - -SGLANG_CMD=( - python3 -m sglang.launch_server - --model-path "$MODEL_PATH" - --served-model-name "$MODEL" - --host 0.0.0.0 - --port "$PORT" - --trust-remote-code - --tensor-parallel-size "$TP" - --data-parallel-size 1 - --expert-parallel-size "$EP_SIZE" - --quantization fp8 - --kv-cache-dtype fp8_e4m3 - --mamba-ssm-dtype bfloat16 - --mamba-scheduler-strategy extra_buffer - --mamba-track-interval 8192 - --mamba-max-states-per-path 1 - --attention-backend flashinfer - --cuda-graph-max-bs 32 - --max-running-requests 128 - --max-prefill-tokens 16384 - --chunked-prefill-size 16384 - --mem-fraction-static 0.78 - --max-mamba-cache-size 360 - --allow-auto-truncate - --stream-interval 50 - --scheduler-recv-interval 10 - --tokenizer-worker-num 6 - --enable-cache-report - --enable-symm-mem - --enable-metrics - --page-size 64 - --enable-hierarchical-cache - --hicache-ratio 0.9 - --hicache-io-backend kernel - --hicache-mem-layout page_first_direct - --hicache-write-policy write_back - --speculative-algorithm NEXTN - --speculative-num-steps 3 - --speculative-eagle-topk 1 - --speculative-num-draft-tokens 4 -) - -printf '%q ' "${SGLANG_CMD[@]}" | tee "$RESULT_DIR/sglang_command.txt" -printf '\n' | tee -a "$RESULT_DIR/sglang_command.txt" - -SERVER_PID="" -cleanup_agentic_services() { - local exit_code=$? - trap - EXIT INT TERM - set +e - stop_background_process_tree "$SERVER_PID" "SGLang server" 60 - exit "$exit_code" -} -trap cleanup_agentic_services EXIT -trap 'exit 130' INT -trap 'exit 143' TERM - -{ - echo "=== SGLANG_* env vars at launch ===" - env | grep -E '^SGLANG_' | sort - echo "===================================" -} > "$SERVER_LOG" - -"${SGLANG_CMD[@]}" >> "$SERVER_LOG" 2>&1 & -SERVER_PID=$! -echo "Server PID: $SERVER_PID" - -wait_for_server_ready --port "$PORT" --server-log "$SERVER_LOG" --server-pid "$SERVER_PID" - -if [ "$EVAL_ONLY" = "true" ]; then - run_eval --port "$PORT" -else - build_replay_cmd "$RESULT_DIR" - REPLAY_CMD+=" --apply-chat-template" - REPLAY_CMD+=" --server-metrics http://localhost:$PORT/metrics" - run_agentic_replay_and_write_outputs "$RESULT_DIR" -fi diff --git a/runners/launch_h200-dgxc-slurm.sh b/runners/launch_h200-dgxc-slurm.sh index f904d8bc2..a0ff8b14b 100755 --- a/runners/launch_h200-dgxc-slurm.sh +++ b/runners/launch_h200-dgxc-slurm.sh @@ -350,7 +350,7 @@ EOF find . -name '.nfs*' -delete 2>/dev/null || true else - SQUASH_FILE="/data/gharunners/containers/$(echo "$IMAGE" | sed 's/[\/:@#]/_/g').sqsh" + SQUASH_FILE="/data/containers/$(echo "$IMAGE" | sed 's/[\/:@#]/_/g').sqsh" # Convert pyxis image format (nvcr.io#path) to docker format (nvcr.io/path) for enroot import DOCKER_IMAGE=$(echo "$IMAGE" | sed 's/#/\//g') From 52074c3bc818fc96eedebcca32cd6c5ede662b0f Mon Sep 17 00:00:00 2001 From: hshrivastava-droid Date: Thu, 13 Aug 2026 14:44:36 -0700 Subject: [PATCH 5/6] fix(config): refresh sglang image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新 SGLang 镜像。 --- configs/nvidia-master.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/nvidia-master.yaml b/configs/nvidia-master.yaml index 40bce0904..f0f770e07 100644 --- a/configs/nvidia-master.yaml +++ b/configs/nvidia-master.yaml @@ -7189,7 +7189,7 @@ qwen3.5-fp8-h200-sglang-agentic-mtp: # H200 AgentX MTP frontier with DRAM HiCache. This is intentionally an MTP-only # submission; the model's non-speculative AgentX arm is not included. qwen3.5-fp8-h200-sglang-agentic-hicache-mtp: - image: lmsysorg/sglang:nightly-dev-cu13-20260716-b0b2dfbd + image: lmsysorg/sglang:nightly-dev-cu13-20260813-273d978b model: Qwen/Qwen3.5-397B-A17B-FP8 model-prefix: qwen3.5 runner: cluster:h200-dgxc From 73faadad4b57badff2e7ef1363def15357c5fa94 Mon Sep 17 00:00:00 2001 From: hshrivastava-droid Date: Thu, 13 Aug 2026 15:04:01 -0700 Subject: [PATCH 6/6] fix(agentic): update flashinfer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新 FlashInfer 版本。 --- benchmarks/single_node/agentic/qwen3.5_fp8_h200_mtp.sh | 6 +++--- perf-changelog.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/benchmarks/single_node/agentic/qwen3.5_fp8_h200_mtp.sh b/benchmarks/single_node/agentic/qwen3.5_fp8_h200_mtp.sh index 1ed9ef9ca..b6f6d7eeb 100755 --- a/benchmarks/single_node/agentic/qwen3.5_fp8_h200_mtp.sh +++ b/benchmarks/single_node/agentic/qwen3.5_fp8_h200_mtp.sh @@ -44,12 +44,12 @@ export WEKA_LOADER_OVERRIDE=semianalysis_cc_traces_weka_with_subagents_256k resolve_trace_source install_agentic_deps -agentic_pip_install --no-deps --force-reinstall flashinfer_python==0.6.15 +agentic_pip_install --no-deps --force-reinstall flashinfer_python==0.6.17 agentic_pip_install \ - --no-deps --force-reinstall flashinfer-cubin==0.6.15 \ + --no-deps --force-reinstall flashinfer-cubin==0.6.17 \ --index-url https://flashinfer.ai/whl agentic_pip_install \ - --no-deps --force-reinstall flashinfer-jit-cache==0.6.15+cu130 \ + --no-deps --force-reinstall flashinfer-jit-cache==0.6.17+cu130 \ --index-url https://flashinfer.ai/whl/cu130 SERVER_LOG="$RESULT_DIR/server.log" diff --git a/perf-changelog.yaml b/perf-changelog.yaml index af1c6a759..1bd6cf219 100644 --- a/perf-changelog.yaml +++ b/perf-changelog.yaml @@ -5960,5 +5960,5 @@ - agentic-coding description: - "Add Qwen3.5 FP8 H200 SGLang AgentX MTP points with DRAM HiCache" - - "Use TP8/EP1 concurrency 2 through 24, published FlashInfer 0.6.15 CUDA 13 wheels, and golden MTP acceptance length 3.39" + - "Use TP8/EP1 concurrency 2 through 24, published FlashInfer 0.6.17 CUDA 13 wheels, and golden MTP acceptance length 3.39" pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/XXX