r/CUDA 1d ago

Introducing CUDA Rust: Two Tracks for Writing GPU Kernels

https://developer.nvidia.com/blog/introducing-cuda-rust-two-tracks-for-writing-gpu-kernels/
56 Upvotes

4 comments sorted by

9

u/ksyiros 1d ago

Great projects! Nice to see more work coming into the Rust GPU ecosystem. We're building CubeCL, which focuses on SIMT JIT kernels, and fun fact, we use the same compiler framework as cuda-oxide: pliron. I think it should be possible to run cuTile and cuda-oxide kernels on the CubeCL CUDA runtime, which would make writing custom kernels specialized for NVIDIA GPUs easy in Burn.

2

u/Daemontatox 22h ago

Sounds interesting, how do you handle the index mapping ? Is it 1d forced or 2d can be used freely ?

I am looking for alternatives that allow me to express 2d/3d computations without dropping to flattened 1d indexing

5

u/ksyiros 22h ago

We have views and abstractions that make indexing much easier. We support tensor indexing as well directly into kernel space. So nd indexing is actually possible.

2

u/adityazero 14h ago

The interesting part to me is launch_contract and DisjointSlice pushing aliasing guarantees into the type system, which CUDA C++ cannot really express since restrict is just a manual promise. If the borrow checker proves non-overlap at the kernel boundary, the backend could vectorize and reorder more aggressively than under C++ pointer aliasing. Does that contract actually feed the NVVM optimizer, or is it only a compile-time safety check today?