From 6a2e5355134c042dddb754733d31f17fcad22761 Mon Sep 17 00:00:00 2001 From: Vincent Hamm Date: Tue, 21 Apr 2026 12:47:36 -0700 Subject: [PATCH] Switch VGF backend from custom vulkan-headers-1.4.343 to standardized khronos (#19031) Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/19031 Migrate the VGF backend's Vulkan dependencies from the custom `third-party/vulkan-headers-1.4.343` package to the standardized `third-party/khronos` and `third-party/volk` packages. The custom package had a regenerated volk with ARM tensor extensions, but the standard volk and khronos 1.4.341 headers already include these extensions (`VK_ARM_tensors`). Changes: - `targets.bzl`: Replace custom `vulkan-headers-1.4.343` deps with `third-party/volk:volk_src`, `third-party/volk:volk-header`, and `third-party/khronos:vulkan-headers` - `VGFBackend.cpp`, `VGFSetup.h`: Include `` directly instead of going through the `vk_api.h` shim (which just forwarded to volk.h when USE_VULKAN_VOLK is defined) - `third-party/volk/BUCK`: Add `volk_src` export_file target for direct compilation into consumer targets Differential Revision: D100706182 --- backends/arm/runtime/VGFBackend.cpp | 4 ++-- backends/arm/runtime/VGFSetup.h | 4 ++-- backends/arm/runtime/targets.bzl | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backends/arm/runtime/VGFBackend.cpp b/backends/arm/runtime/VGFBackend.cpp index 85cf89e14fa..b83d3137b55 100644 --- a/backends/arm/runtime/VGFBackend.cpp +++ b/backends/arm/runtime/VGFBackend.cpp @@ -27,8 +27,8 @@ using executorch::runtime::MemoryAllocator; using executorch::runtime::Result; using executorch::runtime::Span; -// We use the platform and runtime environment provided by the Vulkan delegate -#include +// Volk meta-loader provides Vulkan function pointers (ARM tensor extensions, etc.) +#include // Dependencies for processing VGF files into Vulkan calls #include diff --git a/backends/arm/runtime/VGFSetup.h b/backends/arm/runtime/VGFSetup.h index 8e07b36e303..094569c41a0 100644 --- a/backends/arm/runtime/VGFSetup.h +++ b/backends/arm/runtime/VGFSetup.h @@ -15,8 +15,8 @@ using namespace std; using executorch::runtime::ArrayRef; using executorch::runtime::CompileSpec; -// We use the platform and runtime environment provided by the Vulkan delegate -#include +// Volk meta-loader provides Vulkan function pointers (ARM tensor extensions, etc.) +#include namespace executorch { namespace backends { diff --git a/backends/arm/runtime/targets.bzl b/backends/arm/runtime/targets.bzl index 29455f0e657..62360112568 100644 --- a/backends/arm/runtime/targets.bzl +++ b/backends/arm/runtime/targets.bzl @@ -41,7 +41,7 @@ def define_common_targets(): # function-pointer variables live in the same linkage unit. # Linking from a separate static library causes the linker to # drop the symbols when building a shared library. - "fbsource//third-party/vulkan-headers-1.4.343/v1.4.343/src:volk_arm_src", + "fbsource//third-party/volk:volk_src", ], exported_headers = ["VGFSetup.h"], # @lint-ignore BUCKLINT: Avoid `link_whole=True` (https://fburl.com/avoid-link-whole) @@ -60,7 +60,7 @@ def define_common_targets(): "//executorch/runtime/backend:interface", "//executorch/runtime/core:core", "fbsource//third-party/arm-vgf-library/v0.9.0/src:vgf", - "fbsource//third-party/vulkan-headers-1.4.343/v1.4.343/src:volk_arm", - "fbsource//third-party/vulkan-headers-1.4.343/v1.4.343/src:vulkan-headers", + "fbsource//third-party/volk:volk-header", + "fbsource//third-party/khronos:vulkan-headers", ], )