Repository navigation
[ROCm] Clear MI200 test gates after root-causing each one - #196674
pablo-garay wants to merge 6 commits into
Conversation
test_tcp constructed _WorkerServer("", 1234) and then fetched http://localhost:1234/handler/. The empty host is resolved with AI_PASSIVE, which on the ROCm CI runners binds IPv6-only: [::1] answers 200 while 127.0.0.1 is connection-refused. Python's getaddrinfo("localhost") returns only 127.0.0.1 there, so requests.get raised ConnectionError and the test failed. curl passed on the same box because happy-eyeballs falls back to ::1, which is why this looked like a runner setup problem rather than a test bug, matching the note in DISABLED pytorch#144689 about the self-hosted runner setup blocking the port. The hardcoded port 1234 was a second, latent failure mode: shared runners can already have it bound.
Binding to ("127.0.0.1", 0) and reading the assigned port back through the existing _WorkerServer.port property removes both the address-family mismatch and the port-collision risk on every platform, so the skipIfRocmArch(MI200_ARCH) gate and its now-orphaned imports go away with it. Nothing here is gfx90a-specific; the arch gate was hiding an environment bug.
Test Plan:
Run on a 4x gfx90a (MI250X) host, ROCm 7.14.
x25 isolated, 25/25 pass:
```
for i in $(seq 1 25); do python test/distributed/elastic/test_control_plane.py WorkerServerTest.test_tcp; done
```
Class and full file, 12 tests:
```
python test/distributed/elastic/test_control_plane.py WorkerServerTest
python test/distributed/elastic/test_control_plane.py
```
The one failure there, WorkerServerTest.test_fr_dump_file_without_rank, is unrelated to this change and reproduces identically on the unmodified file on the same box.
This change was authored with the assistance of Claude, an AI assistant, and reviewed by me.
Both MI200 gates in TestExternKernelCaller were introduced without a root cause: test_extern_kernel_benchmark_valid_timing came from pytorch#170205 ("Get MI200 CI green again") and test_extern_kernel_caller_hash_key_deduplication from pytorch#162803. Neither test has a gfx90a-specific failure mode on record, and the autotune-counter assertion that would be the obvious ROCm hazard is already gated on torch.version.hip inside the test. Stress runs on a gfx90a host are clean, so the gates are removed and the now-orphaned imports go with them. The DISABLED issue pytorch#188668 for test_extern_kernel_benchmark_valid_timing is not MI200 evidence: it postdates the MI200 skip, so the flakiness it tracks was observed on the ROCm architectures that still run the test. That test is separately flaky on gfx942 for a Triton codegen reason that is being handled on its own; this commit only removes the MI200 architecture gate and does not touch that path. Test Plan: Run on a 4x gfx90a (MI250X) host, ROCm 7.14. x25 isolated for each test, 25/25 pass each: ``` for i in $(seq 1 25); do python test/inductor/test_select_algorithm.py TestExternKernelCaller.test_extern_kernel_benchmark_valid_timing; done for i in $(seq 1 25); do python test/inductor/test_select_algorithm.py TestExternKernelCaller.test_extern_kernel_caller_hash_key_deduplication; done ``` Class, 5 tests, and full file, 48 tests: ``` python test/inductor/test_select_algorithm.py TestExternKernelCaller python test/inductor/test_select_algorithm.py ``` The class run is clean. The two errors in the full-file run are in TestGetInputsAddmmBias and TestTemplateRender, which this change does not touch, and are unrelated to it. This change was authored with the assistance of Claude, an AI assistant, and reviewed by me.
test_fully_shard_training_overlap was gated on MI200 by pytorch#164390 on the strength of DISABLED pytorch#134139, which dates to the ROCm 6.1 era, and test_fully_shard_backward_comm_overlap was born with the gate in pytorch#186335 without ever having been observed failing on gfx90a. Both are clean under stress on a current ROCm stack, so the gates are removed. The two TestFullyShardPerParamMeshOverlap gates stay. Those tests hang on gfx90a reproducibly and at a 100% rate: three process groups wedge concurrently with matching per-rank sequence numbers, all communicator initialization completed, and the stuck ranks show HSA queues whose read pointer is frozen behind partially written packets. That is a RCCL host-callback launch-tracking deadlock rather than anything PyTorch enqueues incorrectly, filed as ROCm/rccl#2191, and the skip comments now cite it so the next reader does not have to rediscover the reason. Test Plan: Run on a 4x gfx90a (MI250X) host, ROCm 7.14, at the CI world size. x25 isolated for each unskipped test, 25/25 pass each: ``` for i in $(seq 1 25); do python test/distributed/_composable/fsdp/test_fully_shard_overlap.py TestFullyShardOverlap.test_fully_shard_training_overlap; done for i in $(seq 1 25); do python test/distributed/_composable/fsdp/test_fully_shard_overlap.py TestFullyShardOverlap.test_fully_shard_backward_comm_overlap; done ``` Full file, 6 tests, clean, with the two per-param-mesh tests and one pre-existing unrelated test still skipped: ``` python test/distributed/_composable/fsdp/test_fully_shard_overlap.py ``` This change was authored with the assistance of Claude, an AI assistant, and reviewed by me.
_test_grad_layout compares a DDP model against a full-batch reference, so on gfx90a the fp16 half of the parametrization fails at the current 3.0e-3 tolerance. The failure is deterministic, not flaky: both ranks report the same 1 of 512 mismatched element with an absolute difference of 0.0030670166015625 at the same index, and it reproduces byte for byte across machines, images and builds. The relative tolerance never engages because the element is near zero. The cause is not fp16 arithmetic. A CPU fp16 run of the same four-layer network tracks fp64 to 7e-6, while the MIOpen GPU run is off by 2.5e-3 on a gradient whose maximum magnitude is only 5.4e-3. Per-op bisection with identical fp16 inputs puts the loss in conv1's data and weight gradients, which is then amplified across conv0's 1568-term reduction, and MIOPEN_DEBUG_CONV_IMPLICIT_GEMM=0 drops those errors by about 70x and makes the test pass. The solvers responsible are ConvHipImplicitGemmGroupBwdXdlops and ConvHipImplicitGemmGroupWrwXdlops, which MIOpen's heuristics select for these shapes on gfx90a but not on newer architectures, which is why only MI200 sees this. It is filed as ROCm/rocm-libraries#11938. The new tolerance is measured rather than fitted to the observed failure: over a 31 seed sweep of the DDP versus full-batch pair, the worst pair difference is 3.8e-3 and each side is up to 4.7e-3 away from a fp64 reference, so the bound on what the comparison can legitimately see is roughly 7.4e-3, rounded to 8.0e-3. It applies only when the parametrization is fp16 and only on gfx90a, so CUDA and every other ROCm architecture keep the 3.0e-3 tolerance. The architecture query is done inside the test body: this file asserts in its main block that the parent process has not initialized CUDA, so a decorator that probes the device at import time would break every distributed shard. Test Plan: Run on a 4x gfx90a (MI250X) host, ROCm 7.14, at the CI world size. x25 isolated for each test, 25/25 pass each; before this change the one-device case fails 10 out of 10 with the difference quoted above: ``` for i in $(seq 1 25); do python test/distributed/test_c10d_nccl.py DistributedDataParallelTest.test_grad_layout_1devicemodule_1replicaperprocess; done for i in $(seq 1 25); do python test/distributed/test_c10d_nccl.py DistributedDataParallelTest.test_grad_layout_2devicemodule; done ``` Full file, 287 tests: ``` python test/distributed/test_c10d_nccl.py ``` DistributedDataParallelTest is clean there. The remaining errors are all in NCCLTraceTest and ProcessGroupNCCLGroupTest, are unrelated to this change, and reproduce identically on the unmodified file on the same box. This change was authored with the assistance of Claude, an AI assistant, and reviewed by me.
test_deleted_mempool_not_used_on_oom carries both an unconditional Linux skip for pytorch#176145 and an MI200 architecture skip from pytorch#170205 ("Get MI200 CI green again"). The Linux gate subsumes the architecture gate on every configuration that runs this test in CI, so the MI200 line has never had an effect; removing it changes no test selection and leaves one fewer unexplained ROCm gate behind. Stress runs on gfx90a with both gates bypassed are clean, so nothing is being papered over. The Linux gate stays as is. pytorch#176145 tracked flakiness on CUDA Linux as well, so re-enabling it is not a ROCm call to make. Test Plan: Run on a 4x gfx90a (MI250X) host, ROCm 7.14, with both gates bypassed locally so the test actually executes. x25 isolated, 25/25 pass: ``` for i in $(seq 1 25); do python test/test_cuda.py TestMemPool.test_deleted_mempool_not_used_on_oom; done ``` Class, 32 tests, clean, and full file, 440 tests: ``` python test/test_cuda.py TestMemPool python test/test_cuda.py ``` The three failures in the full-file run are test_host_memory_stats_active_after_event_drain, test_host_memory_stats_active_after_free_no_events and test_mempool_ctx_multithread. All three reproduce identically with the test still skipped, so they are pre-existing and unrelated; test_mempool_ctx_multithread in particular passes in the class-only run, which makes it an ordering artifact rather than fallout from letting this test execute. This change was authored with the assistance of Claude, an AI assistant, and reviewed by me.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/196674
Note: Links to docs will display an error until the docs builds have been completed. ⏳ 1 Pending, 1 Unrelated FailureAs of commit 8717774 with merge base 0929b23 ( UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
|
|
@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 |
Merge failedReason: Command Details for Dev Infra teamRaised by workflow job |
# Conflicts: # test/inductor/test_select_algorithm.py
|
@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 |
This test is the third member of the gfx950 CI-runner failure family already skipped on that arch in this PR (test_mempool_large_alloc_barrier and test_mempool_recycled_alloc_signal_pad). It rendezvouses a MemPool-allocated tensor and then calls one_shot_all_reduce, whose first device-side atomic on the peer's signal pad never completes on the SR-IOV virtual functions the mi350 distributed runners expose. The test hangs until the 600s per-test timeout and both retries then hang for a further 30 minutes each, so a single test burned 90 minutes of the shard.
Root cause is the same unresolved runner P2P path, not the test: the same code passes on gfx950 outside those runners and on the mi300 runners running the same image. Skipping on gfx950 keeps the ROCm coverage this PR restores on mi200/mi300 while removing the hang.
The alternative was to leave the test unskipped and rely on the timeout, but a consistently hanging test provides no signal and makes the shard's wall-clock unpredictable, so the targeted arch skip is preferable.
Test Plan:
The gfx950 path cannot be exercised locally (this host is gfx90a), so the skip itself is verified in CI; the mi350 log already shows the sibling tests reporting `skip_if_rocm_arch_multiprocess: test skipped on ('gfx950',)`.
Locally on gfx90a, confirming the suite still collects and the non-gfx950 behavior is unchanged:
```
python test/distributed/test_symmetric_memory.py -k SymmMemPoolTest -v
```
Also confirmed the mi200 failure reported on this PR is fixed by merging main (the MI200 fp16 grad tolerance bump from pytorch#196674), not by any change here:
```
python test/distributed/test_c10d_nccl.py DistributedDataParallelTest.test_grad_layout_1devicemodule_1replicaperprocess
```
Lint:
```
lintrunner -a test/distributed/test_symmetric_memory.py test/distributed/test_c10d_nccl.py test/distributed/checkpoint/_experimental/test_checkpointer.py
```
This commit was authored with the assistance of Claude.
Clears six MI200 (gfx90a) test gates and widens one tolerance. Each was root-caused on a 4x gfx90a host first; the two MI200 skips that turned out to be real library bugs stay, now with issue links.
test_tcp(DISABLED DISABLED test_tcp (__main__.WorkerServerTest) #144689) was never a gfx90a problem._WorkerServer("", 1234)binds IPv6-only on the ROCm runners, wheregetaddrinfo("localhost")returns only127.0.0.1, so the request is refused; the hardcoded port was a second latent failure mode on shared runners. Binding("127.0.0.1", 0)and reading_WorkerServer.portfixes both on every platform, so the arch gate goes away with the bug.TestExternKernelCaller([ROCm][CI] skip tests for mi200 #170205, Revert "[ROCm][CI] skip test_max_autotune until resolved (#162496)" #162803): both gates were added with no recorded root cause, and neither test has a gfx90a-specific failure mode on record. The timing test's separate gfx942 flakiness is a Triton codegen bug handled in [ROCm] Skip test_extern_kernel_benchmark_valid_timing on gfx942 pending a Triton fix #196673.TestFullyShardOverlap: one gate is from a ROCm 6.1-era DISABLED issue (DISABLED test_fully_shard_training_overlap (__main__.TestFullyShardOverlap) #134139), the other was preemptive when the test landed ([FSDP2] Add set_separate_reduce_scatter_group (opt-in AG/RS overlap) #186335); both are clean under stress on a current stack. The twoTestFullyShardPerParamMeshOverlapgates stay - those hang 100% of the time on gfx90a with HSA queues frozen behind partially written packets, an RCCL launch-tracking deadlock filed as Multi-communicator concurrent collectives deadlock on gfx90a (FSDP2+TP); NCCL_LAUNCH_ORDER_IMPLICIT=1 rescues 2-comm case but not 3-comm ROCm/rccl#2191.test_deleted_mempool_not_used_on_oom: the MI200 gate is dead code under the unconditional Linux skip for DISABLED test_deleted_mempool_not_used_on_oom (__main__.TestMemPool) #176145 above it, so dropping it changes no test selection.The DDP fp16 grad-layout tolerance is the one real numerics change. On gfx90a the fp16 case fails deterministically at 3.0e-3, always the same 1-of-512 element at 3.067e-3 absolute, reproducing byte for byte across machines and builds. It is not fp16 arithmetic: a CPU fp16 run tracks fp64 to 7e-6 while the MIOpen GPU run is off by 2.5e-3 on a gradient whose maximum magnitude is 5.4e-3. Per-op bisection localizes it to conv1's data and weight gradients amplified through conv0's 1568-term reduction, and
MIOPEN_DEBUG_CONV_IMPLICIT_GEMM=0drops the error ~70x; the solvers areConvHipImplicitGemmGroup{Bwd,Wrw}Xdlops, which MIOpen picks for these shapes only on gfx90a. Filed as ROCm/rocm-libraries#11938. The 8.0e-3 bound is measured, not fitted: over a 31-seed sweep the worst DDP versus full-batch difference is 3.8e-3 with each side up to 4.7e-3 from an fp64 reference, bounding the comparison at ~7.4e-3. It applies only to fp16 on gfx90a; CUDA and every other ROCm architecture keep 3.0e-3.Test plan: on a 4x gfx90a (MI250X) host with ROCm 7.14, each affected test x25 in isolation, then its class, then the full file, plus lintrunner on every touched file. Every unskipped test is 25/25; the DDP fp16 case is 25/25 with the new tolerance and 0/10 without. Residual full-file failures reproduce identically on the unmodified files on that box. Cross-architecture coverage comes from the ciflow labels.
This description and the changes were authored with the assistance of Claude, an AI assistant, and reviewed by me.
cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @naromero77amd @pragupta @jerrymannil @xinyazhang @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben