Skip to content

Add accelerator-proportional worker memory infrastructure - #4754

Merged
cquil11 merged 8 commits into
mainfrom
fix/automatic-worker-dram-share
Nov 24, 2026
Merged

cquil11 merged 8 commits into
mainfrom
fix/automatic-worker-dram-share

Conversation

@cquil11

@cquil11 cquil11 commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Allocates inference-worker DRAM by GPU share: 4 of 8 GPUs gets half the node’s available DRAM.

Master YAML supplies worker counts and gpus-per-worker; the adapter copies them into SRT roles. Existing recipe node reservations and SRT scheduling remain unchanged. Each worker step receives available MiB × step GPUs / physical GPUs per node, rounded down. MPI ranks in one step share its cap; clients, routers and telemetry retain their existing limits.

Supports multinode and colocated workers. Uses the existing SRT pin; no SRT changes are required. The scheduler reads node reservations from recipes, so the duplicate master num-nodes field is removed.

Stack: remove old DRAM logic #4766 → this infrastructure PR → config migration #4763. Land all three together; the new schema requires the config migration. Full-node workers share the job budget with helpers; no separate helper headroom is reserved.

Earlier live runs covered seven 10-minute AgentX profiles and three deliberate worker-OOM tests. These predate the master-resource redesign. GB200 enforcement is blocked by ConstrainRAMSpace=no.

Validation runs

AgentX profiles had zero request errors. B200 multi-node had 19 drain-deadline cancellations. Worker caps were sampled on the host and inside containers; helper limits were checked separately.

Hardware and topology Actual result Enforced worker cap, MiB Evidence
MI355X: 4/8 GPUs 601.39s; 110 successful 1,539,698 Memory · Profile · AgentX · Server · Telemetry
B200: 4/8 GPUs 600.00s; 105 successful; 0 cancelled 1,023,768 Memory · Profile · AgentX · Server · Telemetry
B200: colocated prefill 4 + decode 4 602.38s; 409 successful; 0 cancelled 1,023,768 per worker Memory · Profile · AgentX · Server · Telemetry
B200: two nodes, prefill 8 + decode 8 630.00s; 1,393 successful; 19 in-flight cancellations at the 30s drain deadline 2,047,536 per node Memory · Profile · AgentX · Server · Telemetry
GB300: two nodes, SGLang TP8 across 2 × 4 GPUs 602.55s; 265 successful 920,000 per node Memory · Profile · AgentX · Server · Telemetry
GB300: colocated TRT prefill TP1 + decode TP2 615.73s; 1,325 successful 230,000 prefill; 460,000 shared by both decode MPI ranks Memory · Profile · AgentX · Server · Telemetry
B300: 4/8 GPUs 600.00s; 93 successful; 0 cancelled 1,988,096 Memory · Profile · AgentX · Server · Telemetry

Deliberate pressure caused worker-cgroup OOMs on MI355X, B200 and GB300 while helpers remained alive. These runs ended with expected failures.

Hardware Worker cap, MiB Observed isolation Evidence
MI355X: 1/8 GPUs 384,924 Worker OOM at 17:06:30 UTC; 14 nonempty HTTP 200 telemetry scrapes afterward, through 17:06:43, before helper cleanup. Memory/events · Pressure/server · Telemetry
B200: 1/8 GPUs 255,942 Worker OOM at 16:58:39 UTC; DCGM and AIPerf remained alive through 16:58:48; parent/helper local OOM counters stayed zero. Memory/events · Pressure/server · Telemetry
GB300: 1/4 GPUs 230,000 Worker OOM at 17:31:35 UTC; three exporter helpers remained alive; 9 nonempty HTTP 200 samples continued through 17:31:44, before cleanup. Memory/events · Pressure/server · Telemetry

B200 profiles and OOM tests used a05681b24; other profiles used 6bf81a8c5. Both precede the master-resource redesign. Pressure-probe and observer instrumentation.

Live cluster memory smoke — 2026-11-03

All ten configured budgets fit min(RealMemory − MemSpecLimit, floor(MemTotal / 1024) − 16384) MiB. Slurm records were checked across all 130 nodes; physical RAM was read on 77 nodes, including a short Slurm task on each cluster where direct SSH was unavailable. This checks the budget inputs, not container enforcement.

