Skip to content

Replace CUDA C kernels with CUDA Oxide Rust - #23

Merged
jcwal1516 merged 1 commit into
mainfrom
perf/cuda-oxide
Oct 27, 2026
Merged

jcwal1516 merged 1 commit into
mainfrom
perf/cuda-oxide

Conversation

@jcwal1516

Copy link
Copy Markdown
Member

The CUDA backend embeds CUDA C and invokes NVRTC instead of using the required CUDA Oxide Rust kernels. Replace all five CUDA C files and all 13 entry points with Rust kernels compiled to embedded PTX at build time. Reuse the checked Rust transforms and overlap arithmetic, and retain strict CUDA routing, output formats, asynchronous ownership, and overflow reporting.

The standalone device build pins CUDA Oxide and its compiler. CUDA execution builds require the Linux CUDA Oxide toolchain or JXR_CUDA_OXIDE_PTX; builds without either retain device-free contracts and report CUDA unavailable. Hardware CI requires kernel compilation, and formatting checks include the standalone sources. Runtime execution requires the CUDA driver and does not invoke NVRTC.

Validation completed on ssh cuda with an RTX 4070 SUPER:

  • All 517 in-scope T.834 cases and ROI comparisons match CPU.
  • T.835 comparison: 517 passed, 179 scope exclusions, zero failures.
  • GPU lifecycle, batch/destination, and arithmetic-overflow/recovery tests pass.
  • Focused jxr-math, jxr-cuda, and jxr-native tests, focused Clippy, and formatting pass.

Include the measured permutation fix: constant subscripts eliminate the high-pass kernel's 256-byte per-thread stack. On the matched profile of 1,080 launches using the 145×130 and 1019×677 fixtures, this reduced total GPU time from approximately 29.3 ms to 17.0 ms. Average high-pass time fell from 51.2 µs to 17.5 µs; the CUDA C baseline was 18.9 µs. The default portable PTX also compiles to zero high-pass stack use on the test GPU.

Performance parity remains incomplete: the CUDA C baseline totaled approximately 12.9 ms in that profile. Overlap and output remain optimization work; this PR does not claim equal overall kernel performance.

@jcwal1516
jcwal1516 merged commit 0bde7ac into main Oct 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant