Skip to content

Commit 6b8619f

Browse files
seungrokjclaude
andcommitted
fix(agentic-mtp): tune DPA memory, prefill chunk, and batch sizing
Set MEM_FRACTION_STATIC=0.75 under DPA for speculative-decode headroom, double chunked-prefill to 16K/scheduler for agentic prefill tails, set MAX_RUNNING_REQUESTS=CONC, and partition CUDA_GRAPH_MAX_BS across DP ranks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4ddd584 commit 6b8619f

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

benchmarks/single_node/agentic/dsv4_fp4_mi355x_sglang_mtp.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ CHUNKED_PREFILL_SIZE=8192
8080
PARALLEL_ARGS=(--tensor-parallel-size "$TP")
8181
if [ "$DP_ATTENTION" = "true" ]; then
8282
USE_SGLANG_ROUTER=true
83+
# DPA + MTP needs additional runtime headroom for speculative decode and
84+
# communication buffers beyond SGLang's static KV pool.
85+
MEM_FRACTION_STATIC=0.75
8386
export AIPERF_HTTP_X_SMG_ROUTING_KEY_FROM_CORRELATION_ID=true
8487
SGLANG_BACKEND_PORT=$((PORT + 1))
8588
SGLANG_ROUTER_METRICS_PORT=$((PORT + 10000))
@@ -89,9 +92,11 @@ if [ "$DP_ATTENTION" = "true" ]; then
8992
export SGLANG_DP_SHARED_EXPERT_LOCAL=1
9093
export SGLANG_DP_USE_GATHERV=1
9194
export SGLANG_DP_USE_REDUCE_SCATTER=1
92-
export GPU_MAX_HW_QUEUES=5
9395

94-
CHUNKED_PREFILL_SIZE=$((8192 * TP))
96+
# SGLang divides the configured chunk across DP schedulers. Use a 16K
97+
# per-scheduler chunk so long agentic prefill tails drain within the
98+
# standard 600-second warmup grace period.
99+
CHUNKED_PREFILL_SIZE=$((16384 * TP))
95100
PARALLEL_ARGS+=(
96101
--dp "$TP"
97102
--enable-dp-attention
@@ -106,8 +111,11 @@ fi
106111
# SGLang treats max-running-requests as a global DPA limit and partitions it
107112
# internally. CUDA graph capture is per scheduler, so only its batch size is
108113
# divided across DP ranks.
109-
MAX_RUNNING_REQUESTS=$((2 * CONC))
114+
MAX_RUNNING_REQUESTS=$CONC
110115
CUDA_GRAPH_MAX_BS=$CONC
116+
if [ "$DP_ATTENTION" = "true" ]; then
117+
CUDA_GRAPH_MAX_BS=$(( (CUDA_GRAPH_MAX_BS + TP - 1) / TP ))
118+
fi
111119
[ "$CUDA_GRAPH_MAX_BS" -gt 128 ] && CUDA_GRAPH_MAX_BS=128
112120

113121
# Simulated acceptance-length (AL) settings.
@@ -132,10 +140,6 @@ SPEC_ARGS=(
132140
--speculative-num-draft-tokens 4
133141
)
134142

135-
if [ ${#SPEC_ARGS[@]} -gt 0 ]; then
136-
MEM_FRACTION_STATIC=$(awk "BEGIN {printf \"%.2f\", $MEM_FRACTION_STATIC - 0.10}")
137-
fi
138-
139143
SGLANG_CMD=(
140144
python3 -m sglang.launch_server
141145
--model-path "$MODEL_PATH"

0 commit comments

Comments
 (0)