fix(io): bound EventPool free-list to avoid HSA signal exhaustion#491
Draft
AMD-yanfeiwang wants to merge 1 commit into
Draft
fix(io): bound EventPool free-list to avoid HSA signal exhaustion#491AMD-yanfeiwang wants to merge 1 commit into
AMD-yanfeiwang wants to merge 1 commit into
Conversation
EventPool::GetEvent creates a new hipEvent whenever the free-list is empty and PutEvent pushed it back with no upper bound. Under a bursty workload (e.g. PD KV-transfer under sustained load) the free-list grows to the concurrency peak and is never reclaimed, so the per-process HSA signal / KFD event budget can be exhausted. That surfaces as HSA_STATUS_ERROR_OUT_OF_RESOURCES on an unrelated queue op even while GPU memory is free. Cap the retained free-list per device (default max(8*numEvents, 512), never below numEvents); events returned above the cap are destroyed instead of cached, keeping the steady-state signal footprint bounded.
This was referenced Jul 20, 2026
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
EventPool(used by the fabric/xgmi IO backends) can grow its cached free-list without bound:GetEventallocates a newhipEventwhen the pool is empty, andPutEventreturned it with no cap. Under a bursty workload the free-list inflates to the concurrency peak and is never reclaimed, so the per-process HSA signal / KFD event budget can be exhausted — reported by the ROCm runtime asHSA_STATUS_ERROR_OUT_OF_RESOURCESon an unrelated queue op even though GPU memory is free.Change
maxEventsPerDevice_, defaultmax(8*numEvents, 512), never belownumEvents).PutEventdestroys surplus events above the cap instead of caching them, bounding the steady-state signal footprint.GetEventstill allocates on demand so callers always get a valid event.Test plan
HSA_STATUS_ERROR_OUT_OF_RESOURCES.