Skip to content

[AMD] dsv4-fp4-mi355x-atom: latest atom-dev image + opt recipe / DSv4-Pro FP4 MI355X ATOM:升级最新 atom-dev 镜像 + 优化配方 + MTP#2345

Open
zufayu wants to merge 10 commits into
mainfrom
amd/dsv4-fp4-mi355x-atom-mtp-latest
Open

[AMD] dsv4-fp4-mi355x-atom: latest atom-dev image + opt recipe / DSv4-Pro FP4 MI355X ATOM:升级最新 atom-dev 镜像 + 优化配方 + MTP#2345
zufayu wants to merge 10 commits into
mainfrom
amd/dsv4-fp4-mi355x-atom-mtp-latest

Conversation

@zufayu

@zufayu zufayu commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

What

Update dsv4-fp4-mi355x-atom-mtp to the latest atom-dev image and align with ATOM's official MTP config (models.json).

Changes

  • Image: atom0.1.3 release → rocm/atom-dev:nightly_202607231538
  • Grid: aligns ATOM official models.json — MTP3 (dp-off, conc 4-256) + DPA MTP3 (dp-attn, conc 64-1024). No TBO — TBO is incompatible with MTP in ATOM (UBatchWrapper sets spec_decode_metadata=None; official DPA MTP3 has no --enable-tbo).
  • Recipe: --max-num-seqs=conc on dp-on cells and conc≥64 (avoid OOM; MTP reserves q=num_spec+1 per req); add --no-enable_prefix_caching; eval-context handling.
  • bench: --dsv4--use-chat-template (--dsv4 removed upstream; DSv4 chat encoder now ships in the model dir and is auto-discovered — server & bench share it so AL stays aligned).
  • Fix: benchmark_lib source path ../../../ (stale since the fix: move dsv4-fp4-mi355x MTP scripts into fixed_seq_len/ #1860 script move).

Note for reviewers

  • MTP is speculative decoding → uses --use-chat-template for chat-formatted inputs (AL alignment per AGENTS.md).
  • Needs the full-sweep-fail-fast label to run the sweep.

中文说明

dsv4-fp4-mi355x-atom-mtp 升级到最新 atom-dev 镜像并对齐 ATOM 官方 MTP 配方(models.json):镜像 atom0.1.3→nightly_202607231538;网格照官方 MTP3(dp-off 4-256)+DPA MTP3(dp-on 64-1024),不加 TBO(MTP 不兼容);recipe 加 max_num_seqs=conc 防 OOM、--no-enable_prefix_caching;bench 由 --dsv4 改 --use-chat-template(--dsv4 已上游移除,DSv4 encoder 随模型目录发布);修 benchmark_lib source 路径。

… MTP recipe

- image: atom0.1.3 release -> rocm/atom-dev:nightly_202607231538
- grid: align ATOM models.json (MTP3 dp-off conc 4-256 + DPA MTP3 dp-on conc 64-1024); no TBO (incompatible with MTP)
- recipe: add max_num_seqs=conc (avoid OOM on dp-on/conc>=64), --no-enable_prefix_caching, eval-context handling
- bench: --dsv4 -> --use-chat-template (--dsv4 removed upstream; DSv4 encoder ships with model dir)
- fix benchmark_lib source path (../ -> ../../)
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the contribution! Please reach out to respective companies' CODEOWNER to fill in the latest PR_REVIEW_CHECKLIST.md before pinging core maintainer on Slack for review. In order for the signoff PR check bot to trigger, you must follow the PR_REVIEW_CHECKLIST.md template correctly, including the phrase As a PR reviewer and CODEOWNER, I have reviewed this and have.

For PR verification, add the full-sweep-fail-fast label (strongly recommended) to this PR — the benchmark sweep only runs on labeled PRs. Use full-sweep-enabled only if you need matrix jobs to keep running past a failure.

PR authors are responsible for ensuring that after merging, all GitHub Action jobs fully pass. A lot of the time, failures are just flakes and simply re-running the failed jobs will fix it. See GitHub's docs on re-running failed jobs


感谢你的贡献!请联系相应公司的 CODEOWNER 填写最新的 PR_REVIEW_CHECKLIST.md,然后再在 Slack 上联系核心维护者进行审阅。为了触发 signoff PR 检查机器人,你必须正确遵循 PR_REVIEW_CHECKLIST.md 模板,包括保留英文语句 As a PR reviewer and CODEOWNER, I have reviewed this and have

如需进行 PR 验证,请为此 PR 添加 full-sweep-fail-fast 标签(强烈推荐)— 基准测试 sweep 仅在带有标签的 PR 上运行。仅当需要矩阵任务在失败后继续运行时才使用 full-sweep-enabled

PR 作者有责任确保合并后所有 GitHub Action 任务完全通过。 很多时候失败只是偶发抖动(flake),重新运行失败的任务即可解决。参见 GitHub 关于重新运行失败任务的文档

@seungrokj seungrokj changed the title [AMD] dsv4-fp4-mi355x-atom-mtp: latest atom-dev image + align official MTP recipe / DSv4-Pro FP4 MI355X ATOM MTP:升级最新 atom-dev 镜像 + 对齐官方 MTP 配方 [AMD][AgentX] Add DeepSeek-V4-Pro FP4 MI355X ATOM + MTP agentic-coding recipe Jul 27, 2026
@seungrokj seungrokj changed the title [AMD][AgentX] Add DeepSeek-V4-Pro FP4 MI355X ATOM + MTP agentic-coding recipe [AMD] Add DeepSeek-V4-Pro FP4 MI355X ATOM + MTP Jul 27, 2026
@seungrokj seungrokj changed the title [AMD] Add DeepSeek-V4-Pro FP4 MI355X ATOM + MTP [AMD] dsv4-fp4-mi355x-atom: latest atom-dev image + opt recipe / DSv4-Pro FP4 MI355X ATOM:升级最新 atom-dev 镜像 + 优化配方 + MTP Jul 27, 2026

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Deferring — the reported bug (dropping --dsv4 for --use-chat-template) is a real, verified regression: benchmark_serving.py still gates the DeepSeek-V4 chat encoder behind a separate, live --dsv4 flag, and every sibling DSv4-Pro MTP script still passes --dsv4 for this exact model/tokenizer. This isn't a nit — it risks either crashing the sweep or silently corrupting the MTP acceptance-length numbers the recipe exists to produce, so it should be fixed before merge.

Extended reasoning...

See inline finding for details; verified independently that utils/bench_serving/benchmark_serving.py defines --dsv4 as a distinct argparse flag from --use-chat-template, and _apply_chat_template only routes through the DeepSeek-V4 encoder when dsv4=True.

Comment on lines 90 to 96
--result-filename "$RESULT_FILENAME" \
--result-dir /workspace/ \
--trust-remote-code \
--dsv4
--use-chat-template

# After throughput, run evaluation only if RUN_EVAL is true
if [ "${RUN_EVAL}" = "true" ]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔴 Dropping --dsv4 in favor of plain --use-chat-template breaks the bench client: utils/bench_serving/benchmark_serving.py still has a live --dsv4 flag, and _apply_chat_template() only calls the DeepSeek-V4 encoder when dsv4=True — with the new invocation it falls through to tokenizer.apply_chat_template(), which reads a jinja template from tokenizer_config.json, not the model-dir Python encoder the PR description cites. Every sibling DSv4 MTP script (vllm/sglang/mi300x/mi325x variants) still passes --dsv4 and documents that the DSv4-Pro tokenizer has no jinja chat_template, so this will either crash the benchmark or silently misalign MTP acceptance-length measurements. Please restore --dsv4 (or confirm DSv4-Pro's tokenizer now ships a matching jinja template before merging).

Extended reasoning...

The bug: this PR replaces --dsv4 with plain --use-chat-template on the run_benchmark_serving call (line 96), on the premise that ATOM now auto-discovers a DeepSeek-V4 chat encoder from the model directory on both the server and the bench client, so the explicit flag is no longer needed. That premise doesn't hold for the client this script actually invokes.

The code path: utils/bench_serving/benchmark_serving.py still defines a live --dsv4 argparse flag (in the "DeepSeek-V4 chat template options" group, around line 1242), directly contradicting the PR description's claim that --dsv4 was "removed upstream." More importantly, _apply_chat_template(prompt, tokenizer, dsv4) (around line 161) only routes through dsv4_encode_messages — the local encoding_dsv4.py module imported at the top of the file — when dsv4=True. With the new invocation (--use-chat-template set, --dsv4 omitted), dsv4 is False, so the function falls through to tokenizer.apply_chat_template(...), i.e. whatever jinja chat_template is (or isn't) embedded in the tokenizer's tokenizer_config.json.

Why nothing else prevents this: there is no model-dir encoder auto-discovery anywhere in benchmark_serving.py. The PR's rationale conflates ATOM's server-side trust-remote-code-style auto-discovery of encoding/encoding_*.py with this independent, HF-tokenizer-based bench client, which has no equivalent mechanism — it only knows about the hardcoded local encoding_dsv4 module, gated by the --dsv4 flag. The comment this PR deleted made this explicit: "The DSv4-Pro tokenizer ships without a jinja chat_template, so plain --use-chat-template would crash." Every other DSv4-Pro MTP script still in the repo — dsv4_fp4_mi355x_vllm_mtp.sh, dsv4_fp8_mi300x_mtp.sh, dsv4_fp8_mi325x_mtp.sh, dsv4_fp4_mi355x_sglang_mtp.sh — still passes --dsv4 for the exact same model/tokenizer, and benchmarks/multi_node/amd_utils/bench.sh explicitly branches on model name (DeepSeek-V4-Pro -> --dsv4, everything else -> --use-chat-template) in the same ATOM framework context.

Impact: after merge, this recipe's benchmark client either (a) crashes when tokenizer.apply_chat_template() raises because the DSv4-Pro tokenizer has no jinja chat_template — failing the sweep — or (b) if some jinja template does exist, silently uses different chat framing than the encoding_dsv4 <bos><User>...<Assistant><think> format the server/model expects, corrupting the acceptance-length (AL) measurements this MTP sweep exists to produce. This is the exact MTP regression class AGENTS.md warns about: EAGLE/MTP acceptance numbers silently going wrong when prompt framing doesn't match server expectations.

Step-by-step proof:

  1. run_benchmark_serving (line 90-96) is called with --use-chat-template but no --dsv4.
  2. benchmark_lib.sh's run_benchmark_serving wrapper passes these straight through as CLI args to benchmark_serving.py, so argparse sets args.use_chat_template = True, args.dsv4 = False (default).
  3. Somewhere in prompt generation (sample_random_requests), _apply_chat_template(prompt, tokenizer, dsv4=False) is called because use_chat_template is set.
  4. Inside _apply_chat_template, the if dsv4: branch is skipped, so it executes tokenizer.apply_chat_template([{...}], add_generation_prompt=True, tokenize=False).
  5. Per the repo's own uniform documentation (repeated in every sibling DSv4-Pro script), the DSv4-Pro tokenizer ships without a jinja chat_template — so this call raises, and the benchmark throughput run fails outright. If it somehow doesn't raise, the resulting prompt text differs from what encoding_dsv4.encode_messages would have produced, so the server (which expects the DSv4 framing) sees off-distribution prompts, and MTP draft-acceptance statistics collected are meaningless.

Fix: restore --dsv4 alongside --use-chat-template in the run_benchmark_serving call, matching every other DSv4-Pro MTP script, unless the author can show the DSv4-Pro tokenizer now ships a jinja chat_template that reproduces the same framing as encoding_dsv4.

@github-actions

Copy link
Copy Markdown
Contributor

2 similar comments
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

…encoding_dsv4.py; DSv4-Pro has no jinja template so plain --use-chat-template yields no result)
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@zufayu

