Repository navigation
Explicit error if devices: auto & >1 GPU available and if devices >1 - #532
Merged
Merged
Conversation
felix-e-h-p
reviewed
Jun 25, 2026
felix-e-h-p
requested changes
Jun 25, 2026
felix-e-h-p
left a comment
Contributor
There was a problem hiding this comment.
Looking good, thanks for this! One small change if all OK.
felix-e-h-p
requested changes
Jun 25, 2026
felix-e-h-p
left a comment
Contributor
There was a problem hiding this comment.
Maybe one small change in tests also
- Check available CUDA GPU count before rejecting trainer configs. - Reject `devices: "auto"` only when multiple GPUs are available. - Reject explicit multi-GPU configs such as `devices: 2` and `devices: [0, 1]` when multiple GPUs are available. - Allow safe configs such as `devices: 1`, `devices: [0]`, and `accelerator: cpu`. Testing: - `uv run python -m pytest tests/models/test_validation.py` - test validate gpu config rejects multi gpu configs when mutliple gpus available - test validate gpu config allows configs when only one gpu available - test validate gpu config allows single device configs
felix-e-h-p
approved these changes
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Summary of changes:
devices: "auto"only when multiple GPUs are available.devices: 2anddevices: [0, 1]when multiple GPUs are available.devices: 1,devices: [0], andaccelerator: cpu.Change motivated by non explicit error previously being raised and discussion during ML chat
Fixes
Testing:
uv run python -m pytest tests/models/test_validation.pytest validate gpu config rejects multi gpu configs when mutliple gpus available
test validate gpu config allows configs when only one gpu available
test validate gpu config allows single device configs
Yes
Checklist: