Fix require_backends_available to reenable distributed tests #101704
Closed
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.
Stack from ghstack (oldest at bottom):
TLDR
Fix decorator to re-enable 26+ distributed tests that were previously being skipped in CI
Explanation
As part of the UCC upstream, we updated the backend tests cases to also include "ucc".
pytorch/torch/testing/_internal/common_distributed.py
Lines 90 to 92 in 3ed1569
In distributed tests we use a decorator which reads from this config and makes sure all backends are available on the system.
pytorch/torch/testing/_internal/distributed/distributed_test.py
Line 7131 in 3ed1569
However, UCC is not configured on by default for a certain subset of CI tests, which causes the entire test to be skipped (even if the test is meant for nccl and the backend being tested is nccl).
As the fix, we should just check that only the
BACKEND
being tested is availableChanges
require_backends_available
->require_backend_is_available