Skip to content

refactor(amd): share one fixed-sequence client across multi-node recipes - #3413

Merged
cquil11 merged 7 commits into
mainfrom
agent/srt-multinode-fixed-seq-client
Sep 25, 2026
Merged

cquil11 merged 7 commits into
mainfrom
agent/srt-multinode-fixed-seq-client

Conversation

@cquil11

@cquil11 cquil11 commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #2542.

Adds benchmarks/multi_node/srt_fixed_sequence.sh, the standard InferenceX fixed-sequence client for multi-node srt-slurm recipes (the multi-node counterpart of benchmarks/single_node/srt_fixed_sequence.sh), and moves the four MI355X recipes onto it. It is meant to replace srt-slurm's sa-bench; the NVIDIA recipes move in the next PR in this stack.

Client behavior (defaults are the repo standard):

  • Concurrencies come from the matrix CONC_LIST; results go to /logs/sa-bench_isl_<ISL>_osl_<OSL>/results_concurrency_<c>_gpus_<g>_ctx_<p>_gen_<d>.json, the layout copy_fixed_sequence_results already collects.
  • Random range ratio RANDOM_RANGE_RATIO (0.8), chat template on (USE_CHAT_TEMPLATE=false opts out), --trust-remote-code, 10x prompts and 2x warmup per concurrency, request rate inf.
  • CLIENT_BACKEND selects openai (/v1/completions, default) or openai-chat (/v1/chat/completions).
  • The client requests the model name the frontend serves (/v1/models), so it always matches what the workers registered; the workflow's MODEL is the HF id and can differ. Recipes set ISL, OSL, and TOKENIZER when the served name is not a loadable tokenizer.
  • Power: srt-slurm samples GPU power for the whole job and needs each point's measured interval. When it exports SRT_MEASUREMENT_WINDOW_DIR, the script calls infx.results.power.window, which writes that interval (from the client's benchmark_start_time_unix / benchmark_end_time_unix) as a benchmark_type: custom window. Power lanes already set benchmark.concurrencies from the matrix, which is what srt-slurm uses for the expected windows.

MI355X recipes now use the standard client settings: range ratio 0.8 instead of 1.0, the chat template on every variant (previously MTP only), and completions for Qwen3.5 as the legacy AMD client used.

Validation: all 18 DeepSeek-R1 variants resolve through srtctl to the script; a stubbed run writes the expected results and windows and srt-slurm's window parser accepts them. No GPU run yet.

@cquil11
cquil11 requested a review from a team as a code owner September 24, 2026 21:17
@cquil11
cquil11 added this pull request to stack #3414 September 24, 2026 21:17
@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 任务通过。临时性失败通常可以通过重新运行恢复;参见重新运行失败任务的说明。

@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 +15 to +24
esac
done
case "${CLIENT_BACKEND:=openai}" in
openai) endpoint=/v1/completions ;;
openai-chat) endpoint=/v1/chat/completions ;;
*) echo "ERROR: unsupported CLIENT_BACKEND: $CLIENT_BACKEND" >&2; exit 1 ;;
esac
case "${USE_CHAT_TEMPLATE:=false}" in
true) CLIENT_ARGS+=(--use-chat-template) ;;
false) ;;

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) Violates the repo's mandatory Bash rule (AGENTS.md:29-30): no ${VAR:-default}/${VAR:=default}, and every required input must go through check_env_vars. The new shared script uses ${CLIENT_BACKEND:=openai} (line 15), ${USE_CHAT_TEMPLATE:=false} (line 19), ${TOKENIZER:-$MODEL} (line 40), and ${RANDOM_RANGE_RATIO:-1.0} (line 44), none of which are passed to check_env_vars (only MODEL, ISL, OSL, SRT_FRONTEND_HOST, SRT_FRONTEND_PORT, CONC_LIST, PREFILL_NUM_WORKERS, PREFILL_TP, DECODE_NUM_WORKERS, DECODE_TP are). Fix: pass CLIENT_BACKEND, USE_CHAT_TEMPLATE, TOKENIZER, and RANDOM_RANGE_RATIO through check_env_vars and require every recipe's env block to set them explicitly instead of relying on silent bash defaults, matching every other required input in this script.

Why this was flagged

Any recipe or future caller that omits CLIENT_BACKEND, USE_CHAT_TEMPLATE, TOKENIZER, or RANDOM_RANGE_RATIO in its benchmark.env silently gets openai/false/$MODEL/1.0 instead of failing fast at benchmarks/multi_node/srt_fixed_sequence.sh:15,19,40,44. On the base branch each recipe hardcoded these values inline so there was no way to omit them; after this refactor a typo'd or missing env var (e.g. a future MTP recipe forgetting USE_CHAT_TEMPLATE) produces a benchmark run with the wrong chat-template/backend/tokenizer settings that looks successful but silently reports incorrect data, rather than the clear caller error check_env_vars is supposed to guarantee per AGENTS.md:30.

