You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Vulkan accelerator backend (Device::Vulkan): implementation available, seeking to upstream #3985
Proposing a Vulkan backend for candle-core analogous to the existing CUDA and Metal backends. A working reference implementation exists in the rexlunae/joshua fork. This issue is to gauge interest and agree a shape before upstreaming a ~2k-line backend.
What the implementation provides
Device::Vulkan / DeviceLocation::Vulkan + VulkanDevice / VulkanStorage, wired through the Device/Storage/DeviceLocation enums and all allocation/sync paths — mirrors the Metal/OpenCL-style backend structure.
Uses ash with its loaded feature (libvulkan.so dlopen'd at runtime, no hard link) and naga to compile embedded GLSL compute shaders to SPIR-V at runtime (no external glslc).
Bring-up target is unified-memory iGPUs (AMD Renoir / RADV): host-visible+coherent buffers make the host<->device round-trip a plain memcpy; native kernels cover matmul (register-blocked, handles transposed/batched/broadcast rhs), elementwise, and last-dim reduction.
CustomOp1/CustomOp2::vulkan_fwd device-native hooks so softmax/RMSNorm-style CustomOps can run on-device instead of the CPU default (default remains a correct CPU round-trip).
Validation (AMD Radeon / RADV RENOIR iGPU)
Native kernels are bit-exact vs CPU (matmul, elementwise, last-dim reduction). Device-native softmax matches CPU to ~7.5e-9 and RMSNorm to ~1e-7. Full 150B-MoE inference runs on-device via --device vulkan.
Questions
Is there interest in a Vulkan backend upstream? It parallels the Metal backend's role (broader hardware coverage than CUDA-only), especially for iGPUs and RADV-based systems.
Shape preference: full backend in one PR, or a staged series (device/storage round-trip first, then kernels, then CustomOp hooks)?
Any concerns about the ash/naga dependencies (currently optional feature-gated behind vulkan)?
I'm happy to prepare the PR in the agreed shape using the joshua implementation as the reference.
Activity
cryptomilk commentedon Sep 17, 2026
I would be interested. It would be nice to have this for https://github.com/lucasjinreal/Crane
However the big problem is that candle is not really moving forward. There are a lot of PRs but nobody is reviewing them actively :-(
There is a PR for adding ROCm support, but it doesn't look like someone cares about it 😢
amejia1 commentedon Sep 18, 2026
I was looking into getting a vulkan backend for candle working as well, except I am going the route of using vulkano.