[auto-merge] release/25.10 to main [skip ci] [bot]#996
Merged
Conversation
Signed-off-by: nvauto <70000568+nvauto@users.noreply.github.com>
This is needed to avoid race condition segfaults with SAM when SAM headroom is reduced from its initial larger value during data loading to a smaller value during computations. --------- Signed-off-by: Erik Ordentlich <eordentlich@gmail.com>
Collaborator
Author
|
SUCCESS - auto-merge |
Contributor
Greptile OverviewGreptile SummaryThis auto-merge PR from Key Changes:
The fix ensures that old memory resources are retained for the lifetime of the process, allowing C++ allocations using them to safely invoke deallocation methods, preventing segfaults. Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Estimator as ML Estimator (KMeans/UMAP/etc)
participant ConfigMem as _configure_memory_resource()
participant GlobalState as Global State (_old_memory_resources, _last_sam_headroom_size)
participant RMM as RMM Memory Resource
Note over Estimator: Data Loading Phase
Estimator->>ConfigMem: Call with larger SAM headroom (2x)
ConfigMem->>RMM: get_current_device_resource()
RMM-->>ConfigMem: Current resource
ConfigMem->>GlobalState: Append old resource to _old_memory_resources
ConfigMem->>GlobalState: Update _last_sam_headroom_size
ConfigMem->>RMM: set_current_device_resource(new SAM with larger headroom)
Note over Estimator: Computation Phase
Estimator->>ConfigMem: Call with smaller SAM headroom (1x)
ConfigMem->>GlobalState: Check if sam_headroom != _last_sam_headroom_size
Note over ConfigMem: Headroom changed, need new resource
ConfigMem->>RMM: get_current_device_resource()
RMM-->>ConfigMem: Current resource
ConfigMem->>GlobalState: Append old resource to _old_memory_resources
ConfigMem->>GlobalState: Update _last_sam_headroom_size
ConfigMem->>RMM: set_current_device_resource(new SAM with smaller headroom)
Note over GlobalState: Old resources retained for deallocation safety
Note over GlobalState: Prevents segfaults from C++ deallocations
|
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.
auto-merge triggered by github actions on
release/25.10to create a PR keepingmainup-to-date. If this PR is unable to be merged due to conflicts, it will remain open until manually fix.