Cluster Configured MiB Calculated MiB Physical nodes checked
h100-cw 1,998,848 1,998,848 1/2
h100-dsxe 1,915,904 1,915,904 1/3
h200-dgxc 1,471,356 1,471,356 14/14
b200-nscale 2,047,536 2,047,536 11/11
b300-dsxe 3,976,192 3,976,192 1/18
gb200-nv 860,160 860,160 1/18
gb300-nv 920,000 920,000 36/36
mi300x-amd 1,531,436 1,531,438 1/9
mi325x-amd 2,305,165 2,305,167 1/9
mi355x-amds 3,079,397 3,079,398 10/10

AMD budgets are 1–2 MiB below the current physical samples; no values needed changing. Calculated values use all-node Slurm records and the physical samples shown.

Earlier attempts excluded from successful OOM evidence

@github-actions

github-actions Bot commented Nov 3, 2026

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 run only when the PR appends an inferencex-e2e/perf-changelog.yaml entry and carries exactly one primary label: full-sweep-fail-fast (strongly recommended; canary plus per-matrix fail-fast), full-sweep-enabled (canary; matrix jobs continue after a failure), or non-canary-full-sweep-enabled (no canary or fail-fast). The modifiers all-evals, evals-only, and agentx-fast require a primary label. On fork PRs, a maintainer applies the label. See sweep labels and reuse.
  • 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 在 inferencex-e2e/perf-changelog.yaml 末尾追加了条目,并且恰好带有一个主标签时,才会运行扫描:full-sweep-fail-fast(强烈推荐;canary 加逐矩阵 fail-fast)、full-sweep-enabled(有 canary;矩阵任务在失败后继续运行)或 non-canary-full-sweep-enabled(无 canary,也无 fail-fast)。修饰标签 all-evals、evals-only 和 agentx-fast 必须与主标签一起使用。fork PR 的标签由维护者添加。参见扫描标签与复用。
  • **合并后:**PR 作者必须确保所有 GitHub Actions 任务通过。临时性失败通常可以通过重新运行恢复;参见重新运行失败任务的说明。

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

inferencex-e2e/infx diff: +1193 -754

Generally most InferenceX submissions don't need to add changes to the infx package. On the off chance they do, generally the diff is small. Please prompt your agent to clean your PR to keep your diff to only necessary & minimal changes too. We have an increased code quality bar for changes to the infx package.

中文

大多数 InferenceX 提交通常不需要修改 infx 包。即使确实需要,改动通常也很小。请让你的 agent 清理 PR,使改动只包含必要且最小的内容。infx 包的改动有更高的代码质量要求。

@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.

Findings marked 🟡 are optional suggestions and need no follow-up push.

