Fix Primus Llama-3.1-8B scaleout: NCCL_NET_PLUGIN for v26.4 RCCL overlay etc.#1
Closed
i-kosarev wants to merge 3 commits into
Closed
Conversation
….4 RCCL overlay - benchmark_report.sh: normalize the 8B global batch size to the world size (mirroring the 70B branch) and pass explicit --micro_batch_size/--global_batch_size, so runs at node counts where GBS % (MBS * world_size) != 0 (e.g. 3-node/24-GPU) no longer abort with Megatron's "global batch size not divisible" assertion. - primus_llama-3.1-8b.template.json: set NCCL_NET_PLUGIN=none in both env blocks. rocm/primus:v26.4 defaults NCCL_NET_PLUGIN=librccl-anp.so, which deadlocks RCCL init when the image carries a bundled RCCL overlay. - gotchas.md: document both pitfalls. Validated: Primus 8B scaleout, 3-node/24-GPU MI355X, RCCL develop 86f60f9 + AINIC RoCE, 50 iters, ~1550 TFLOP/s/GPU BF16.
… gate The v26.4 base splits ROCm libs into _rocm_sdk_libraries/lib (runtime) and _rocm_sdk_devel/lib (dev). torch maps librccl.so.1 from _rocm_sdk_libraries at runtime (soname wins once loaded), which the targeted /opt/rocm + torch/lib overwrites did not cover -- so the candidate RCCL was built and shipped but the stock base librccl actually ran, silently invalidating the overlay validation. - stage 2: after the targeted overwrites, sweep every non-symlink librccl.so* on disk and overwrite it with the candidate (+add-needed librocm_smi64), so whichever copy the loader maps is the candidate regardless of ROCm layout. - final gate: assert EVERY librccl on disk (not just 3 fixed paths) is RCCL 2.x with a baked git hash matching the built SHA. This is the injection robustness the RCCL-swap workflow depends on.
3 tasks
…nto _rocm_sdk_devel/bin) v26.4 ships ROCm as pip wheels; the amdclang++ wrapper in _rocm_sdk_devel/bin/ looks for its clang++/clang-23 helpers next to itself, but they live only in _rocm_sdk_devel/lib/llvm/bin/. RCCL's device-code compile calls bin/amdclang++ directly (--offload-device-only) and fails: amdclang++: binary '.../_rocm_sdk_devel/bin/clang++' does not exist. Symlink clang/clang++/clang-23 into bin/ so the wrapper resolves. Guarded to be a no-op on v26.3 / non-wheel bases. Validated: full RCCL build+install exit 0 on rocm/primus:v26.4 (CC/CXX=hipcc alone does NOT fix the device-compile path). Co-authored-by: Cursor <cursoragent@cursor.com>
mkuznet1
added a commit
that referenced
this pull request
Jul 7, 2026
Adapt the fixes from #1 to the current branch. - docker/primus_megatron_train_rccl_overlay.ubuntu.amd.Dockerfile: after the targeted /opt/rocm + torch/lib overwrites, sweep every non-symlink librccl.so* on disk and overwrite it with the candidate (+add-needed librocm_smi64), and tighten the final gate to assert EVERY on-disk librccl (not just 3 fixed paths) is RCCL 2.x with a baked git hash matching the built SHA. v26.4 splits ROCm libs into _rocm_sdk_libraries/lib (runtime) and _rocm_sdk_devel/lib (dev); torch maps librccl.so.1 from _rocm_sdk_libraries at runtime, which the targeted overwrites did not cover, so the stock base librccl silently ran and invalidated the overlay validation. - assets/manifests/primus_llama-3.1-8b.template.json: set NCCL_NET_PLUGIN=none in both env blocks. rocm/primus:v26.4 defaults NCCL_NET_PLUGIN=librccl-anp.so, which deadlocks RCCL init when the image carries a bundled RCCL overlay. - references/gotchas.md: document the NCCL_NET_PLUGIN pitfall, and the GBS normalization requirement (adapted to this branch: the GBS fix from the PR's scripts/primus_scaleout/megatron-lm/primus_megatron-lm_benchmark_report.sh is already generalized here by scaleout_gbs_override in scripts/primus/megatron-lm/primus_megatron-lm_benchmark_report.sh after the primus_scaleout consolidation, so no per-branch code change is ported). Ref: #1
Owner
|
Used in d0fa669 |
mkuznet1
added a commit
that referenced
this pull request
Jul 8, 2026
sglang_disagg_mori_io_ep.sh is a functional superset of server.sh (models.yaml-driven config, mori/mooncake/nixl backends via KV_TRANSFER_BACKEND, DP_MODE support), and run_xPyD_models.slurm already always uses it. run.sh was the only remaining consumer of server.sh, so route both RUN_MORI branches to the unified launcher and drop the duplicate. Also port server.sh's KV_TRANSFER_BACKEND allowlist guard (against eval injection) into mori_io_ep.sh, and update the README and mad-slurm-multinode skill docs accordingly. Addresses PR ROCm#174 review feedback (basemam #1: stale/duplicate server.sh).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes required to run the Primus Llama-3.1-8B scaleout workload (PR ROCm#174
workload-1) on real multi-node AINIC hardware with a swappable RCCL overlay.
All hit during validation on mia1. Two are runtime, one is the overlay-injection
build fix.
Build — RCCL overlay actually takes effect
docker/primus_megatron_train_rccl_overlay.ubuntu.amd.Dockerfile: patch_rocm_sdk_libraries+ global on-disk librccl sweep and gate.v26.4 splits ROCm libs into
_rocm_sdk_libraries/lib(runtime.so) and_rocm_sdk_devel/lib(dev). torch mapslibrccl.so.1from_rocm_sdk_librariesat runtime (soname wins once loaded), which thetargeted
/opt/rocm+torch/liboverwrites did not cover — so thecandidate RCCL was built and shipped but the stock base librccl actually
ran, silently invalidating the whole overlay validation. Stage 2 now sweeps
every non-symlink
librccl.so*on disk and overwrites it with the candidate(+
add-needed librocm_smi64); the final gate asserts every on-disk librccl(not just 3 fixed paths) is RCCL 2.x with a baked git hash matching the built
SHA. This is the injection robustness the RCCL-swap workflow depends on.
Runtime
scripts/primus_scaleout/megatron-lm/primus_megatron-lm_benchmark_report.sh.The 70B branch already normalizes GBS to the world size and passes explicit
--micro_batch_size/--global_batch_size; the 8B branch did neither. At anynode count where
GBS % (MBS * world_size) != 0(3-node/24-GPU:512 % 96 != 0)Megatron aborts at startup with
global batch size ... not divisible by micro batch size ... times data parallel size. Fix mirrors the 70B branch.NCCL_NET_PLUGIN=noneinassets/manifests/primus_llama-3.1-8b.template.json(both env blocks).
rocm/primus:v26.4defaultsNCCL_NET_PLUGIN=librccl-anp.so;that ANP plugin is incompatible with a bundled RCCL overlay and RCCL init hangs.
Docs
references/gotchas.md— documents the GBS and NCCL_NET_PLUGIN pitfalls.Validation
Primus Llama-3.1-8B scaleout, 3-node / 24-GPU MI355X (mia1). With the
_rocm_sdk_librariessweep, the NCCL banner shows the candidate develop86f60f9(before the sweep it silently ran stockd34cbb6). AINIC RoCEtransport confirmed. 50 iters, 0 nan / 0 skipped, ~1550 TFLOP/s/GPU,
~30067 tokens/s/GPU (BF16). Without fix #2 the run aborts before iter 1; without
fix ROCm#3 RCCL init hangs.
Test plan
Llama-3.1-8Bscaleout completes 50 iters whereGBSis not divisible byMBS * world_sizebash -non the edited script passes🤖 Generated with Claude Code