-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wishlist: Vulkan backend for Linux #1751
Comments
This is a pretty major undertaking and it's unlikely we will have bandwidth to work on it in the near future. We'd need a Vulkan runtime back-end and presumably we'd need to rewrite all of the compute kernels in OpenGL SL (?). In theory it's all doable, particularly given that the Vulkan API is similar to Metal it should be pluggable as a back-end in MLX. It would be pretty interesting to see what this looks like if someone is interested to work on it.
Curious, why so? |
Linux lets you pass GPU devices in to a container, even in a Kubernetes cluster. This means rather than running something like |
What does this mean? Asahi Linux also ships conformant OpenCL 3.0 drivers. I would expect similar performance between OpenCL and Vulkan compute, both use the same backend compiler.
Not necessarily, anything that can compile to appropriate SPIR-V... that includes HLSL, GLSL, etc. For OpenCL, it'd likely be OpenCL C but could also be appropriate SPIR-V target. |
Could we use SPIRV-Cross to convert Metal Shading Language (MSL) kernels directly into SPIR-V for Vulkan? This way, we wouldn’t have to rewrite all the compute kernels for a new backend. SPIRV-Cross handles most of the work of translating MSL, and then we can feed the resulting SPIR-V into Vulkan. It might still be complex, but using SPIRV-Cross could reduce duplication of effort and ease maintenance compared to a full rewrite. Thoughts? @awni @tidux @alyssarosenzweig If you think this is a viable solution I'd like to take this task. |
The Asahi Linux project has shipped Vulkan drivers for the M chips. Adding support for this stack would allow better cluster management (e.g. exo) for multi machine mlx setups. It would also, in theory, allow running AI models on other unified memory hardware with Linux support, such as AMD APUs. This would actually fulfill a major design goal of Vulkan (and its AMD ancestor Mantle) by providing a common library for unified compute, without the overhead of OpenCL.
The text was updated successfully, but these errors were encountered: