memory: regression test for pinned hipMemPoolAttrReleaseThreshold - #612
Open
xcwang1999 wants to merge 1 commit into
Open
xcwang1999 wants to merge 1 commit into
xcwang1999 wants to merge 1 commit into
Conversation
Pinning the release threshold to UINT64_MAX must stop the pool from releasing any reserved memory, including when the free-pressure path fires. On affected runtimes the threshold is silently dropped on the release paths and reserved bytes fall right after the frees. The test pins the threshold (readback confirms), reserves 3 x 64 MiB, then frees A+B, lets the free markers retire, and frees C so the pressure path (freed 128 MiB > busy 64 MiB) runs the release logic. Reserved memory must stay at 192 MiB. Fails on current clr develop (reserved drops to ~64 MiB), passes with ROCm/clr#287 applied. Runtime defect tracked in ROCm/rocm-systems#11690.
5 tasks
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.
Regression test for ROCm/rocm-systems#11690, fixed by ROCm/clr#287.
Pinning
hipMemPoolAttrReleaseThresholdtoUINT64_MAXmust stop the pool from releasing any reserved memory, including when the free-pressure path fires. On current clr develop the threshold is silently dropped on the release paths (VmHeap::TrimPhysMemoryoverwrites it with the caller's value,VmHeapArray::SetUnmapThresholdnever reaches lazily created heaps, and the two-argHeap::ReleaseAllMemorynever consults it), so reserved bytes fall right after the frees.The test pins the threshold on the default pool (readback confirms), reserves 3 x 64 MiB with a touch kernel, then frees A+B, lets the free markers retire on the idle stream, and frees C so the pressure path (freed 128 MiB > busy 64 MiB) runs the release logic. Reserved memory must stay at 192 MiB.
Red/green on RX 9070 XT (gfx1201), ROCm 7.2.1, MemoryTest2 built from this branch (three unrelated files excluded locally:
hipMemPrefetchBatchAsync.cc,hipMemGetMemPool.cc,hipMemSetMemPool.ccneed HIP headers newer than 7.2.1):DEBUG_HIP_MEM_POOL_VMHEAP=0(direct alloc path)DEBUG_HIP_MEM_POOL_VMHEAP=0The two stock rows cover the VM heap release paths and the direct-allocation path separately; both fail without the fix, so the test would have caught all three defect sites.