-
Notifications
You must be signed in to change notification settings - Fork 967
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
Add NUMA affinity control for NVIDIA GPUs #2535
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Zach, for enabling NUMA affinity control to be easily enabled with accelerate. I have no experience whatsoever with numactl, so I skipped those specific parts of the review and focused on the rest.
@stas00 I think this should fully enable you now. You can either set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot. The code LGTM. Regarding whether this solves the initial problem, I defer to Stas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good code-wise, but I won't have a chance to try it out till next week as I'm on the road.
Did you get a chance to test it on the H100 nodes at HF? If so it's probably good to go. If not and you don't mind waiting I will test next week.
Despite my best efforts couldn't get away from using pynvml 😭 However it seems to come auto-installed (probably with PyTorch?) so did a simple import check. As we get more libs/backend support we can look at appropriate interfaces rather than reinvent the wheel :) |
Confirmed with @stas00 the load balancing looks proper, once tests pass will merge ✅ |
What does this PR do?
This PR adds the ability to launch using
numactl
, which acts as an inbetween stage when launching fromtorchrun
etc.Before:
After:
accelerate launch --num_processes 8 --monitor-interaval 1 --enable-numa-affinity python3 -c "print('hello')"
Or through the config:
Fixes #2241
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@BenjaminBossan @stas00