Skip to content

Repair etvk.vma_dep=instantiated to share VMA via 3.2.0#20225

Merged
blood-orange merged 1 commit into
pytorch:mainfrom
blood-orange:export-D108337179
Jun 11, 2026
Merged

Repair etvk.vma_dep=instantiated to share VMA via 3.2.0#20225
blood-orange merged 1 commit into
pytorch:mainfrom
blood-orange:export-D108337179

Conversation

@blood-orange

Copy link
Copy Markdown
Contributor

Summary:
Fixes the ExecuTorch Vulkan backend's etvk.vma_dep=instantiated mode so the backend links a single, shared VulkanMemoryAllocator (VMA) instead of instantiating its own. This is the prerequisite that lets a binary link both ET Vulkan and another VMA consumer (e.g. IGL/compphoto) without an ld.lld: duplicate symbol: Vma* collision.

Changes (both fbcode and xplat mirrors):

  1. backends/vulkan/targets.bzl: repair the etvk.vma_dep=instantiated path, which pointed at //third-party/VulkanMemoryAllocator/3.0.1:VulkanMemoryAllocatorInstantiated — a package that no longer exists at HEAD (only 3.2.0 remains), so the mode was broken for everyone. Repoint it to 3.2.0:VulkanMemoryAllocatorInstantiated, the same target IGL/compphoto already use, so VMA is linked exactly once.
  2. backends/vulkan/runtime/vk_api/memory/vma_api.h: align the ETVK_USE_META_VMA branch VMA_VULKAN_VERSION from 1002000 to 1003000 to match the 3.2.0 instantiated lib's config (vk_mem_alloc_instantiated.h) so struct layouts agree across translation units and the pre-instantiated static lib (ABI safety).

Both changes only affect the opt-in etvk.vma_dep=instantiated mode (which was already broken/unused), so default xplat builds and all other ET consumers are byte-for-byte unchanged.

Differential Revision: D108337179

Summary:
Fixes the ExecuTorch Vulkan backend's `etvk.vma_dep=instantiated` mode so the backend links a single, shared VulkanMemoryAllocator (VMA) instead of instantiating its own. This is the prerequisite that lets a binary link both ET Vulkan and another VMA consumer (e.g. IGL/compphoto) without an `ld.lld: duplicate symbol: Vma*` collision.

Changes (both `fbcode` and `xplat` mirrors):
1. `backends/vulkan/targets.bzl`: repair the `etvk.vma_dep=instantiated` path, which pointed at `//third-party/VulkanMemoryAllocator/3.0.1:VulkanMemoryAllocatorInstantiated` — a package that no longer exists at HEAD (only `3.2.0` remains), so the mode was broken for everyone. Repoint it to `3.2.0:VulkanMemoryAllocatorInstantiated`, the same target IGL/compphoto already use, so VMA is linked exactly once.
2. `backends/vulkan/runtime/vk_api/memory/vma_api.h`: align the `ETVK_USE_META_VMA` branch `VMA_VULKAN_VERSION` from `1002000` to `1003000` to match the 3.2.0 instantiated lib's config (`vk_mem_alloc_instantiated.h`) so struct layouts agree across translation units and the pre-instantiated static lib (ABI safety).

Both changes only affect the opt-in `etvk.vma_dep=instantiated` mode (which was already broken/unused), so default `xplat` builds and all other ET consumers are byte-for-byte unchanged.

Differential Revision: D108337179
@blood-orange blood-orange requested a review from SS-JIA as a code owner June 11, 2026 22:46
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 11, 2026
@meta-codesync

meta-codesync Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

@blood-orange has exported this pull request. If you are a Meta employee, you can view the originating Diff in D108337179.

@blood-orange blood-orange added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported labels Jun 11, 2026
@pytorch-bot

pytorch-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20225

Note: Links to docs will display an error until the docs builds have been completed.

⏳ No Failures, 43 Pending

As of commit b292c2f with merge base 2302c25 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@linux-foundation-easycla

Copy link
Copy Markdown

CLA Missing ID

  • ❌ The email address for the commit (b292c2f) is not linked to the GitHub account, preventing the EasyCLA check. Consult this Help Article and GitHub Help to resolve. (To view the commit's email address, add .patch at the end of this PR page's URL.) For further assistance with EasyCLA, please visit our EasyCLA portal and chat with our support bot.

@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@blood-orange blood-orange merged commit 88b5dd8 into pytorch:main Jun 11, 2026
179 of 189 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants