[Feat] Added JAX-Triton bridge for ROCm - #649
Conversation
Claude WalkthroughIntent. Extend TE's JAX/Triton custom-call bridge in Key changes.
Walkthrough.
Testing. New Notes for reviewers.
Generated by Claude. To request a code review, comment |
Claude reviewReviewed the PR-specific diff (
Verdict: looks clean. The ROCm/HSACO path, Gluon Copyright headers: OK — both modified files carry an AMD 2026 line above the preserved NVIDIA No new inline findings. |
|
@AllenFarcas Please resolve conflict and test against the latest CI image. |
Claude review (re-review)Re-reviewed the full PR diff against the current base ( Verdict: the ROCm/HSACO and Gluon compile paths are structurally sound and the CUDA path stays guarded and unchanged. Four issues worth addressing before merge, posted inline: one ROCm correctness risk around how the HSACO binary is delivered, one import-time fragility on ROCm-only Triton builds, one Black violation that will fail the lint gate, and one test-visibility gap that lets the new Gluon coverage silently not run. Copyright headers: OK — both modified files carry an AMD 2026 line above the preserved NVIDIA Note: the PR is currently in a conflicting state against |
Write HSACO to a persistent, content-addressed path. The blob path is serialized into the custom call, so a JAX persistent-cache hit in a later process replayed a deleted temp dir. Naming the file by its own digest also avoids the kernel cache key, which covers neither kernel source nor Triton version and would serve a stale binary after an edit. Import the NVIDIA Triton backend lazily. A Triton built for AMD only ships no triton/backends/nvidia, so the module-scope import failed and the ROCm path never ran. Collect the Gluon tests always and skip them with a reason. Defined inside "if HAS_GLUON" they were never collected, so the suite passed having run nothing. Narrow the probe's except for the same reason. Guard the triton import: require_triton_or_skip_test_file only checks the JAX version. Run test_triton_custom_calls.py in CI; it was in no leg. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The persistent content-addressed store was written for a failure that does not occur. Measured on gfx950: the ROCm plugin unlinks the blob once it has loaded it, and JAX derives its persistent-cache key from the lowered HLO, so lowering reruns in every process and rewrites the file before launch. A cached executable therefore never replays a stale path. Persisting the blobs only leaked the ones no kernel loaded, which the temp dir had been reclaiming. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Description
Extend TE's JAX Triton custom-call bridge to compile and dispatch AMD ROCm (HSACO) and Gluon kernels. This PR enables AMD's layout-explicit Gluon kernels to be called from JAX, mirroring NVIDIA's existing support.
Fixes https://github.com/ROCm/frameworks-internal/issues/16044
Type of change
Changes
Please list the changes introduced in this PR:
GluonASTSourcewith a full constexpr-marked signature.nanobind std::string), not raw bytes.num_warps/num_stagesfor non-autotuned Gluon layout matching.Checklist: