KEMBAR78
Fix AllocatorConfig potential SIO issue by guangyey · Pull Request #159629 · pytorch/pytorch · GitHub
Skip to content

Conversation

@guangyey
Copy link
Collaborator

@guangyey guangyey commented Aug 1, 2025

Stack from ghstack (oldest at bottom):

Motivation

As @ScottTodd identified in this comment, using STL containers like std::string and std::unordered_set at static init time can cause static initialization order issues. This PR is based on and modified from his original PR: #159607. I’m stacking this PR here to help facilitate the landing and validation process.

Co-authored-by: @ScottTodd

@pytorch-bot
Copy link

pytorch-bot bot commented Aug 1, 2025

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ You can merge normally! (1 Unrelated Failure)

As of commit aa82528 with merge base bb67660 (image):

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

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

[ghstack-poisoned]
Copy link
Contributor

@ScottTodd ScottTodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, this fixes the issues detected downstream.

@guangyey
Copy link
Collaborator Author

guangyey commented Aug 4, 2025

@albanD May I know if you have any comments on this fix.

Copy link
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@guangyey
Copy link
Collaborator Author

guangyey commented Aug 5, 2025

@albanD Thanks for your support. I really appreciate it.

@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #156175

3 similar comments
@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #156175

@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #156175

@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #156175

pytorchmergebot pushed a commit that referenced this pull request Aug 5, 2025
…0312)

# Motivation
Refactor `CUDAAllocatorConfig` to reuse `AcceleratorAllocatorConfig` and `ConfigTokenizer`. We would deprecate those option that overleap with `AcceleratorAllocatorConfig` in the following PR and keep them only for BC.

Pull Request resolved: #150312
Approved by: https://github.com/albanD
ghstack dependencies: #159629
pytorchmergebot pushed a commit that referenced this pull request Aug 5, 2025
…llocatorConfig instead (#156165)

Pull Request resolved: #156165
Approved by: https://github.com/albanD
ghstack dependencies: #159629, #150312
pytorchmergebot pushed a commit that referenced this pull request Aug 5, 2025
# Motivation
This PR moves the implementation of `torch.cuda.memory._set_allocator_settings` to `torch._C._accelerator_setAllocatorSettings`.
Since the original API was intended as a temporary/internal utility, I am not exposing the new function as a public API.

Pull Request resolved: #156175
Approved by: https://github.com/albanD
ghstack dependencies: #159629, #150312, #156165
@github-actions github-actions bot deleted the gh/guangyey/177/head branch September 5, 2025 02:09
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
# Motivation
As @ScottTodd identified in this [comment](pytorch#150312 (comment)), using STL containers like `std::string` and `std::unordered_set` at static init time can cause static initialization order issues. This PR is based on and modified from his original PR: pytorch#159607. I’m stacking this PR here to help facilitate the landing and validation process.

Co-authored-by: @ScottTodd
Pull Request resolved: pytorch#159629
Approved by: https://github.com/ScottTodd, https://github.com/albanD
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
…orch#150312)

# Motivation
Refactor `CUDAAllocatorConfig` to reuse `AcceleratorAllocatorConfig` and `ConfigTokenizer`. We would deprecate those option that overleap with `AcceleratorAllocatorConfig` in the following PR and keep them only for BC.

Pull Request resolved: pytorch#150312
Approved by: https://github.com/albanD
ghstack dependencies: pytorch#159629
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
…6175)

# Motivation
This PR moves the implementation of `torch.cuda.memory._set_allocator_settings` to `torch._C._accelerator_setAllocatorSettings`.
Since the original API was intended as a temporary/internal utility, I am not exposing the new function as a public API.

Pull Request resolved: pytorch#156175
Approved by: https://github.com/albanD
ghstack dependencies: pytorch#159629, pytorch#150312, pytorch#156165
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged open source release notes: cpp release notes category topic: bug fixes topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants