vortx is a cross-platform tensor library exposing linear-algebra operations as GPU compute shaders written in Rust with rust-gpu.
Warning vortx is still very incomplete and under heavy development.
- GPU tensors up to rank 4 with views, strides, transpose, reshape, broadcast, squeeze/unsqueeze
- GEMM (matrix multiplication) — naive and optimized tiled kernels
- Element-wise ops — add, sub, mul, div, copy (in-place)
- Reductions — sum, product, min, max, squared norm
- Multiple backends via khal: WebGPU (default), CUDA. CPU, CPU-parallel, are also supported for debugging.
The crates.io version of cargo-gpu is outdated. Install from Git and let it set up its Rust
toolchain:
cargo install --git https://github.com/Rust-GPU/cargo-gpu cargo-gpu
cargo gpu installcargo-cuda lives in this repository (crates/cargo-cuda). Install it from the workspace and
build the rustc_codegen_nvvm codegen backend:
cargo install --path https://github.com/dimforge/khal cargo-cuda
cargo cuda installThis requires the CUDA toolkit to be installed and the CUDA_PATH environment variable to
point to it (e.g. /usr/local/cuda). The install step downloads a pinned Rust nightly, adds the
nvptx64-nvidia-cuda target, and compiles the codegen backend.
