From 3646c2d94a54505846750413081b5a00006c78cf Mon Sep 17 00:00:00 2001 From: Cam Quilici Date: Fri, 7 Aug 2026 00:11:04 -0500 Subject: [PATCH 1/5] feat(agentx): add Qwen FP8 MTP on B300 --- .../agentic/qwen3.5_fp8_b300_sglang_mtp.sh | 172 ++++++++++++++++++ configs/nvidia-master.yaml | 15 ++ 2 files changed, 187 insertions(+) create mode 100755 benchmarks/single_node/agentic/qwen3.5_fp8_b300_sglang_mtp.sh diff --git a/benchmarks/single_node/agentic/qwen3.5_fp8_b300_sglang_mtp.sh b/benchmarks/single_node/agentic/qwen3.5_fp8_b300_sglang_mtp.sh new file mode 100755 index 0000000000..76f4f0d3f5 --- /dev/null +++ b/benchmarks/single_node/agentic/qwen3.5_fp8_b300_sglang_mtp.sh @@ -0,0 +1,172 @@ +#!/usr/bin/env bash +set -euo pipefail +set -x + +# AgentX trace replay for Qwen3.5-397B-A17B FP8 on B300 with SGLang +# native NEXTN MTP. Throughput uses the committed golden synthetic AL; evals +# retain real target-model verification. + +source "$(dirname "$0")/../../benchmark_lib.sh" + +# Use the lightweight GSM8K eval instead of the AgentX SWE-bench default. +export EVAL_FRAMEWORK="lm-eval" + +check_env_vars \ + MODEL TP CONC EP_SIZE KV_OFFLOADING \ + TOTAL_CPU_DRAM_GB RESULT_DIR DURATION + +SCHEDULER_RECV_INTERVAL=${SCHEDULER_RECV_INTERVAL:-10} + +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_062126_256k +resolve_trace_source +install_agentic_deps + +SERVER_LOG="$RESULT_DIR/server.log" +mkdir -p "$RESULT_DIR" + +CACHE_ARGS=() +if require_agentic_kv_offload_backend hicache; then + 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" + # SGLang applies --hicache-size independently to Qwen's target KV and + # Mamba pools. Native NEXTN also creates a draft KV pool with the same + # slot count; its one attention layer adds 1/15 of the target KV bytes. + # Reserve 1 GB/rank for page alignment and enforce H * 31/15 per rank. + HICACHE_ALIGNMENT_RESERVE_GB=$TP + HICACHE_USABLE_TOTAL_GB=$((TOTAL_CPU_DRAM_GB - HICACHE_ALIGNMENT_RESERVE_GB)) + if [ "$HICACHE_USABLE_TOTAL_GB" -lt 1 ]; then + echo "Error: insufficient DRAM after HiCache alignment reserve" >&2 + exit 1 + fi + MAX_HICACHE_SIZE_GB=$((HICACHE_USABLE_TOTAL_GB * 15 / TP / 31)) + HICACHE_SIZE_GB="${HICACHE_SIZE_GB:-$MAX_HICACHE_SIZE_GB}" + if [ "$HICACHE_SIZE_GB" -lt 1 ] || [ "$HICACHE_SIZE_GB" -gt "$MAX_HICACHE_SIZE_GB" ]; then + echo "Error: HICACHE_SIZE_GB=$HICACHE_SIZE_GB outside 1..$MAX_HICACHE_SIZE_GB" >&2 + exit 1 + fi + PROJECTED_HICACHE_TOTAL_GB=$(((HICACHE_SIZE_GB * TP * 31 + 14) / 15 + HICACHE_ALIGNMENT_RESERVE_GB)) + if [ "$PROJECTED_HICACHE_TOTAL_GB" -gt "$TOTAL_CPU_DRAM_GB" ]; then + echo "Error: projected HiCache use ${PROJECTED_HICACHE_TOTAL_GB} GB exceeds configured capacity ${TOTAL_CPU_DRAM_GB} GB" >&2 + exit 1 + fi + echo "HiCache CPU pools: ${HICACHE_SIZE_GB} GB target + Mamba + 1/15 draft per rank across TP=${TP}; projected node total ${PROJECTED_HICACHE_TOTAL_GB} GB <= ${TOTAL_CPU_DRAM_GB} GB" + 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 write_through_selective + ) +fi + +PARALLEL_ARGS=( + --tp "$TP" + --dp 1 + --ep-size "$EP_SIZE" +) + +# Parallel tokenization keeps 256k AgentX warmups below the client timeout. +TOKENIZER_ARGS=(--tokenizer-worker-num 6) + +# AgentX concurrency counts live session trees rather than individual HTTP +# requests. Leave room for subagent fan-out and avoid spending HBM on graphs +# above the batch sizes that remain useful for this long-context workload. +MAX_RUNNING_REQUESTS=$((2 * CONC)) +CUDA_GRAPH_MAX_BS="$CONC" +[ "$CUDA_GRAPH_MAX_BS" -gt 64 ] && CUDA_GRAPH_MAX_BS=64 + +export TORCH_CUDA_ARCH_LIST="10.0" +export PYTHONNOUSERSITE=1 +export NCCL_NVLS_ENABLE=1 +export SGL_ENABLE_JIT_DEEPGEMM=false +export SGLANG_ENABLE_FLASHINFER_GEMM=true +# Keep server-side connections alive beyond AIPerf's 300-second client pool +# timeout so bursty AgentX trajectories cannot reuse a closing idle socket. +export SGLANG_TIMEOUT_KEEP_ALIVE=1800 + +if [ "${EVAL_ONLY:-false}" != "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 + "${PARALLEL_ARGS[@]}" + --enable-symm-mem + --quantization fp8 + --kv-cache-dtype fp8_e4m3 + --mamba-ssm-dtype bfloat16 + --attention-backend trtllm_mha + --moe-runner-backend flashinfer_trtllm + --cuda-graph-max-bs "$CUDA_GRAPH_MAX_BS" + --max-running-requests "$MAX_RUNNING_REQUESTS" + --max-prefill-tokens 16384 + --chunked-prefill-size 16384 + --mem-fraction-static 0.80 + --stream-interval 50 + --scheduler-recv-interval "$SCHEDULER_RECV_INTERVAL" + "${TOKENIZER_ARGS[@]}" + --tokenizer-path "$MODEL" + --reasoning-parser qwen3 + --tool-call-parser qwen3_coder + --speculative-algorithm NEXTN + --speculative-num-steps 3 + --speculative-eagle-topk 1 + --speculative-num-draft-tokens 4 + --enable-metrics + --enable-cache-report + "${CACHE_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=$! + +capture_cache_metrics() { + { + echo "=== SGLang cache metrics snapshot $(date --iso-8601=seconds) ===" + curl -fsS "http://localhost:$PORT/metrics" 2>/dev/null \ + | grep -E '^(sglang:(cache_hit_rate|cached_tokens_total|prompt_tokens_total|hicache_host_used_tokens|hicache_host_total_tokens|token_usage|num_requests_running|num_requests_waiting))' \ + || true + echo "============================================================" + } >> "$SERVER_LOG" +} + +wait_for_server_ready --port "$PORT" --server-log "$SERVER_LOG" --server-pid "$SERVER_PID" + +capture_cache_metrics +trap capture_cache_metrics EXIT + +if [ "${EVAL_ONLY:-false}" = "true" ]; then + run_eval --port "$PORT" +else + build_replay_cmd "$RESULT_DIR" + 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 960045470d..247b23d384 100644 --- a/configs/nvidia-master.yaml +++ b/configs/nvidia-master.yaml @@ -7442,6 +7442,21 @@ qwen3.5-fp8-b300-sglang-agentic-hicache: - { tp: 4, ep: 1, kv-offloading: none, conc-list: [1, 2, 4, 8, 16, 32] } - { tp: 4, ep: 1, kv-offloading: dram, kv-offload-backend: { name: hicache }, conc-list: [16, 32, 48, 64] } +qwen3.5-fp8-b300-sglang-agentic-mtp: + image: lmsysorg/sglang:v0.5.16-cu130 + model: Qwen/Qwen3.5-397B-A17B-FP8 + model-prefix: qwen3.5 + runner: cluster:b300-nv + precision: fp8 + framework: sglang + multinode: false + scenarios: + agentic-coding: + - dram-utilization: 0.80 + search-space: + - { tp: 4, ep: 1, spec-decoding: mtp, kv-offloading: none, conc-list: [1, 2, 4, 8, 16, 32] } + - { tp: 4, ep: 1, spec-decoding: mtp, kv-offloading: dram, kv-offload-backend: { name: hicache }, conc-list: [16, 32, 48, 64] } + qwen3.5-fp4-b300-sglang-agentic-mtp: image: lmsysorg/sglang:v0.5.16-cu130 model: nvidia/Qwen3.5-397B-A17B-NVFP4 From 89683b7ba2ad39c79882394ee7a00cbe55a19435 Mon Sep 17 00:00:00 2001 From: Cam Quilici Date: Fri, 7 Aug 2026 00:11:58 -0500 Subject: [PATCH 2/5] chore: trigger B300 Qwen FP8 AgentX sweep --- perf-changelog.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/perf-changelog.yaml b/perf-changelog.yaml index 4a2145e445..382a87b810 100644 --- a/perf-changelog.yaml +++ b/perf-changelog.yaml @@ -5527,3 +5527,13 @@ - "Record the recipes' active HiCache host-DRAM tier and, for disaggregated points, Dynamo router commit 5a638087 in nvidia-master metadata so generated artifacts no longer report kv_offloading=none, allocated_cpu_dram_gb=0, or a null router." pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/2477 + +- config-keys: + - qwen3.5-fp8-b300-sglang-agentic-mtp + scenario-type: + - agentic-coding + description: + - "Add Qwen3.5-397B-A17B FP8 AgentX on B300 with SGLang native NEXTN MTP" + - "Use the existing FP8 AgentX TP4 no-offload and HiCache concurrency grids with the 256k trace dataset and golden synthetic acceptance length 3.39" + - "Image: lmsysorg/sglang:v0.5.16-cu130" + pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/2515 From f3badf6cbe11339c1abdb43199459e5323b5318f Mon Sep 17 00:00:00 2001 From: Cam Quilici Date: Fri, 7 Aug 2026 00:15:36 -0500 Subject: [PATCH 3/5] perf(agentx): mirror B300 FP4 search space for FP8 --- .../single_node/agentic/qwen3.5_fp8_b300_sglang_mtp.sh | 9 +++++++-- configs/nvidia-master.yaml | 5 +++-- perf-changelog.yaml | 3 ++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/benchmarks/single_node/agentic/qwen3.5_fp8_b300_sglang_mtp.sh b/benchmarks/single_node/agentic/qwen3.5_fp8_b300_sglang_mtp.sh index 76f4f0d3f5..2d0a390250 100755 --- a/benchmarks/single_node/agentic/qwen3.5_fp8_b300_sglang_mtp.sh +++ b/benchmarks/single_node/agentic/qwen3.5_fp8_b300_sglang_mtp.sh @@ -84,8 +84,13 @@ PARALLEL_ARGS=( --ep-size "$EP_SIZE" ) -# Parallel tokenization keeps 256k AgentX warmups below the client timeout. -TOKENIZER_ARGS=(--tokenizer-worker-num 6) +# TP4 needs parallel tokenization to keep 256k AgentX warmups below the client +# request timeout. Keep TP2 on SGLang's single-worker default: multi-tokenizer +# startup races with the TP2 HiCache shared-memory initialization path. +TOKENIZER_ARGS=() +if [ "$TP" -ge 4 ]; then + TOKENIZER_ARGS=(--tokenizer-worker-num 6) +fi # AgentX concurrency counts live session trees rather than individual HTTP # requests. Leave room for subagent fan-out and avoid spending HBM on graphs diff --git a/configs/nvidia-master.yaml b/configs/nvidia-master.yaml index 247b23d384..417cadd3ba 100644 --- a/configs/nvidia-master.yaml +++ b/configs/nvidia-master.yaml @@ -7454,8 +7454,9 @@ qwen3.5-fp8-b300-sglang-agentic-mtp: agentic-coding: - dram-utilization: 0.80 search-space: - - { tp: 4, ep: 1, spec-decoding: mtp, kv-offloading: none, conc-list: [1, 2, 4, 8, 16, 32] } - - { tp: 4, ep: 1, spec-decoding: mtp, kv-offloading: dram, kv-offload-backend: { name: hicache }, conc-list: [16, 32, 48, 64] } + - { tp: 4, ep: 1, spec-decoding: mtp, kv-offloading: none, conc-list: [1, 4, 8, 12, 16, 20, 24, 28, 32, 40, 48, 56, 60, 64, 68, 72] } + - { tp: 2, ep: 2, spec-decoding: mtp, kv-offloading: none, conc-list: [1, 4, 8, 12, 16, 20, 24, 28, 32] } + - { tp: 2, ep: 2, spec-decoding: mtp, kv-offloading: dram, kv-offload-backend: { name: hicache }, conc-list: [32, 34, 36, 38, 40, 44, 48, 52, 56] } qwen3.5-fp4-b300-sglang-agentic-mtp: image: lmsysorg/sglang:v0.5.16-cu130 diff --git a/perf-changelog.yaml b/perf-changelog.yaml index 382a87b810..70f0214f65 100644 --- a/perf-changelog.yaml +++ b/perf-changelog.yaml @@ -5534,6 +5534,7 @@ - agentic-coding description: - "Add Qwen3.5-397B-A17B FP8 AgentX on B300 with SGLang native NEXTN MTP" - - "Use the existing FP8 AgentX TP4 no-offload and HiCache concurrency grids with the 256k trace dataset and golden synthetic acceptance length 3.39" + - "Mirror the FP4 AgentX MTP TP4 and TP2/EP2 concurrency grids, including the TP2/EP2 HiCache arm" + - "Use the 256k trace dataset and golden synthetic acceptance length 3.39" - "Image: lmsysorg/sglang:v0.5.16-cu130" pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/2515 From 8def2ec97f6210742603fba46780de385170da2d Mon Sep 17 00:00:00 2001 From: Cam Quilici Date: Fri, 7 Aug 2026 00:15:54 -0500 Subject: [PATCH 4/5] chore: trim B300 sweep changelog details --- perf-changelog.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perf-changelog.yaml b/perf-changelog.yaml index 70f0214f65..18df44d82a 100644 --- a/perf-changelog.yaml +++ b/perf-changelog.yaml @@ -5535,6 +5535,6 @@ description: - "Add Qwen3.5-397B-A17B FP8 AgentX on B300 with SGLang native NEXTN MTP" - "Mirror the FP4 AgentX MTP TP4 and TP2/EP2 concurrency grids, including the TP2/EP2 HiCache arm" - - "Use the 256k trace dataset and golden synthetic acceptance length 3.39" + - "Use golden synthetic acceptance length 3.39" - "Image: lmsysorg/sglang:v0.5.16-cu130" pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/2515 From 07084ec9bff4c4a772416275dd840375c5454d25 Mon Sep 17 00:00:00 2001 From: Cameron Quilici Date: Fri, 7 Aug 2026 10:52:22 -0500 Subject: [PATCH 5/5] Update perf-changelog.yaml --- perf-changelog.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/perf-changelog.yaml b/perf-changelog.yaml index ea073c48e1..fa8fb586f0 100644 --- a/perf-changelog.yaml +++ b/perf-changelog.yaml @@ -5567,4 +5567,5 @@ - "Mirror the FP4 AgentX MTP TP4 and TP2/EP2 concurrency grids, including the TP2/EP2 HiCache arm" - "Use golden synthetic acceptance length 3.39" - "Image: lmsysorg/sglang:v0.5.16-cu130" - pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/2515 \ No newline at end of file + pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/2515 +