-
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
Validate selected device indices in DeepSpeedStrategy
#17952
Conversation
for more information, see https://pre-commit.ci
…Lightning-AI/lightning into bugfix/deepspeed-device-index-selection
⚡ Required checks status: All passing 🟢Groups summary🟢 pytorch_lightning: Tests workflow
These checks are required after the changes to 🟢 pytorch_lightning: Azure GPU
These checks are required after the changes to 🟢 pytorch_lightning: Benchmarks
These checks are required after the changes to 🟢 fabric: Docs
These checks are required after the changes to 🟢 pytorch_lightning: Docs
These checks are required after the changes to 🟢 lightning_fabric: CPU workflowThese checks are required after the changes to 🟢 lightning_fabric: Azure GPU
These checks are required after the changes to 🟢 mypy
These checks are required after the changes to 🟢 installThese checks are required after the changes to 🟢 link-check
These checks are required after the changes to Thank you for your contribution! 💜
|
(cherry picked from commit 3f4790b)
(cherry picked from commit 3f4790b)
(cherry picked from commit 3f4790b)
What does this PR do?
Fixes #13566
Fixes #15066
In DeepSpeed, the assumption is that the model training happens on the device index that corresponds to the local rank:
https://github.com/microsoft/DeepSpeed/blob/fd1d2c64472c1a3061a05eb3b56a3f882199cfba/deepspeed/runtime/zero/partition_parameters.py#L841-L844
This means that the feature of the Trainer to select devices like
Trainer(devices=[2, 5])
can't be supported. In this PR, I'm adding the validation and error message with the advice to set the CUDA_VISIBLE_DEVICES flag instead.Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:
Reviewer checklist
cc @Borda @awaelchli @carmocca @justusschock