fix(rocm): complete RDNA3 runtime path - #1
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds HIP compatibility mappings for C++ extensions and introduces ROCm-specific paths for memory operations, activation math, fp8 handling, and kernel launch configuration. ChangesROCm and HIP support
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The PR completes localized ROCm/RDNA3 runtime compatibility changes, and no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Follow-up to FlashML-org#23, based directly on
feat/rocm-supportat27c0977b6f2ffd476b85de116e2db839b614d76a.The initial draft used a correctness-first PyTorch fallback for
fast_index_copy_jit. Real RX 7800 XT /gfx1101validation exposed additional CUDA-only assumptions, so the published branch now uses the native HIP path throughout the supported single-GPU RDNA3 scope. History is intentionally retained rather than force-pushed.Current published head:
48146760e6d2dfc92dd35233447c9602ad57054b— 9 commits after PR FlashML-org#23 head.What this fixes
hip_compat.h;launch_pdloptions to Triton on HIP;--offload-arch=argument per requested ROCm architecture instead of embedding a semicolon-separated architecture list in one shell argument;kDLROCM/kDLROCMHostin the supported single-GPU JIT tensor matchers (fast_index_copy,index,store).The earlier broad
#define kDLCUDA kDLROCM/kDLCUDAHost kDLROCMHostcompatibility alias was removed. Explicit matchers are easier to audit and avoid silently broadening the still-NCCL-onlypyncclpath.pyncclremains CUDA-only here; RCCL/multi-GPU migration is intentionally outside this PR.The original Python row-copy fallback and its tests are no longer present in the final diff.
Real hardware validation
Hardware/runtime: RX 7800 XT (
gfx1101), PyTorch2.11.0+rocm7.2, HIP7.2.26015, Triton ROCm3.6.0.Earlier native-runtime validation on this branch lineage:
1024 threads x 8 blocks): byte-exact PASS;4 passed;3 passed;22 passed, 11 skipped; skips are native-FP8-only cases intentionally excluded on this RDNA3 target;29 passed, 11 skipped.Direct validation of the current published head
48146760...was then run through the Dormant Giant A0 composition harness with no composition-local DLPack compatibility patch applied. Only the separate staged-source seam was layered on top of FreeToken.Exact validation evidence:
856bc758b55355bac81acbe2bda4e53462088429;32726063241;97427500852;PASS rocm-dlpack-source-contract;ROCM_MULTI_ARCH_FLAGS=SHELL_SAFE_PER_ARCH;ROCM_DLPACK_DEVICE_MATCHING=EXPLICIT_SINGLE_GPU_NO_GLOBAL_ALIAS;ROCM_PYNCCL_SCOPE=CUDA_ONLY_RCCL_NOT_CLAIMED;ROCM_A0_COPY_CLASSIFICATION=PASS_NATIVE_HIP_SINGLE_BANK_COPY;ROCM_A0_PHYSICAL_CLASSIFICATION=PASS_NATIVE_FREETOKEN_A0_ON_ROCM;ROCM_A0_BF16_OUTPUT_CLASSIFICATION=PASS_RESIDENT_STAGED_BIT_EXACTwith logical IDs[[5,2],[7,1]], remapped cache slots[[5,3],[6,1]], non-contiguous victims(1,3,5,6), andlease_cleanup=0.The last two checks are composition evidence rather than a claim that Dormant Giant is part of this PR; their relevance here is that the published FreeToken head itself successfully compiled and executed the native HIP copy/JIT path and FreeToken expert decode path under real
gfx1101load without the former external DLPack patch.Scope
This is single-GPU RDNA3 correctness work. It does not claim:
CUDA-specific behavior remains on the existing non-HIP paths, and the explicit DLPack matchers avoid changing unsupported multi-GPU semantics by preprocessor side effect.