Verification: nit. The candidate correctly identifies a real, present violation of the repo's mandatory Bash conventions (AGENTS.md:29 "No fallback defaults for caller-supplied configuration. Avoid ${VAR:-default}, ${VAR:=default}... Pass values such as false and 0 explicitly too." and AGENTS.md:30 "Validate every required environment input with check_env_vars before use."). The new… | nit. The candidate's…

--result-dir "${result_dir}" \
--result-filename "results_concurrency_${concurrency}_gpus_$((ctx + gen))_ctx_${ctx}_gen_${gen}.json"
done
command: bash /infmax-workspace/benchmarks/multi_node/srt_fixed_sequence.sh --trust-remote-code

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) This PR modifies 4 srt-slurm recipes (fp4/fp8 dsr1, qwen3.5 fp8/mxfp4) without adding a perf-changelog.yaml entry, so operators lose automatic CI perf-sweep validation that AGENTS.md:124 requires. AGENTS.md states 'every recipe addition or modification requires a new perf-changelog.yaml entry', and docs/architecture.md:119 says infx.matrix.plan selects sweep keys only from lines added to perf-changelog.yaml between base and head refs. No perf-changelog.yaml change is in this diff, so these four recipe changes will not be auto-selected for the sweep validation gate that would otherwise catch a regression in the new shared script. …

Why this was flagged

…Fix: append a perf-changelog.yaml entry (respecting its append-only, byte-sensitive format) listing the config-keys for these four recipes so the refactor gets swept and validated like any other recipe modification.

The diff modifies benchmark.command in benchmarks/multi_node/srt-slurm-recipes/sglang/dsr1/mi355x/fp4-disagg-fixed-seq.yaml:160, fp8-disagg-fixed-seq.yaml, disagg-1p1d-tp4p-tp8d-fixed-seq.yaml, and disagg-1p1d-tp8-mxfp4-fixed-seq.yaml. AGENTS.md:124 ('Non-negotiable benchmark invariants') requires a new perf-changelog.yaml entry for every recipe addition or modification; none is included in this commit (git diff --stat shows no perf-changelog.yaml change). docs/architecture.md:119 states the main sweep path (infx.matrix.plan) reads only entries ADDED to perf-changelog.yaml between base and head to select which config keys get swept/validated. Without an added entry, these four recipes are not automatically re-validated by that CI gate after this refactor, unlike recipe changes that follow the documented process.

Verification: nit (mandatory-invariant compliance gap, no runtime break). The diff modifies benchmark.command/env in all four recipes (e.g. fp4-disagg-fixed-seq.yaml the inline command: | block becomes command: bash /infmax-workspace/benchmarks/multi_node/srt_fixed_sequence.sh --trust-remote-code, plus USE_CHAT_TEMPLATE '1'->'true' etc.), and git diff --stat 41e8bfc..HEAD shows only the 4 YAMLs and… | nit.…

@cquil11
cquil11 removed this pull request from stack #3414 September 25, 2026 05:44
Base automatically changed from agent/srt-slurm-amd-integration to main September 25, 2026 05:44
The four MI355X multi-node recipes each inlined the same benchmark loop.
Move it to benchmarks/multi_node/srt_fixed_sequence.sh, like the single-node
client; recipes set only the model, tokenizer, client backend and chat
template in benchmark.env.
Default the multi-node client to the repo standard: range ratio 0.8, chat
template on, --trust-remote-code, 10x prompts and 2x warmup at request rate
inf. Keep the client backend configurable. When srt-slurm exports
SRT_MEASUREMENT_WINDOW_DIR, write each concurrency's measured boundary as a
custom-benchmark window so power lanes validate without sa-bench.
Replace the inline Python in srt_fixed_sequence.sh with
infx.results.power.window, which writes srt-slurm's custom-benchmark
measurement window from the client's result.
Recipes hardcoded MODEL, but the served name depends on the cluster's
model path and can differ from both the recipe and the workflow's HF id
(Dynamo TRT-LLM served DeepSeek-R1-0528 while the recipe said dsr1, so
every request got 404). Read it from /v1/models instead.
@cquil11
cquil11 force-pushed the agent/srt-multinode-fixed-seq-client branch from 0f03491 to 1898327 Compare September 25, 2026 05:44
@cquil11
cquil11 merged commit dd4904b into main Sep 25, 2026
2 of 3 checks passed
@cquil11
cquil11 deleted the agent/srt-multinode-fixed-seq-client branch September 25, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant