Skip to content

Latest commit

 

History

History
56 lines (43 loc) · 2.11 KB

File metadata and controls

56 lines (43 loc) · 2.11 KB

vortx
Build status crates.io

vortx − cross-platform GPU tensor library in Rust

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.

Features

  • 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.

Development setup

cargo-gpu (required for SPIR-V / WebGPU)

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 install

cargo-cuda (required for CUDA / PTX)

cargo-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 install

This 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.