Skip to content

fix(amd): enable DSpark speculative decoding for DeepSeek-V4-Pro-0813 MI355X disaggregated AgentX - #3191

Closed
ichbinblau wants to merge 6 commits into
mainfrom
amd/agent-v1.0-th-dspark3
Closed

ichbinblau wants to merge 6 commits into
mainfrom
amd/agent-v1.0-th-dspark3

Conversation

@ichbinblau

@ichbinblau ichbinblau commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Wire up DSpark (SPEC_DECODING=draft_model) speculative decoding for DeepSeek-V4-Pro-0813 on the MI355X disaggregated AgentX recipe (dsv4-fp4-mi355x-sglang-disagg-agentic-hicache-mtp): new dspark_flags in models.yaml, --speculative-dspark-block-size/--speculative-num-steps 1 wiring in server_sglang.sh, and a fail-fast guard when a model has no dspark_flags configured for SPEC_DECODING=draft_model.
  • Use checkpoint-specific Pro-0813 golden acceptance-length curves (both the DSpark block-gamma curve and the EAGLE/MTP curve) instead of falling back to the original DeepSeek-V4 curve.
  • Bump the MI355X image to lmsysorg/sglang-rocm:v0.5.19-rocm720-mi35x-20260913 and rerun the disaggregated MTP sweep with DeepSeek-V4-Pro-0813 + DSpark, aligning configs/amd-master.yaml with the internal sweep.
  • Forward AIPERF_EXPERIMENTAL_FAST/REQUIRE_POWER across container boundaries via INFERENCEX_RUNTIME_ENV_VARS (cherry-picked from fix(amd): restore native MTP checkpoint and collect all node logs #3170) so workflow-owned AgentX fast-mode and power requirements reach the client container.

Follow-up to #2823.

中文
  • 为 MI355X 分离式 AgentX 配方(dsv4-fp4-mi355x-sglang-disagg-agentic-hicache-mtp)上的 DeepSeek-V4-Pro-0813 接入 DSpark(SPEC_DECODING=draft_model)推测解码:models.yaml 新增 dspark_flagsserver_sglang.sh 接入 --speculative-dspark-block-size/--speculative-num-steps 1,并在模型缺少 dspark_flags 时快速失败。
  • 使用 Pro-0813 检查点专属的黄金接受率曲线(DSpark block-gamma 曲线与 EAGLE/MTP 曲线),不再回退到原始 DeepSeek-V4 曲线。
  • 将 MI355X 镜像升级到 lmsysorg/sglang-rocm:v0.5.19-rocm720-mi35x-20260913,使用 DeepSeek-V4-Pro-0813 + DSpark 重跑分离式 MTP 扫描,并使 configs/amd-master.yaml 与内部扫描保持一致。
  • 通过 INFERENCEX_RUNTIME_ENV_VARS 跨容器转发 AIPERF_EXPERIMENTAL_FAST/REQUIRE_POWER(从 fix(amd): restore native MTP checkpoint and collect all node logs #3170 cherry-pick),使工作流所有的 AgentX 快速模式与功耗要求能到达客户端容器。

cquil11 and others added 5 commits September 16, 2026 14:20
Signed-off-by: Theresa Shan <theresa.shan@amd.com>
Signed-off-by: Theresa Shan <theresa.shan@amd.com>
Signed-off-by: Theresa Shan <theresa.shan@amd.com>
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the contribution!

  • Review: If this PR changes files owned by someone other than a repository admin or @SemiAnalysisAI/core, ask one eligible CODEOWNER to complete the latest PR_REVIEW_CHECKLIST.md before contacting a core maintainer on Slack. Follow the template exactly, including As a PR reviewer and CODEOWNER, I have reviewed this and have, so sign-off verification triggers.
  • PR verification: Sweeps only run on labeled PRs. Add full-sweep-fail-fast (strongly recommended); use full-sweep-enabled only when matrix jobs should continue after a failure.
  • After merging: PR authors must ensure all GitHub Actions jobs pass. Transient failures often pass on rerun; see how to rerun failed jobs.
中文

感谢你的贡献!

  • **审阅:**如果 PR 修改的文件归属于仓库管理员及 @SemiAnalysisAI/core 之外的 CODEOWNER,请先联系一位有资格的 CODEOWNER 填写最新的 PR_REVIEW_CHECKLIST.md,再通过 Slack 联系核心维护者。必须严格遵循模板,并保留 As a PR reviewer and CODEOWNER, I have reviewed this and have,才能触发签核验证。
  • **PR 验证:**扫描仅在带有标签的 PR 上运行。强烈建议添加 full-sweep-fail-fast;仅当需要矩阵任务在失败后继续运行时才使用 full-sweep-enabled
  • **合并后:**PR 作者必须确保所有 GitHub Actions 任务通过。临时性失败通常可以通过重新运行恢复;参见重新运行失败任务的说明

Correct the pr-link picked up from the cherry-picked #3170 entry now
that this DeepSeek-V4-Pro-0813 DSpark change has its own PR.

Signed-off-by: Theresa Shan <theresa.shan@amd.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@ichbinblau ichbinblau added AMD agentx AgentX benchmarks, recipes, and infrastructure full-sweep-enabled labels Sep 16, 2026
@ichbinblau ichbinblau closed this Sep 16, 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.

Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.

Comment on lines +386 to +389
if [[ "${SPEC_DECODING:-}" == "draft_model" ]]; then
if [[ -z "${MODEL_DSPARK_FLAGS// }" ]]; then
echo "FATAL: SPEC_DECODING=draft_model but model '${model_name}' has no dspark_flags in models.yaml." >&2
exit 1

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.

🟡 (optional) The new fail-fast guard for missing dspark_flags does not actually stop the run: exit 1 at line 389 runs inside build_server_config, which is only ever invoked via command substitution (PREFILL_SERVER_CONFIG=$(build_server_config ...) at line 454). exit there only kills that subshell; with no set -e in this script and no $? check after the assignment, the script prints the FATAL line to stderr but keeps running with PREFILL_SERVER_CONFIG/DECODE_SERVER_CONFIG left empty (the function returns before reaching its final echo "$full_config"), so the server launches with a broken/missing config instead of aborting. Fix: after each build_server_config call, check the exit status (e.g. `PREFILL_SERVER_CONFIG=$(build_server_config ...) …

Extended reasoning...

…|| exit 1`) or have build_server_config return a status the caller checks, so a missing dspark_flags case (or any future error path in this function) actually halts the job for both the prefill and decode invocations at lines 454-455.

build_server_config is called via command substitution at lines 454-455, which bash always runs in a subshell. When SPEC_DECODING=draft_model and MODEL_DSPARK_FLAGS is empty, the function hits exit 1 at line 389 before it ever reaches the trailing echo "$full_config". That exit only terminates the subshell created for the command substitution; the parent server_sglang.sh script has no set -e and never inspects $? right after the assignment, so execution continues. PREFILL_SERVER_CONFIG (and likewise DECODE_SERVER_CONFIG from the second call) end up empty or truncated instead of containing --tp-size/base flags/etc. The script then proceeds to launch the sglang server with this incomplete config, producing a confusing downstream failure (or a badly configured server) instead of the clear early FATAL abort the PR intends for a model without…

Verification: nit. The candidate's mechanism is factually correct. The new fail-fast guard at server_sglang.sh:387-389 does exit 1 inside build_server_config(), but that function is invoked only via command substitution — PREFILL_SERVER_CONFIG=$(build_server_config ...) at line 454 and DECODE_SERVER_CONFIG=$(build_server_config ...) at line 455 — which bash runs in a subshell. The exit 1 therefore… | nit.…

@ichbinblau ichbinblau reopened this Sep 16, 2026
@ichbinblau ichbinblau closed this Sep 16, 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.

Code review found no issues

No high-confidence issues detected in this change.

@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

Labels

agentx AgentX benchmarks, recipes, and infrastructure AMD full-sweep-enabled

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants