-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Fabric: add support for 'auto' accelerator #20473
base: master
Are you sure you want to change the base?
Fabric: add support for 'auto' accelerator #20473
Conversation
for more information, see https://pre-commit.ci
Thanks for the draft PR! So if you don't specify |
Thanks for the information! I'm not sure if I understand it correctly. I ran a quick test on |
Auto-detection of the accelerator type (cpu vs cuda, etc) will only happen of accelerator is None, so adding to the list will only make it allowed but then it will not trigger autodetection. What you are referring to is auto detection of the number of devices. In theory not specifying accelerator and devices should detect gpus and set devices to the number of gpus available. If that’s not the case we need to fix it. |
Thanks for clarifying! Here’s where I’m confused: if the auto-detection of the accelerator works correctly, I expect However, if I leave |
yes you are right: the logic that handles accelerators when None is provided is triggered later |
In that case, which file should we update to support |
What does this PR do?
This PR adds support for
--accelerator=auto
in the Fabric CLI. Whenauto
is passed as the accelerator, the code now dynamically resolves it to the best available hardware accelerator:cuda
if GPUs are available.mps
for Apple Silicon machines.cpu
if no accelerators are available.This ensures that users can specify
--accelerator=auto
without needing to manually detect hardware availability.Fixes Issue #20451
No breaking changes introduced.
Before submitting