I’ve released torch-vulkan 0.2.0, an out-of-tree backend (device "vk") that runs PyTorch ops as Vulkan compute kernels, aimed at scientific code: float64, complex numbers, FFTs, dense and sparse linear algebra. Every op exercised by 36 of PyTorch’s own test files (about 160,000 tests) and by the OpInfo database (689 ops) runs on the GPU with no CPU fallbacks and matches the CPU’s results, on Intel, NVIDIA, Arm Mali and Mesa.
A few things from building it that may be useful to other PrivateUse1 backends:
- Running PyTorch’s device-generic test files against an out-of-tree device, with a strict mode (
TORCH_VK_STRICT=1) that turns any CPU fallback into an error, and a counter (fallback_counts()) for the rest. - A table of the CPU’s dtype errors, generated from OpInfo, so the device rejects exactly what the CPU rejects and PyTorch’s dtype tests agree.
- Comparing against the CPU found a segfault in
_weight_int8pack_mmfor bfloat16 (#204474).
Wheels for Windows and Linux (PyTorch 2.14): releases. More context in #160230. Reports from GPUs I haven’t tried, AMD especially, are welcome in Discussions. I directed the development, with Claude Opus 5.5 writing the code.