-
Notifications
You must be signed in to change notification settings - Fork 264
[AMD][AgentX] Add DeepSeek-V4-Pro FP4 MI355X ATOM MTP #2698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
| set -x | ||
|
|
||
| # Agentic trace replay benchmark for DeepSeek-V4-Pro FP4 on MI355X using | ||
| # ATOM MTP. Throughput runs use the committed golden synthetic acceptance; | ||
| # eval-only runs use the model's real MTP acceptance. | ||
|
|
||
| source "$(dirname "$0")/../../benchmark_lib.sh" | ||
|
|
||
| check_env_vars MODEL TP CONC KV_OFFLOADING TOTAL_CPU_DRAM_GB RESULT_DIR DURATION EP_SIZE DP_ATTENTION | ||
|
|
||
| if [[ -n "${SLURM_JOB_ID:-}" ]]; then | ||
| echo "JOB $SLURM_JOB_ID running on ${SLURMD_NODENAME:-unknown}" | ||
| fi | ||
|
|
||
| if [ "$TP" -ne 8 ] || [ "$EP_SIZE" -ne 1 ] || [ "$DP_ATTENTION" != "false" ]; then | ||
| echo "This recipe requires TP=8, EP_SIZE=1, and DP_ATTENTION=false" >&2 | ||
| exit 1 | ||
| fi | ||
| require_agentic_kv_offload_none | ||
|
|
||
| if [[ -n "${ROCR_VISIBLE_DEVICES:-}" ]]; then | ||
| export HIP_VISIBLE_DEVICES="$ROCR_VISIBLE_DEVICES" | ||
| 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 | ||
|
|
||
| rocm-smi || true | ||
| amd-smi || true | ||
|
|
||
| resolve_trace_source | ||
| install_agentic_deps | ||
|
|
||
| # ATOM runtime settings validated with the DeepSeek-V4-Pro AgentX baseline. | ||
| export AITER_BF16_FP8_MOE_BOUND=0 | ||
| export AITER_LOG_LEVEL=WARNING | ||
| export ATOM_MOE_GU_ITLV=1 | ||
| export ATOM_DISABLE_MMAP=true | ||
| export ATOM_DEBUG_PREFIX_HITS=1 | ||
| export ATOM_PROFILER_MORE=0 | ||
| export ATOM_PROFILER_TIMEOUT=1200 | ||
|
|
||
| # AgentX/AIPerf network, failure, warmup, and trace-gap settings from the | ||
| # validated one-hour baseline. | ||
| export AIPERF_HTTP_TCP_USER_TIMEOUT=900000 | ||
| export AIPERF_FAILED_REQUEST_THRESHOLD=0.10 | ||
| export AIPERF_LIVE_FAILED_REQUEST_THRESHOLD=0.10 | ||
| export AIPERF_TRACE_IDLE_GAP_CAP_SECONDS=300 | ||
| export AIPERF_WARMUP_REQUESTS_PER_LANE=10 | ||
| export AIPERF_BENCHMARK_GRACE_PERIOD=30 | ||
|
|
||
| # Require ATOM Prometheus metrics in every official result. | ||
| export AIPERF_SERVER_METRICS_URLS="http://localhost:${PORT}/metrics" | ||
| export AIPERF_REQUIRED_SERVER_METRIC_PREFIX="atom:" | ||
|
|
||
| wait_for_amd_gpu_clean | ||
|
|
||
| SERVER_LOG="$RESULT_DIR/server.log" | ||
| mkdir -p "$RESULT_DIR" | ||
|
|
||
| SERVER_PID="" | ||
| cleanup_atom_server() { | ||
| local exit_code=$? | ||
| trap - EXIT INT TERM | ||
| set +e | ||
| stop_background_process_tree "$SERVER_PID" "ATOM server" 60 | ||
| exit "$exit_code" | ||
| } | ||
| trap cleanup_atom_server EXIT | ||
| trap 'exit 130' INT | ||
| trap 'exit 143' TERM | ||
|
|
||
| # AgentX concurrency counts session trees. Keep 2x scheduler headroom for the | ||
| # request bursts produced by subagent fan-out. | ||
| MAX_NUM_SEQS=$((2 * CONC)) | ||
|
|
||
| # golden_al_distribution/dsv4_mtp.yaml: thinking_on, 3 draft tokens -> AL 2.49 | ||
| # --spec-decode-acceptance-length 2.49. | ||
| # https://github.com/ROCm/ATOM/pull/1948 | ||
| NUM_SPEC_TOKENS=3 | ||
| SPEC_DECODE_AL=2.49 | ||
| SPEC_ARGS=( | ||
| --method mtp | ||
| --num-speculative-tokens "$NUM_SPEC_TOKENS" | ||
| ) | ||
| if [ "${EVAL_ONLY:-false}" != "true" ]; then | ||
| SPEC_ARGS+=(--spec-decode-acceptance-length "$SPEC_DECODE_AL") | ||
| fi | ||
|
|
||
| echo "Starting ATOM server with MAX_NUM_SEQS=$MAX_NUM_SEQS NUM_SPEC_TOKENS=$NUM_SPEC_TOKENS SPEC_DECODE_AL=$SPEC_DECODE_AL EVAL_ONLY=${EVAL_ONLY:-false}" | ||
| ATOM_CMD=( | ||
| python3 -u -m atom.entrypoints.openai_server | ||
| --model "$MODEL_PATH" | ||
| --served-model-name "$MODEL" | ||
| --host 0.0.0.0 | ||
| --server-port "$PORT" | ||
| --tensor-parallel-size "$TP" | ||
| --kv-cache-dtype fp8 | ||
| --index-cache-dtype fp4 | ||
| --enable-prefix-caching | ||
| --gpu-memory-utilization 0.9 | ||
| --max-num-batched-tokens 16384 | ||
| --attn-prefill-chunk-size 16384 | ||
| --state-checkpoint-interval-tokens 8192 | ||
| --level 3 | ||
| --cudagraph-mode FULL | ||
| "${SPEC_ARGS[@]}" | ||
| --max-num-seqs "$MAX_NUM_SEQS" | ||
| ) | ||
| write_command "$RESULT_DIR/server_command.txt" "${ATOM_CMD[@]}" | ||
| "${ATOM_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:-false}" = "true" ]; then | ||
| run_eval --port "$PORT" | ||
| else | ||
| # AgentX DSv4 traces already carry fully formed chat payloads; do not apply | ||
| # AIPerf's generic chat template on top of them. | ||
| build_replay_cmd "$RESULT_DIR" | ||
| run_agentic_replay_and_write_outputs "$RESULT_DIR" | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6196,6 +6196,18 @@ | |
| - "Set max-num-seqs to twice the concurrency, select CUDA graph capture sizes by concurrency, and cap max-num-batched-tokens at 16384." | ||
| pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/2576 | ||
|
|
||
| - config-keys: | ||
| - dsv4-fp4-mi355x-atom-agentic-mtp | ||
| scenario-type: | ||
| - agentic-coding | ||
| description: | ||
| - "Add DeepSeek-V4-Pro FP4 ATOM MTP AgentX on one 8x MI355X node at concurrency 1, 2, 4, 8, 16, 32, and 48, with no KV offload and max-num-seqs set to twice concurrency." | ||
| - "Use rocm/atom-dev:nightly_202608201032, FP8 KV/index caches, prefix caching, 32K state checkpoints, 16K batching/prefill chunks, and FULL cudagraph mode." | ||
| - "Use three-token MTP with the committed DeepSeek-V4 thinking-mode golden AL 2.49 (synthetic acceptance length 3) for throughput, while eval-only runs measure real MTP acceptance." | ||
| - "Increase the AgentX warmup grace period from the 1800-second default to 3600 seconds at concurrency 32 and 48, matching the DeepSeek-V4-Pro SGLang saturation recipe so in-flight warmup requests can drain and reused long prefixes are fully primed before profiling." | ||
| - "Keep concurrency 1 through 16 at the default 1800 seconds; the profiling duration remains 3600 seconds for every concurrency arm." | ||
| pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/2698 | ||
|
|
||
| - config-keys: | ||
|
Comment on lines
+6199
to
6211
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 AGENTS.md requires perf-changelog.yaml to be append-only, with new entries appended only at the tail — this entry ( Extended reasoning...What the bug is. Root cause. Per the PR description, this PR "internalizes fork PR #2668 ... Applied as the PR's net diff ( Why nothing else catches this. The YAML itself still parses fine (list order doesn't affect Step-by-step proof:
The fix is trivial: cut the 12-line |
||
| - kimik3-fp4-b200-dynamo-vllm-agentic-dspark | ||
| scenario-type: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 AIPERF_BENCHMARK_GRACE_PERIOD (line 58) isn't a real config var — benchmark_lib.sh only honors AGENTIC_WARMUP_GRACE_PERIOD (default 1800s) for --warmup-grace-period, and this name is referenced nowhere else in the repo. As a result, the perf-changelog's claim of a 3600s warmup grace period at concurrency 32/48 (mirroring dsv4_fp4_mi355x_sglang_mtp.sh's conditional) is never implemented — every arm silently runs at the 1800s default.
Extended reasoning...
The bug:
dsv4_fp4_mi355x_atom_mtp.sh:58setsexport AIPERF_BENCHMARK_GRACE_PERIOD=30, but this environment variable is never consumed anywhere in the repository. A repo-wide grep confirms it appears only on this one line. The warmup grace period actually used by the replay harness is controlled by a different variable,AGENTIC_WARMUP_GRACE_PERIOD, whichbenchmark_lib.sh:2044reads via--warmup-grace-period ${AGENTIC_WARMUP_GRACE_PERIOD:-1800}. Since the new script never setsAGENTIC_WARMUP_GRACE_PERIOD, every concurrency arm — including 32 and 48 — falls back to the 1800-second default.Why this matters here: the sibling recipe
dsv4_fp4_mi355x_sglang_mtp.sh:172-174implements exactly this override correctly:with the comment "Saturation arms carry a larger in-flight working set than the 30-minute default warmup drain allows."
glm5.2_fp4_mi355x_sglang_mtp.shuses the same pattern. And this very PR'sperf-changelog.yamlentry explicitly documents the same intent for the ATOM recipe: "Increase the AgentX warmup grace period from the 1800-second default to 3600 seconds at concurrency 32 and 48 ... Keep concurrency 1 through 16 at the default 1800 seconds." The code that's supposed to realize that claim was never written — instead a plausible-looking but nonexistent variable was set.Why nothing catches it:
set -euo pipefaildoesn't fail on setting an unused/unread env var — bash has no concept of "this export is consumed by anything," so the line runs successfully and silently does nothing. There's no lint or CI check tyingperf-changelog.yamlprose to the actual exported variables in the recipe script, so the mismatch between documented and actual behavior ships clean.Step-by-step proof:
dsv4_fp4_mi355x_atom_mtp.sh:58runsexport AIPERF_BENCHMARK_GRACE_PERIOD=30.build_replay_cmd "$RESULT_DIR"(benchmark_lib.sh), which at line 2044 builds the CLI arg:REPLAY_CMD+=" --warmup-grace-period ${AGENTIC_WARMUP_GRACE_PERIOD:-1800}".AGENTIC_WARMUP_GRACE_PERIODwas never exported by this script, so bash substitutes the default1800, regardless ofCONC.AIPERF_BENCHMARK_GRACE_PERIODis simply dead — no code path inbenchmark_lib.shor elsewhere reads it (confirmed by grep against allAIPERF_*handling, which processesAIPERF_WARMUP_REQUESTS_PER_LANE,AIPERF_TRACE_IDLE_GAP_CAP_SECONDS,AIPERF_FAILED_REQUEST_THRESHOLD, etc., but never this name).Fix: replace the dead
export AIPERF_BENCHMARK_GRACE_PERIOD=30line with the same conditional the sibling script uses:placed after
CONCis available (it's already required viacheck_env_vars), or at minimum exportAGENTIC_WARMUP_GRACE_PERIOD=3600unconditionally if simplicity is preferred over the changelog's stated conc-1-16-stays-at-1800 nuance.