Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move the setting of PYTORCH_CUDA_ALLOC_CONF to the cli rather than train module #2183

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

winglian
Copy link
Collaborator

noticed in the profiler that it said this wasn't set and moving it around reduced the reserved memory in the configuration I was using from 37GB to 27GB

Copy link
Contributor

@djsaunde djsaunde left a comment

Choose a reason for hiding this comment

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

Maybe some subprocess weirdness? As long as it works.

if os.getenv("PYTORCH_CUDA_ALLOC_CONF") is None:
os.environ[
"PYTORCH_CUDA_ALLOC_CONF"
] = "expandable_segments:True,roundup_power2_divisions:16"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm just reading about this: roundup_power2_divisions config. Is there a reason we're setting 16? I saw that the default was 512.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The default is 1 from what I've seen.

The doc you were reading says : the sizes are rounded up in multiple of blocks size of 512

Which is the block size, not the divisions

@winglian winglian force-pushed the pytorch-cuda-alloc-conf branch from 1fb37c2 to 0e0c6d7 Compare December 17, 2024 16:31
@winglian winglian merged commit 8ddc18e into main Dec 17, 2024
11 checks passed
@winglian winglian deleted the pytorch-cuda-alloc-conf branch December 17, 2024 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants