Skip to content
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

[Feature Request] Add vulkan execution provider #21917

Open
thewh1teagle opened this issue Aug 29, 2024 · 8 comments
Open

[Feature Request] Add vulkan execution provider #21917

thewh1teagle opened this issue Aug 29, 2024 · 8 comments
Labels
feature request request for unsupported feature or enhancement

Comments

@thewh1teagle
Copy link

thewh1teagle commented Aug 29, 2024

Describe the feature request

Please consider adding Vulkan as an execution provider. Vulkan offers several advantages over DirectML, Rocm, Migraph, and Cuda:

  • Easier Compilation: Vulkan simplifies the compilation process, requiring fewer and lighter dependencies across both Linux and Windows.
  • Lightweight Dependencies: Vulkan eliminates the need for heavy dependencies and large packages required by Cuda on Linux.
  • Cross-Platform Efficiency: Unlike Rocm, Vulkan operates efficiently on both Linux and Windows without the burden of extensive dependencies.
  • Reduced Footprint: On Windows, Vulkan avoids the need for the 300MB dependencies required by Cuda.
  • Wide Compatibility: Vulkan works seamlessly out-of-the-box on Windows with a variety of GPUs.
  • Unified Provider: A single Vulkan execution provider can support GPUs/CPUs across AMD, Nvidia, and Intel platforms.

By the way, the Vulkan license is open for both commercial and non-commercial use.

@thewh1teagle thewh1teagle added the feature request request for unsupported feature or enhancement label Aug 29, 2024
@github-actions github-actions bot added ep:DML issues related to the DirectML execution provider ep:ROCm questions/issues related to ROCm execution provider labels Aug 29, 2024
@snnn snnn removed ep:DML issues related to the DirectML execution provider ep:ROCm questions/issues related to ROCm execution provider labels Aug 29, 2024
@altunenes
Copy link

This is one of my biggest dreams for onnx models...Not having to create different installers for each GPU/os and being able to harness the power of Vulkan: perfect...

@fs-eire
Copy link
Contributor

fs-eire commented Oct 28, 2024

@altunenes the first version of WebGPU EP is almost ready to merge. Please track: #22591

Currently WebGPU EP uses D3D12 on Windows, vulkan on linux/android and metal on iOS/macOS. Is using vulkan in Windows a requirement?

@jlucaso1
Copy link

@fs-eire Is it possible to choose a backend on Windows (either D3D12 or Vulkan)? I'm curious about the performance differences between the two.

@fs-eire
Copy link
Contributor

fs-eire commented Oct 28, 2024

That makes sense. I can share a change after merging that PR to allow build locally with valkan, but considering the binary size, I will stick to use only one backend unless it's proven useful.

@altunenes
Copy link

@altunenes the first version of WebGPU EP is almost ready to merge. Please track: #22591

Currently WebGPU EP uses D3D12 on Windows, vulkan on linux/android and metal on iOS/macOS. Is using vulkan in Windows a requirement?

First of all, I am really grateful for this important contribution. I can't wait to test this!
Vulkan is not a " requirement" on Windows, but as said above, I think it will be very nice for performance comparison.

@ramkrishna2910
Copy link

@fs-eire can you please share the change that allows webgpu to build locally with Vulkan on Windows?

@fs-eire
Copy link
Contributor

fs-eire commented Dec 12, 2024

I made a PR: #23096

with this change you can build with --use_webgpu --config Release --build_shared_lib --cmake_extra_defines onnxruntime_ENABLE_DAWN_BACKEND_D3D12=0 onnxruntime_ENABLE_DAWN_BACKEND_VULKAN=1 to use Vulkan backend of Dawn.

I tested it locally on my Windows devbox and it seems working with f32 models. f16 seems disabled for unknown reason (the same machine can run f16 on D3D12). All other things are just good.

@fs-eire
Copy link
Contributor

fs-eire commented Dec 13, 2024

f16 is disabled on all nvidia GPUs in Vulkan backend now:

https://github.com/google/dawn/blob/b8306de17c9a5775819a8526802fe85a860f5216/src/dawn/native/vulkan/PhysicalDeviceVk.cpp#L262

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request request for unsupported feature or enhancement
Projects
None yet
Development

No branches or pull requests

6 participants