zufayu commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator Author

Hi @seungrokj — could you review this PR and post the filled-in PR_REVIEW_CHECKLIST? You're the original atom-mtp author + CODEOWNER, so you know it best.

It updates dsv4-fp4-mi355x-atom-mtp to the latest atom-dev image and aligns your ATOM official MTP config (models.json: MTP3 + DPA MTP3, no TBO). Full sweep is green incl. evals:

This is the fixed-seq-len (8k/1k) variant — complementary to your #2346 agentic-mtp (different config keys, no overlap). bench uses --dsv4 for chat-formatted MTP inputs (AL alignment).

Thanks!

@seungrokj

Copy link
Copy Markdown
Collaborator

/reuse-sweep-run

@seungrokj seungrokj added the AMD label Jul 27, 2026

@seungrokj seungrokj left a comment

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.

As a PR reviewer and CODEOWNER, I have reviewed this and have:

  • Verified that as of the moment of typing this, this is the latest version of PR_REVIEW_CHECKLIST.md
  • Verified that the general code quality meets the InferenceX standard and does not make the code quality any worse.
  • Verified that this PR has passed PR validation. Please link to GitHub Action workflow that shows this.
  • Verified that this PR passes evals. Please link to GitHub Action workflow that shows this.
  • Verified that speculative decoding PRs uses chat templates to align the AL distribution to real world
  • For agentic workloads: verified that speculative-decoding configs (EAGLE / MTP / draft models) run with simulated synthetic acceptance, with the acceptance-length value taken from the committed golden AL curve in golden_al_distribution/ for that model, thinking mode, and draft length. A submission may choose any supported draft length, but it may not substitute a different acceptance target.
  • Verified that the model architecture isn't changed with benchmark hacks like using --hf-overrides to skipping indexer for every x layers on models that don't natively support this. As a general rule, we won't accept optimizations that reduces the number of model architecture FLOPs. Anything that makes that same computation run faster is fair game; FLOPs at lower precisions is fine, given that the config passes private evals. As an general north star princple, we should only use optimizations which is used in production by customers that care about accuracy
  • If an company claims that they support vLLM/SGLang as first class LLM inference engines on their hardware, I have verified that the respective vLLM submission made using upstream https://hub.docker.com/u/vllm docker repo, upstream SGLang https://hub.docker.com/u/lmsysorg docker repo. The only exceptions are for new hardware, such as MI455X UALoE72, Vera Rubin NVL72, Rubin NVL8, etc., and for new model architectures where there is an actual reason why vLLM/SGLang does not fundamentally support them yet as supported by vLLM/SGLang community maintainers
  • If an company claims that they support vLLM/SGLang as first class upstream in-tree LLM inference engines on their hardware, I have have verified that the respective vLLM/SGLang submission has been made before additional frameworks (TRT-LLM, ATOM, etc.). The only exceptions are for new hardware, such as MI455X UALoE72, Vera Rubin NVL72, Rubin NVL8, etc., and for new model architectures where there is an actual reason why vLLM/SGLang does not fundamentally support them yet.
  • Verified that every single-node vLLM/SGLang recipe in this PR is documented in the official vLLM recipes and/or the SGLang cookbook:
    • I linked the corresponding upstream PR in the vLLM recipe repo or SGLang repo and verified that it is MERGED before this InferenceX PR merges. An opened, draft, or closed-without-merge upstream PR does not satisfy this requirement. If the matching recipe was already published, I linked the published recipe/cookbook page in the additional detail section below.
  • Verified that this PR does not patch the inference engine or serving stack — the pinned image must run as shipped. This covers .patch files / git apply / patch, inline patches embedded in benchmark scripts (e.g. a python3/sed heredoc that rewrites installed engine sources before serving), in-place edits of site-packages, monkey-patching, overwriting container files, and installing forked/rebuilt engine wheels on top of the pinned image. The only exception is a patch covered by a filled-out waiver at docs/waiver/<PR_NUMBER>.md — named after the PR that introduces the patch and filed in that same PR, stating what is patched, why the unmodified upstream image cannot run this benchmark, the upstream PR/issue link, and the removal plan — which I have linked below in the additional detail section.
  • If any of the above criteria cannot reasonably be satisfied, I have provided additional reasoning below.

