Skip to content

[SymmMem] Fix memory allocation hold-up#163375

Merged
Camyll merged 1 commit intorelease/2.9from
cherry-pick-162680-by-pytorch_bot_bot_
Sep 26, 2025
Merged

[SymmMem] Fix memory allocation hold-up#163375
Camyll merged 1 commit intorelease/2.9from
cherry-pick-162680-by-pytorch_bot_bot_

Conversation

@pytorchbot
Copy link
Collaborator

Stack from ghstack (oldest at bottom):

Problem:
Without MemPool it looks like nvshmem backend never deallocates memory.

Cause:
Handles in symm_mems_ (a map) keeps reference to memory allocations.

Solution:

  • Remove reference to allocation from handles -- the reference is never used anyway.
  • Use unique_ptr instead of shared_ptr to wrap allocation to ensure single ownership.

cc @H-Huang @awgu @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @pragupta @ezyang @msaroufim @dcci

Problem:
Without MemPool it looks like nvshmem backend never deallocates memory.

Cause:
Handles in `symm_mems_` (a map) keeps reference to memory allocations.

Solution:
- Remove reference to allocation from handles -- the reference is never used anyway.
- Use `unique_ptr` instead of `shared_ptr` to wrap allocation to ensure single ownership.

Pull Request resolved: #162680
Approved by: https://github.com/ezyang
ghstack dependencies: #163298

(cherry picked from commit 7130b17)
@pytorch-bot
Copy link

pytorch-bot bot commented Sep 19, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/163375

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure

As of commit 7569835 with merge base 4840a1a (image):

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added ciflow/h100-symm-mem oncall: distributed Add this issue/PR to distributed oncall triage queue release notes: distributed (c10d) release notes category labels Sep 19, 2025
@Camyll Camyll merged commit daa3d04 into release/2.9 Sep 26, 2025
94 of 95 checks passed
@github-actions github-actions bot deleted the cherry-pick-162680-by-pytorch_bot_bot_ branch October 27, 2025 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/h100-symm-mem oncall: distributed Add this issue/PR to distributed oncall triage queue open source release notes: distributed (c10d) release notes category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants