[ROCm][VMM] Layer 1/4: RocmRawMemoryAllocation (hipMemCreate/hipMemRelease RAII)#928
Closed
phambinhfin wants to merge 1 commit into
Closed
[ROCm][VMM] Layer 1/4: RocmRawMemoryAllocation (hipMemCreate/hipMemRelease RAII)#928phambinhfin wants to merge 1 commit into
phambinhfin wants to merge 1 commit into
Conversation
…lease RAII) First in a series that splits the ROCm VMM allocator (currently one large branch, proposed upstream as openxla#40236) into one reviewable PR per layer: Layer 1/4 - RocmRawMemoryAllocation: RAII wrapper for hipMemCreate / hipMemRelease <= THIS PR Layer 2/4 - RocmMemoryReservation: RAII wrapper for hipMemAddressReserve / hipMemMap / hipMemSetAccess / hipMemUnmap Layer 3/4 - RocmVmmAllocator: all-in-one allocator (create + reserve + map + setAccess) Layer 4/4 - RocmDeviceAddressVmmAllocator: GPU timeline-based deferred deallocation + PJRT wiring This layer adds a standalone RAII handle around a single physical VMM allocation: it owns the hipMemGenericAllocationHandle_t returned by hipMemCreate and releases it via hipMemRelease on destruction. It has no dependency on the higher layers, so it can be reviewed and merged on its own. Includes rocm_raw_memory_allocation_test.cc covering allocate/release and move semantics.
Collaborator
Author
|
Retargeting this series to openxla/xla:main (the VMM allocator is proposed upstream as openxla#40236). Reopening Layer 1/4 as an upstream PR; closing this fork-internal one. |
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.
Series (one PR per VMM layer)
This is the first in a series of four that splits the ROCm VMM allocator into small, reviewable layers (the combined work was previously one large branch, proposed upstream as openxla#40236). Splitting per layer keeps each PR well under the "large CL" threshold and lets each layer be reviewed independently, bottom-up.
hipMemCreate/hipMemReleaseRAII ⟸ This PRhipMemAddressReserve/hipMemMap/hipMemSetAccess/hipMemUnmapRAII(The selective copy-vs-remap optimization continues to live in #926, which stacks on top of this series.)
What this PR adds
The lowest layer of the VMM stack: a standalone RAII handle around a single physical VMM allocation.
RocmRawMemoryAllocationowns thehipMemGenericAllocationHandle_treturned byhipMemCreateand releases it viahipMemReleaseon destruction (move-only, no copy).Tests
rocm_raw_memory_allocation_test.cc— allocate/release and move-semantics coverage.Notes
tags = ["gpu", "rocm-only"]); no CUDA/NVIDIA impact.