Repository navigation
[ROCm] Add MoRI to the ROCm CI images - #206534
pablo-garay wants to merge 5 commits into
Conversation
The TokenSwitchMoRI tests from pytorch#201225 skip in CI because no CI image has MoRI. This adds MoRI to the ROCm CI images that run on MI300 and MI350. Single-node only; there are no multi-node ROCm CI runners yet. `install_mori.sh` builds MoRI from source, pinned in `ci_commit_pins/mori.txt` to v1.2.5. It does not install flydsl: MoRI's flydsl EP backend uses the flydsl 0.3.4.1 that `.ci/pytorch/test.sh` already installs on the ROCm multi-GPU distributed shards, where the MoRI tests run, so other jobs see no new flydsl. The `amd_mori` wheels on PyPI are cp310/cp312 only and the images use Python 3.11. The build needs no GPU and no torch: MoRI JIT-compiles its kernels on first use, so the background precompile and the optional torch extension are off. No NIC provider (`USE_IONIC`/`USE_BNXT`) is built. It runs for `pytorch-linux-noble-rocm-n-py3.11` and `pytorch-linux-noble-rocm-preview-py3.11`; the jammy image runs only on MI210 (gfx90a), which MoRI does not support. Test Plan: On an MI355X host, the script's build steps in a fresh Python 3.11 venv without torch, as at docker build time, take about 20 s and `import mori.cco.cco` succeeds. The same build installed with a ROCm torch nightly and flydsl 0.3.4.1 passes TokenSwitchMoRITest 41/41 at 4 ranks, with a cold and a warm kernel cache: ``` python test/distributed/test_token_switch.py -v ``` The PR's docker-builds CI exercises the image build itself. Authored with Claude.
Review follow-up. The recursive clone also fetched SPDK and redis-plus-plus, which the default build never uses; only spdlog and msgpack-c are needed. MoRI's requirements-build.txt also installs prettytable and pytest-assume, a pytest plugin that would load into every pytest run in these images, so only the build requirements missing from requirements-ci.txt are installed. The script and pin are renamed to install_rocm_mori.sh and rocm-mori.txt so the existing ROCm CODEOWNERS globs cover them. Test Plan: On an MI355X host with TheRock ROCm 10.1 wheels, the new steps in a fresh Python 3.11 venv without torch (requirements-ci pins of cmake, ninja and setuptools) clone and build in about 20 s, leave spdk and redis-plus-plus empty, and `import mori.cco.cco` succeeds. The same build with a ROCm torch nightly and flydsl 0.3.4.1 passes TokenSwitchMoRITest 41/41 at 2 ranks, as on the 2-GPU CI runners, with a cold and a warm kernel cache: ``` HIP_VISIBLE_DEVICES=2,3 python test/distributed/test_token_switch.py -v ``` Authored with Claude.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/206534
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit ed2d076 with merge base fac4ca8 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
|
env_run passes its arguments through as_jenkins as an unquoted $*, so the quoted -c string was split into words and the check failed with a SyntaxError after MoRI had built. Call python directly, as install_jax.sh does. Pin the build requirements: an unpinned setuptools-scm pulled 10.x, which upgraded the image's pinned packaging from 24.2 to 26.4. Authored with Claude.
pybind11 3.0.1 and wheel 0.48.0 arrive in the image transitively; pinning older versions would downgrade them. Authored with Claude.
|
I pushed a fix for the image builds. The script's last line ran its import check through |
At the v1.2.5 pin, TokenSwitchMoRITest::test_combine_autograd_backward faults in MoRI's ep_combine_0 kernel on MI300X (HSA_STATUS_ERROR_MEMORY_FAULT) and the other rank hangs. MoRI main at 94c7f60f796 has the upstream fixes and passes; the install script's submodules and build deps are unchanged there. Test Plan: On MI300X (gfx942), 2 GPUs, torch built from this branch's base, MoRI installed with the script's steps at each pin: ``` python -bb distributed/test_token_switch.py -m '(multigpu)' -v -p no:xdist --use-pytest -x --reruns=0 ``` At 41c5257d4b9 the first TokenSwitchMoRI test faults as in CI; at 94c7f60f796 all 54 tests pass (41 TokenSwitchMoRITest), 3 of 3 runs, and `import mori.cco.cco` passes with packaging still 24.2. Authored with Claude.
|
I pushed a maintainer commit moving the MoRI pin from v1.2.5 to 94c7f60f796. At v1.2.5, |
jeffdaily
left a comment
There was a problem hiding this comment.
Approved. CI shows that MoRI builds into the ROCm images, and the TokenSwitchMoRI tests pass on both MI300 and MI350.
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Linked issue or supporting maintainer
Supported by @jeffdaily
BC-breaking?
No
Summary (human written only)
The TokenSwitchMoRI tests from #201225 skip in CI because no CI image has MoRI. This adds MoRI to the ROCm CI images that run on MI300 and MI350. Single-node only; there are no multi-node ROCm CI runners yet.
Agent details (if applicable)
My agent came up with this analysis, but I've read and approved it.
install_rocm_mori.shbuilds MoRI from source, pinned inci_commit_pins/rocm-mori.txtto v1.2.5, since theamd_moriwheels on PyPI are cp310/cp312 only and the images use Python 3.11. It fetches only the two submodules the build uses and installs only the build requirements missing fromrequirements-ci.txt(MoRI'srequirements-build.txtwould also add a pytest plugin). The build needs no GPU and no torch: MoRI JIT-compiles its kernels on first use, so the background precompile and the optional torch extension are off. No NIC provider (USE_IONIC/USE_BNXT) is built.It does not install flydsl: MoRI's flydsl EP backend uses the flydsl 0.3.4.1 that
.ci/pytorch/test.shalready installs on the ROCm multi-GPU distributed shards, where the MoRI tests run, so other jobs see no new flydsl. The 4-GPU MI350 shard does not install flydsl, so the MoRI tests still skip there.It runs for
pytorch-linux-noble-rocm-n-py3.11andpytorch-linux-noble-rocm-preview-py3.11. The jammy images run distributed tests only on MI210 and RX7900, which MoRI does not support.Test plan, on an MI355X host with TheRock ROCm 10.1 wheels: the script's steps in a fresh Python 3.11 venv without torch, as at docker build time, build in about 20 s and
import mori.cco.ccosucceeds. The same build with a ROCm torch nightly and flydsl 0.3.4.1 passes TokenSwitchMoRITest 41/41 at 2 ranks, as on the 2-GPU CI runners, with a cold and a warm kernel cache. This PR's docker-builds CI exercises the image build itself, on ROCm 10.2.cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @naromero77amd @pragupta @jerrymannil @xinyazhang