Additional detail section:

Signed: seungrokj

@Klaud-Cold

Copy link
Copy Markdown
Collaborator

✅✅✅ Verdict: PASS ✅✅✅

✅ Check 0 (CODEOWNER): PASS — seungrokj is a listed owner of configs/amd-master.yaml; the other changed files are catch-all-owned, covered by any recognized CODEOWNER.
✅ Check 1 (sweep on in-PR commit): PASS — in-PR commit 3a73a41 has green executed single-node 8k1k / and eval / check-runs: https://github.com/SemiAnalysisAI/InferenceX/actions/runs/30238071409
✅ Check 2 (evals pass): PASS — GSM8K em_strict 0.962–0.970 (n=1319) across all 4 eval lanes of that run, executed on this PR's exact image rocm/atom-dev:nightly_202607231538 (above the ~0.95 DSv4-Pro bar).
➖ Check 3 (recipe linked & merged): N/A — ATOM (non-vLLM/SGLang) single-node submission; the upstream recipe-link requirement in docs/PR_REVIEW_CHECKLIST.md covers vLLM/SGLang recipes only. Sign-off nonetheless links ATOM's published recipe (https://github.com/ROCm/ATOM/blob/main/recipes/DeepSeek-V4.md), whose major args (DeepSeek-V4-Pro, TP8, fp8 KV cache, --method mtp --num-speculative-tokens 3, --enable-dp-attention) match this PR.
✅ Check 4 (reuse command): PASS — /reuse-sweep-run posted by seungrokj (COLLABORATOR).
✅ Check 5 (latest checklist): PASS — every item of the current template is present and checked.
✅ Check 6 (upstream images / engine-first): PASS — changed entry is framework: atom, so the vLLM/SGLang upstream-image rule does not apply to it; engine-first ordering satisfied by existing dsv4-fp4-mi355x-vllm(-mtp) and dsv4-fp4-mi355x-sglang(-mtp) entries.
✅ Check 7 (no architecture hacks): PASS — no --hf-overrides/model-config edits; changes are --max-num-seqs, --no-enable_prefix_caching, and MTP flags (no FLOPs removed).
✅ Check 8 (spec-decode chat template): PASS — bench passes --dsv4, which implies --use-chat-template (benchmark_lib.sh) and formats prompts through the DeepSeek-V4 chat encoder (encoding_dsv4.py).
✅ Check 9 (no engine patches): PASS — no .patch/heredoc/sed rewrites or engine wheel installs; only documented runtime env knobs (ATOM_DISABLE_MMAP, AITER_BF16_FP8_MOE_BOUND, ATOM_MOE_GU_ITLV).
➖ Check 10 (agentic golden AL): N/A — fixed_seq_len (non-agentic) config; no simulated/synthetic-acceptance knobs present, real acceptance measured through the chat template per Check 8.

