r/rust • • 2d ago

🛠️ project Need help testing an open-source zero-CUDA Vulkan+WGPU multi-GPU collective runtime on GPUs

Hey Rust community

So I am making a project which uses Vulkan+WGPU in Rust and made something similar to PyTorch. Well that is generic systems project. However, I also made a heterogenous NCCL like collective engine in rust along with LLamaRunner. Unlike others who generally use RCCL+NCCL to make this work I tried that using Vulkan(ash).

So, if you guys have some GPUs where you can test this project and share data it would be great. Any GPU data is fine but combination of GPUs especially mixed NVIDIA, AMD/Intel+NVIDIA, dGPU+iGPU on linux would be even better. Will release the project soon so will help the rust community do cross vendor compute.

Till now I tried to run this project on Lavapipe+My iGPU and Kaggle 2x T4 GPUs some results from Kaggle are:-
1. Multi-GPU Ring AllReduce vs. NVIDIA CUDA NCCL

Payload HC4X Vulkan (HOST_SHARED_DMA) NVIDIA CUDA NCCL HC4X / NCCL
1 MiB 0.51 ms (2.05 GB/s) 0.43 ms (2.45 GB/s) 83.7%
4 MiB 1.52 ms (2.77 GB/s) 1.14 ms (3.67 GB/s) 75.5%
16 MiB 4.51 ms (3.72 GB/s) 3.89 ms (4.31 GB/s) 86.3%
32 MiB 7.91 ms (4.24 GB/s) 7.95 ms (4.22 GB/s) 100.5%
64 MiB 14.68 ms (4.57 GB/s) 16.30 ms (4.12 GB/s) 111% (Beats NCCL)

2. 1-GPU & 2-GPU Matmul vs. PyTorch CUDA + NCCL:

  • 1-GPU FP32 GEMM (40963): 3.33–3.41 TFLOP/s (80–83% of cuBLAS, 0.00e+00 bit-exact agreement with cuBLAS; both 7.67e-06 vs FP64).
  • 1-GPU Batched F16 Decode GEMV (vec4<u32> + zero-barrier warp subgroupAdd): 212.7 GB/s on Qwen-1.5B Up (0.93× cuBLAS), 250.8 GB/s on Llama-8B Up (0.97× cuBLAS), and 236.9 GB/s (1.72× faster) on Qwen-1.5B LM Head (1536 → 151,936).
  • 2-GPU Tensor-Parallel GEMM + AllReduce (Y=A0B0+A1B1, FP32, max_abs_err = 3.43e-07):
  • 512×4096×4096 (8 MiB sync): 4.98 ms vs. PyTorch+NCCL 5.38 ms (1.08× faster)
  • 1024×4096×4096 (16 MiB sync): 8.37 ms vs. PyTorch+NCCL 9.98 ms (1.19× faster)
  • 4096×4096×4096 (64 MiB sync): 29.07 ms (14.4 + 14.68) vs. PyTorch+NCCL 27.64 ms (11.1 + 16.30) — 95.1% overall, Sync 1.11× faster.

3. End-to-End Real LLM (Qwen/Qwen2.5-1.5B-Instruct, F16, warm, 100% bit-identical greedy tokens):

  • Short prompt (S=39, 41 decode steps): Prefill 164.9 ms (PyTorch 45.7 ms), Decode 39.15 tok/s (PyTorch 26.10 tok/s, 1.50× faster), Total 1.21 s vs. PyTorch 1.62 s (1.33× faster).
  • Long prompt (S=126, 47 decode steps): Prefill 291.9 ms (PyTorch 43.7 ms), Decode 38.65 tok/s (PyTorch 25.60 tok/s, 1.51× faster), Total 1.51 s vs. PyTorch 1.88 s (1.25× faster).

There is a Pure Rust CLI tool in project as well so that it is simple for you guys to test it your GPUs/links, runs GEMM/GEMV + AllReduce + Optimizer planning, and prints a copy-paste

git clone --depth 1 -b dev https://github.com/CH-Abhinav/HC4X.git  
cd HC4X  
cargo run --manifest-path native/Cargo.toml --release -p hc4x-cli -- bench --quick --include-cpu  

Github: https://github.com/CH-Abhinav/HC4X (dev branch for now merging to main)
This is an active prototype, not a finished llama.cpp replacement yet. In particular, portable WGSL 1.0 has no FP16 Tensor Core (WMMA / cooperative matrix) instruction yet, so compute-bound prompt prefill is still slower than PyTorch CUDA Tensor Cores. Will release v0.1.0 soon. Hoping Rust community helps :)
We can definitely make a WGPU+Vulkan based system which can give near CUDA/RoCm performance (is what I hope).

If you have 60 seconds and an interesting GPU setup, please paste the output in the comments (or in Project's GitHub Discussions)! Even crashes, driver quirks, or unexpected P2P fallbacks are super useful data points.

0 Upvotes

7 comments sorted by

View all comments

Show parent comment

4

u/diplofocus_ 2d ago

The sub gets a deluge of projects posted every day, almost none of them leading to anything relevant for the Rust language. If you just wanna share a project that's made in rust, something like r/madeinrust is a better fit

1

u/CutGroundbreaking305 2d ago

Hmm the problem was I am asking help rather than saying use my project Is there a place where I can ask help about rust code or ask people to test a project? Unfortunately I think instead of helping I am stuck in some rules of reddit Anyways thanks for saying though I will see what can I do about this