[HAL/AMDGPU] Add execution-scoped virtual memory access - #367
Open
AWoloszyn wants to merge 2 commits into
Open
Conversation
Translate logical-device affinity into bounded native agent sets for allocation, host import, staging, and VMM protection. Preserve distinct host and agent-visible addresses when imported fine-grained memory uses different pointer representations. Keep host-only and device-only VMM protection backend-specific because generic queue affinity cannot represent those agent classes. These are memory-management paths and add no work to ordinary dispatch.
Add portable host and device access scopes to virtual-memory protection so allocator proxies and remote backends can preserve the requested policy through the HAL vtable. Resolve those scopes to native agents inside AMDGPU and keep backend allocation details private.
AWoloszyn
marked this pull request as ready for review
August 13, 2026 14:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add portable host and device execution scopes to the HAL virtual-memory protection API and implement them in the
AMDGPU backend.
This enables callers to distinguish between memory accessible by device execution, host execution, or both. Queue
affinity continues to select the participating device topology, while the new access scope independently selects the
execution domains receiving access.
AMDGPU resolves these portable scopes to native agents internally. Native agent handles and access-policy details
remain private to the driver.
The change also improves host-memory imports by preserving both the original host address and the agent-visible
address when native registration produces different values.
Motivation
HIP virtual-memory APIs such as hipMemSetAccess require independent host and device access control. Queue affinity
alone cannot represent this distinction because host execution is not a device queue.
Handling this through an AMDGPU-private API would require HRX to identify the concrete backend and directly call
driver internals. That would break HAL encapsulation and would not work through allocator wrappers, proxies, or remote
execution.
The generic execution-scope contract preserves the requested policy through the HAL boundary while leaving each
backend responsible for translating or rejecting it.
Implementation
HIP functionality enabled
This supports the backend requirements for: