Add ROCm 10 backend for AMD GPUs - #7
mehmetoguzderin wants to merge 5 commits into
Conversation
Add an opt-in `deep_jit::ROCm` backend for ROCm 10, following the existing backend structure. - Compile HIP source to HSACO with HIPCC, and load and launch kernels through HIP. - Reuse the existing runtime, caches and PyTorch bindings, including current-stream integration. - Add ROCm tests and documentation, and remove unused CUDA dependencies from the optional root module/build. The shared runtime, caches and existing backend implementations are unchanged. CUDA and Ascend consumers keep their existing workflows without acquiring ROCm dependencies. Their header tests exclude ROCm-only headers. ### Testing Tested on AMD Instinct MI355X (288 GB, `gfx950`), Ubuntu 26.04 LTS, ROCm 10.0.0 (HIP 7.15.26333), PyTorch `torch[device-gfx950]==2.13.0+rocm10.0.0`. Ran `python tests/test_rocm.py`, exercised end-to-end PyTorch integration beyond the main test suite, and checked existing backends for regressions.
|
Hi @guyan364, @kurisu6912, @LyricZhao, thank you very much for authoring and releasing this library, I really like its architecture. I tried to enable an AMD GPU backend on ROCm 10 and tested all the way through to Torch without regressing other backends (and removed an unused CMake import). Although I tried to stay close to the existing code conventions in the repository, please let me know if you would prefer any code changes. All the best. - Oguz |
|
A note from use, not a review — with one correction that is mine. I ran this backend on a Strix Halo (gfx1151, Radeon 8060S) with the ROCm SDK's aie2p clang. Build: The The correction, because it is the part I got wrong first: I initially read two "undeclared identifier" errors in So: not a defect here — but the practical consequence may be worth a line in the backend's README, since the backend effectively requires ROCm headers that match the runtime it will be loaded by, and a system HIP package that is older than the runtime produces exactly those two errors rather than a link failure. That is a diagnosability note, not a request. Unrelated and minor, since I noticed it while reading the repo: the workflow in #8 requests Nothing here blocks the PR from my side; the ROCm path worked on the first architecture I had. |
|
The ROCm backend requires HIP headers that match the HIP runtime. With a header Reason, for anyone who hits it: Concretely, on Strix Halo (gfx1151, TheRock HIP 7.16): the SDK's Suggestion: one sentence in the ROCm section of the README — "requires HIP headers While here, two things that are verified and might be worth a line each:
What this note is notIt is not a bug report and not a patch. My first pass concluded the backend Evidence
|
Clarify HIP header requirements and library compatibility checks for ROCm 10.
|
@bong-water-water-bong Thank you very much for the check, I agree that it helps to note such aspects to ease user on-boarding. I added a small paragraph aligning with your suggestion, could you please check (just in case you have the time for it)? Appreciated in advance. |
|
Checked — the paragraph is accurate as written, and I re-ran the checks rather Headers. The two sets on the box disagree in exactly the way the paragraph
Compile, PR head
Resolution, So "plain Runtime. One addition you may want in that paragraph, because it is what the
I ran One correction to my earlier note, since you may have read it: I wrote that Evidence commands (all re-run 2026-09-11 on the gfx1151 box): |
|
@bong-water-water-bong awesome, thank you. Your experience and analysis were helpful to better document this PR, and hopefully provide a good data point for maintainers. |
Add an opt-in
deep_jit::ROCmbackend for ROCm 10, following the existing backend structure.The shared runtime, caches and existing backend implementations are unchanged. CUDA and Ascend consumers keep their existing workflows without acquiring ROCm dependencies. Their header tests exclude ROCm-only headers.
Testing
Tested on AMD Instinct MI355X (288 GB,
gfx950), Ubuntu 26.04 LTS, ROCm 10.0.0 (HIP 7.15.26333), PyTorchtorch[device-gfx950]==2.13.0+rocm10.0.0.Ran
python tests/test_rocm.py, exercised end-to-end PyTorch integration beyond the main test suite, and checked existing backends for regressions.