Arm backend: Add shared GPU runtime - #22607
Conversation
Signed-off-by: Elena Zhelezina <elena.zhelezina@arm.com> Change-Id: Ibef2083a96af6d315f7c94027bdbed206c983275
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22607
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ⏳ No Failures, 2 PendingAs of commit f6309b9 with merge base bb2683b ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@claude review this PR. |
|
Claude finished @digantdesai's task in 4m 11s —— View job PR Review: Arm backend — Add shared GPU runtime
This is Phase 1 of the shared-GPU RFC (#19298): a backend-neutral, process-wide registry that lets the VGF and Vulkan delegates share one I found one correctness inconsistency worth addressing, plus a few minor points. Correctness1. Stale context released while holding The class invariant is stated at But in if (entry->context && entry->context->is_valid()) {
return entry->context;
}
entry->context.reset(); // line 87 — runs under unique_lock(mutex_)
entry->creating = true;If the entry holds a stale (invalidated) context and this is its last reference, the Suggested fix: move the stale context into a local before SharedGpuContextPtr stale = std::move(entry->context);
entry->creating = true;
} // release lock
stale.reset();Minor / questions2. If a 3. Hash combine reuses return token_hash ^
(group_hash + 0x9e3779b9 + (token_hash << 6) + (token_hash >> 2));The boost 4. Installing the full Vulkan-Headers tree into the package include root —
5. Root gate Good that it's gated. Since the subdir hard- Things done well
Only item I'd consider blocking is #1 (the release-under-lock), since it can deadlock exactly the re-entrant teardown path the design is built around. The rest are minor. |
|
@digantdesai Do you want me to fix this one blocking issue that is found by Claude or all minor issues as well ? |
|
LGTM at a high level, left some comments. RFC #2 right, not #1? Let's change the name though. Re. Claude comments, seems relevant and useful, your call on how many to fix, seem high to low value to me. Is the long term goal also to remove delegate specific stuff like "set_and_get_external_adapter" in favor of this even when not shared? |
Change-Id: I0510a735c7ac56a2728b7e03b37b125a7d3524d7
|
@digantdesai Thank you for the review. I addressed the blocking issues. Otherwise seems irrelevant in general or insignificant. Re: set_and_get_external_adapter - Yes, in my view, long term these concepts should converge probably. But I don't change Vulkan ET in this PR deliberately. It is going to be Phase 3. |
digantdesai
left a comment
There was a problem hiding this comment.
sorry I forgot to press submit :(
Change-Id: I5f1afdc43c783901c5a8d9f7bdcd0f04674c51eb
Signed-off-by: Elena Zhelezina <elena.zhelezina@arm.com> Change-Id: I2d50daa6e477ebbf383abe7c027d578562035746
Signed-off-by: Elena Zhelezina <elena.zhelezina@arm.com> Change-Id: I0e7efa4a271e05d80fda0fc76452d6a188371c78
|
@digantdesai I think everything is ready for the re-review. |
Signed-off-by: Elena Zhelezina <elena.zhelezina@arm.com> Change-Id: If4db689e22d0fa711b0a6af88dc9b74e0bf1bcd0
This is Phase 2 of RFC #19298: shared runtime support for allowing
the Vulkan and VGF delegates to resolve and safely share a Vulkan context.