[AMDGPU] Support queue-ordered memory-file transfers - #368
Open
AWoloszyn wants to merge 3 commits into
Open
Conversation
Handle HAL memory-file I/O through queue pending state. This covers imported host memory that requires a native copy. Signal semaphores publish only after the transfer completes. Retain files, buffers, and copy state through prerequisite waits, cancellation, and queue pressure. Regular files continue through the existing proactor and mapped-buffer path.
Reject overflow while combining HAL subspan and operation offsets before a stream-ordered native host-memory transfer forms source and target pointers.
AWoloszyn
marked this pull request as ready for review
August 13, 2026 15:02
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 an AMDGPU-local transfer path for HAL memory files, which represent imported host allocations.
The existing file-transfer path could route these operations through an ordinary device blit. That blit may use a
device kernel, but imported host allocations are not guaranteed to be accessible from such kernels. This made queue-
ordered transfers involving host-visible memory unreliable.
Implementation
Detect HAL memory files in AMDGPU queue read and write operations.
Execute the transfer with hsa_memory_copy after the queue wait dependencies retire.
Publish signal semaphores through a post-drain barrier so completion remains correctly ordered without recursively
submitting work from the completion thread.
Preserve the existing asynchronous file path for non-memory files.
Validate buffer ranges, transfer usage, memory access, host addressability, and offset arithmetic.
Resolve allocated-buffer and subspan offsets before constructing native pointers.
This supports queue-ordered transfers used by HIP host allocation and registration APIs without introducing a wider
HAL interface change.
Testing
Added an AMDGPU-local integration test using a real logical device. It covers: