Comment by YuechenLi

15 hours ago

So... why go through LLVM at all instead of having the MIR target PTX/HIP C directly then?

If they really wanted a vendor neutral solution for Rust GPU, that already exists: you write the CPU side code, including buffering, allocation, concurrency, etc through Vulkan binding and consume the compute kernel in SPIR-V from HLSL/GLSL/WGSL etc. As it stands, the way they use Rust here feels more like using it like TypeScript types/interfaces than anything else.

Again, the size of most operations that should be done on the GPU is known ahead of time before compilation, so it's very much possible to statically allocate memory at compile time instead of going through all this trouble to write what's essentially a Rust shaped DSL for GPU compute.

Because it's convenient? Shader and vulkan semantics can be quite limiting and annoying to write.

Maybe it doesn't matter in a post AI world but perhaps it will allow better abstractions.

No need to yuck someone else's yum.

  • The compute shader side of Vulkan is actually fairly smooth compared to graphics. It's not really that different from low level CUDA or OpenCL. The Vulkan complexities overwhelmingly concern rasterization and raytracing.

People go through trouble to write Python-shaped DSL for GPU compute. We will go "why o why?", but apparently such things are necessary to succeed in the market.

  • Well, I suppose fake Python is better than fake C++ at least.

    But yeah, I think Python's dominance in science/ML will eventually pass, just as FORTRAN and Matlab did before.