Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/192764
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 1fe0ec5 with merge base 567c801 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot label "module: tests/distributed" |
| @requires_nccl_version((2, 28), "Need NCCL 2.28+ for CE collectives") | ||
| @requires_cuda_p2p_access() | ||
| class NCCLCopyEngineCollectives(MultiProcContinuousTest): | ||
| hw_classification = HardwareClassification.CUDA |
There was a problem hiding this comment.
Current test case use symmetric memory with nccl backend. So it's cuda specific, and the label is right.
There was a problem hiding this comment.
Need to use instantiate_device_type_tests to instantiate current class.
5f7ba54 to
d6305fe
Compare
KarhouTam
left a comment
There was a problem hiding this comment.
CUDA specific class also needs instantiate_device_type_tests and every test cases to have the arg device.
cfb7166 to
29cd190
Compare
|
Thanks @wjlFlyer and @KarhouTam for the review! Addressed in the latest push (29cd190):
|
29cd190 to
1fe0ec5
Compare
Label the NCCLCopyEngineCollectives test class with
hw_classification = HardwareClassification.CUDA and instantiate it with
instantiate_device_type_tests(only_for="cuda").
All test methods now accept a device parameter (injected by
instantiate_device_type_tests). The self.device property-based references
are replaced with torch.device(f"{device}:{self.rank}").
The class exercises NCCL Copy Engine collectives (NCCL 2.28+,
requires_cuda_p2p_access, symm_mem rendezvous, torch.device("cuda")),
which is CUDA-specific, so only_for="cuda" is correct per the TEST_LINTER
rule.
Test Plan:
- python -m py_compile test/distributed/test_ce_colls.py passes.
- lintrunner test/distributed/test_ce_colls.py passes (exit 0).
- Test count unchanged: 2 def test_* methods.
- Both test methods accept device parameter.
- instantiate_device_type_tests(only_for="cuda") added.
|
Thanks @KarhouTam! You are right — Fixed in the latest push (1fe0ec5): kept the |
|
@pytorchbot merge |
Merge failedReason: Approvers from one of the following sets are needed:
|
Dismissing my approval to avoid accidental merging. Another maintainer’s approval is still required before merging.
|
@pytorchbot merge -i |
Merge failedReason: Approvers from one of the following sets are needed:
|
can-gaa-hou
left a comment
There was a problem hiding this comment.
overall lgtm minor some small nits
| @skip_if_lt_x_gpu(2) | ||
| @skip_if_rocm_ver_atleast_multiprocess([7, 14]) | ||
| def test_ce_allgather(self): | ||
| def test_ce_allgather(self, device): |
There was a problem hiding this comment.
device is not needed anymore if not used when in cuda only test, please revert it
| @skip_if_lt_x_gpu(2) | ||
| @skip_if_rocm_ver_atleast_multiprocess([7, 14]) | ||
| def test_ce_alltoall(self): | ||
| def test_ce_alltoall(self, device): |
|
@pytorchbot merge |
Merge failedReason: Approvers from one of the following sets are needed:
|
| self.assertEqual(out2, out_golden) | ||
|
|
||
|
|
||
| instantiate_device_type_tests(NCCLCopyEngineCollectives, globals(), only_for="cuda") |
There was a problem hiding this comment.
I think for this class, purely adding hw label is enough. No need to add device arg and instantiate_device_type_tests for it.
fffrog
left a comment
There was a problem hiding this comment.
SGTM
Remove this file from test_linter_allowlist.json please
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Summary
test/distributed/test_ce_colls.pycontains a singleTestCasesubclass,NCCLCopyEngineCollectives, that was previously unclassified. This PR addshw_classification = HardwareClassification.CUDAand instantiates it withinstantiate_device_type_tests(only_for="cuda").Changes
test/distributed/test_ce_colls.py:HardwareClassificationto thecommon_utilsimport block.instantiate_device_type_testsimport fromcommon_device_type.NCCLCopyEngineCollectiveswithhw_classification = HardwareClassification.CUDA.instantiate_device_type_tests(NCCLCopyEngineCollectives, globals(), only_for="cuda")at file end.test_*methods now accept adeviceparameter (injected byinstantiate_device_type_tests).self.deviceproperty references withtorch.device(f"{device}:{self.rank}")in test method bodies.No test logic or decorators are changed.
torch.cuda.current_stream()/torch.cuda.Stream()are kept (only_for="cuda" guarantees CUDA).Motivation
PR #190991 established the convention that every
TestCasesubclass must carry ahw_classificationattribute. PR #190173 (TEST_LINTER) requires that CUDA classes must useinstantiate_device_type_testswithonly_for="cuda"and every test method must accept adeviceparameter.NCCLCopyEngineCollectivesexercises NCCL Copy Engine collectives (NCCL 2.28+,requires_cuda_p2p_access,symm_memrendezvous), which is CUDA-specific.Dependencies
None.
Test Plan
python -m py_compile test/distributed/test_ce_colls.pypasses.lintrunner test/distributed/test_ce_colls.pypasses (exit 0).def test_*methods.deviceparameter.instantiate_device_type_tests(only_for="cuda")added.cc @fffrog @wjlFlyer @pjyFight @FuDdd @lyriexs666 @jishuangfeng @JamesD18 @JiasenTian