Additional findings (outside the current diff — GitHub can't attach inline comments there):

  • 🔴 inferencex-e2e/benchmarks/single_node/srt-slurm-recipes/minimaxm31flash/vllm/b200-fp4-mtp/agentic.yaml — After this merge, the MiniMax vLLM TP4 DRAM points on b200-nscale get a worker memory cap that their own CPU offload pool fills almost completely, so the workers can be OOM-killed. The new cap is 2_047_536 * 4 // 8 = 1,023,768 MiB. cpu_bytes_to_use is 1073000000000 B (1,023,292 MiB), which leaves about 475 MiB for four TP workers, EngineCore and the API server. Fix: shrink cpu_bytes_to_use on every TP4 b200 point so the pool plus process memory fits under the GPU-share limit with real headroom. Same pattern at 4 sites (vllm/b200-fp4-mtp/agentic.yaml:75, agg-variants.yaml:60, agg-variants.yaml:72, agg-variants.yaml:84).

    Why this was flagged

    The trigger is nvidia-master.yaml:4345-4348, which runs TP4 kv-offloading dram points (conc 32/40/48/56) on cluster:b200-nscale. That cluster lists available-cpu-dram-mib 2_047_536 (runners.yaml:447) and leaves single-node-exclusive at its default True (clusters/slurm.py:191). On the base branch, run_single_node set step_mib=None and job mem 0 for exclusive clusters, so the worker could use the whole node. Now bind_memory (memory.py:68-88) writes roles.agg.srun_options.mem = 1023768M. The recipe pins SimpleCPUOffloadConnector cpu_bytes_to_use 1073000000000 B, sized to the old whole-host budget, as the deleted comment at old line 67-68 says. That pinned pool is charged to the step's memory cgroup, and the four ranks, EngineCore and API server need several GB more, so the step exceeds its limit and is OOM-killed (assuming Slurm enforces --mem with cgroups). The PR description calls OOMs on low-headroom pools a known risk, but nothing checks recipe pool sizes against the new limit. This point fails outright rather than just risking it.

    Verification: On the base, run_single_node set step_mib, job_mib = None, 0 for exclusive nodes, so the TP4 DRAM points on b200-nscale had no cap. Now memory.py:78 computes 2_047_536*4//8 = 1,023,768 MiB and memory.py:90 writes it as srun mem. agentic.yaml:75 keeps "cpu_bytes_to_use":1073000000000 (1,023,292.5 MiB), which leaves about 475 MiB for the workers.

  • 🔴 inferencex-e2e/configs/nvidia-master.yaml — Result collection is never triggered for agentic configs whose matrix and runtime memory limits this PR changes, because no perf-changelog.yaml entry is added. AGENTS.md:87 requires one when a change alters what a benchmark runs. This change drops dram-utilization from many config keys and edits many srt recipes. It also caps every srt worker at its GPU share, where exclusive jobs used to get --mem=0. Fix: append one block to perf-changelog.yaml listing the config keys that python -m infx.matrix.changed --base origin/main reports. [also at: inferencex-e2e/configs/amd-master.yaml:1063 - Every agentic DRAM benchmark now runs under new memory limits, but this PR adds no perf-changelog entry, so result collection is never triggered for the changed points.; inferencex-e2e/infx/srt_slurm/memory.py:94 - This changes what benchmarks run, but the PR adds no perf-changelog.yaml entry, which AGENTS.md requires. Without one, result collection for the affected config keys never runs.]

    Why this was flagged

    The diff edits dram-utilization and the TOTAL_CPU_DRAM_GB additional-settings in amd-master.yaml and nvidia-master.yaml, plus 27 single-node srt recipes. memory.py:539-547 now writes per-role srun_options.mem and an sbatch mem into every bound recipe, including fixed-seq-len ones. The PR description says recipes 'may now OOM', which confirms runtime behaviour changes. AGENTS.md:87 says such a change needs a perf-changelog.yaml entry and that 'the entry triggers result collection'. The diff does not touch inferencex-e2e/perf-changelog.yaml, so no sweep runs to show that the affected agentic points still pass under the new limits. On the base branch these configs had their recorded changelog history and the old uncapped exclusive memory.

    Verification: Trigger: merging this PR without a changelog block. The PR changes the memory every srt agentic and fixed-seq-len worker runs under, but no sweep or result collection is triggered. CONTRIBUTING.md:23 says run-sweep.yml sweeps "run only for same-repository PRs that change inferencex-e2e/perf-changelog.yaml".

Comment thread inferencex-e2e/infx/srt_slurm/memory.py Resolved
@cquil11
cquil11 force-pushed the fix/automatic-worker-dram-share branch 3 times, most recently from 6a6627d to 75d8209 Compare November 3, 2026 20:27
@cquil11
cquil11 added this pull request to stack #4764 November 3, 2026 20:28
@cquil11 cquil11 changed the title Allocate inference worker DRAM by accelerator share Add accelerator-proportional worker memory infrastructure Nov 3, 2026
@cquil11
cquil11 force-pushed the fix/automatic-worker-dram-share branch 2 times, most recently from d90a005 to 9d33656 Compare November 3, 2026 21:41
@cquil11
cquil11 removed this pull request from stack #4764 November 3, 2026 21:43
@cquil11
cquil11 changed the base branch from main to refactor/remove-legacy-cpu-dram November 3, 2026 21:43
@cquil11
cquil11 added this pull request to stack #4767 November 3, 2026 21:43
@cquil11

cquil11 commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author

The B200 MiniMax TP4 pool finding is valid. The config layer now uses 966,000,000,000 bytes instead of 1,073,000,000,000, matching the existing TP8 per-rank pool size and leaving about 100 GiB for other worker allocations. The worker cap remains unchanged; the smaller cache can affect throughput. See config change.

The perf-changelog entry remains omitted as explicitly requested.

@cquil11
cquil11 force-pushed the fix/automatic-worker-dram-share branch from aaabaa8 to 3f78c73 Compare November 24, 2026 15:27
@cquil11
cquil11 force-pushed the fix/automatic-worker-dram-share branch 2 times, most recently from d8284fc to 7dbcf94 Compare November 24, 2026 16:40
Base automatically changed from refactor/remove-legacy-cpu-dram to main November 24, 2026 16:45
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