@seungrokj

Copy link
Copy Markdown
Collaborator

@functionstackx @Oseltamivir can you plz approve this ?

…2327)

- grid: DPA MTP3 conc-start 64->32 (dp-attn helps from c32)
- recipe: --enable-tbo (prefill-only; argparse const=prefill => enable_tbo_decode=False)
  on dp-attn cells at conc>=64 + GPU_MAX_HW_QUEUES=5, mirrors non-MTP #2327.
  MTP-safe: only decode-TBO (--enable-tbo all) drops spec_decode_metadata.
- changelog updated (triggers re-sweep)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

TBO run 30257759947 vs non-TBO 30238071409 (same image/harness/axis):
 c64  -14.1% / c128  -9.8% output tput (TBO hurts)
 c256 +11.0% / c512 +8.3% / c1024 +13.9% (TBO helps)
MTP already removes low-conc latency, so prefill-TBO overlap at c64/c128 is
pure overhead; win only appears once high conc turns compute-bound. Matches
ATOM models.json non-MTP DPA-TBO 256-2048 band.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolve perf-changelog.yaml conflict: keep both #2345 (dsv4-atom-mtp) and
#2336 (minimaxm3-vllm) entries. Needed for run-sweep to trigger (CONFLICTING
PRs don't fire pull_request events).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mirrors non-MTP #2327 tp4 grid. Fewer TP ranks -> less TP comm overhead may
win at low conc (c16-128); tp4 dp-on is the point of interest, tp4 dp-off is
the intra-tp4 control. No TBO (all tp4 cells conc<256). Compare vs tp8 at same
conc for the tp4-vs-tp8 low-conc crossover.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

tp4 gives 806G/4=201G/GPU weight, leaving negative KV budget even at
gpu-mem-util 0.90 (run 30277221626 tp4 dp-on c64/c128 failed at engine init).
#2327 tp4 works only because non-MTP (no draft KV). MTP stays tp8.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants