Skip to content

[ROCm] Skip test_extern_kernel_benchmark_valid_timing on gfx942 pending a Triton fix - #196673

Closed
pablo-garay wants to merge 1 commit into
pytorch:mainfrom
ROCm:jeffdaily/rocm-extern-kernel-pingpong-skip
Closed

pablo-garay wants to merge 1 commit into
pytorch:mainfrom
ROCm:jeffdaily/rocm-extern-kernel-pingpong-skip

Conversation

@pablo-garay

@pablo-garay pablo-garay commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

test_extern_kernel_benchmark_valid_timing flakes on mi300 CI (3 hard failures plus 11 retry-masked passes on main in one week) with "Incorrect result from choice TritonTemplateCaller(BLOCK_M=128, BLOCK_N=128, BLOCK_K=64, ..., num_warps=8, num_stages=2)": always that one candidate, always a 4x32 patch of one output tile. The cause is a Triton AMD backend bug on gfx942: the block-pingpong two-cluster schedule emits a raw s_barrier before the wait for the stage's LDS reads, so the other warp group overwrites the LDS buffer while reads are outstanding and the affected accumulator fragment consumes the next k-step's A tile. A plain-Triton matmul at that config fails 200/200 iterations on gfx942 and 0/200 with the schedule disabled; details and repro in triton-lang/triton#11696.

The knob cannot be applied per test because inductor's compile-worker pool forwards only the cache-dir variables, so this skips the test on gfx942 until the Triton fix lands and the pin is bumped. It keeps running on gfx950, which never takes this schedule; the MI200 gate on the same test is being lifted separately.

Test plan is in the commit message. gfx942 validation via the ciflow label below (expect the test to report skipped in the shard that runs test_select_algorithm.py).

This PR was authored with the assistance of an AI agent (Claude). The analysis and test results were verified by hand.

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

…ng a Triton fix

The test flakes on mi300 CI (3 hard failures and 11 retry-masked passes on main in the week of 2026-09-03) with "Incorrect result from choice TritonTemplateCaller(BLOCK_M=128, BLOCK_N=128, BLOCK_K=64, ..., num_warps=8, num_stages=2)": always that one autotune candidate, always 128 wrong elements forming a 4x32 patch of one output tile. Root cause is in the Triton AMD backend: on gfx942 the block-pingpong two-cluster schedule ends its first cluster with a raw s_barrier before the s_waitcnt for the stage's LDS reads, so the other warp group overwrites the single-stage LDS buffer while reads are outstanding, and the affected accumulator sub-fragment consumes the next k-step's A tile (every wrong element decodes to A[r, k + 64]). A plain-Triton matmul at that config fails 200/200 iterations on gfx942 and 0/200 with TRITON_HIP_USE_BLOCK_PINGPONG=0; the test itself fails 99/100 fresh-process runs vs 0/100. Reported as triton-lang/triton#11696.

The knob cannot be applied per test: inductor's compile-worker pool is spawned once and forwards only the cache-dir variables, so a per-test environment patch never reaches the compiler. Skip the test on gfx942 until the Triton fix lands and the pin is bumped; it keeps running on gfx950 (async-copy path, never takes this schedule) and the MI200 gate is handled separately.

Test plan (gfx950): PYTORCH_TEST_WITH_ROCM=1 python -m pytest test/inductor/test_select_algorithm.py -k test_extern_kernel_benchmark_valid_timing passes (not gfx942); with the arch tuple pointed at gfx950 it reports the skip. gfx942 via ciflow/rocm-mi300.

Authored with the assistance of an AI agent (Claude).
@pytorch-bot

pytorch-bot Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/196673

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 8b2de53 with merge base c0d27b7 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot

pytorch-bot Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Workflows were awaiting approval. CI has now been triggered for the ciflow labels on this PR.

@jithunnair-amd jithunnair-amd added ciflow/trunk Trigger trunk jobs on your pull request ciflow/rocm-mi300 Trigger "default" config CI on ROCm MI300 labels Sep 11, 2026
@jeffdaily

Copy link
Copy Markdown
Collaborator

@pytorchbot merge

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

pytorchmergebot pushed a commit that referenced this pull request Sep 14, 2026
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.

- **elastic `test_tcp`** (DISABLED #144689) was never a gfx90a problem. `_WorkerServer("", 1234)` binds IPv6-only on the ROCm runners, where `getaddrinfo("localhost")` returns only `127.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.port` fixes both on every platform, so the arch gate goes away with the bug.
- **`TestExternKernelCaller`** (#170205, #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 #196673.
- **`TestFullyShardOverlap`**: one gate is from a ROCm 6.1-era DISABLED issue (#134139), the other was preemptive when the test landed (#186335); both are clean under stress on a current stack. The two `TestFullyShardPerParamMeshOverlap` gates stay - those hang 100% of the time on gfx90a with HSA queues frozen behind partially written packets, an RCCL launch-tracking deadlock filed as ROCm/rccl#2191.
- **`test_deleted_mempool_not_used_on_oom`**: the MI200 gate is dead code under the unconditional Linux skip for #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=0` drops the error ~70x; the solvers are `ConvHipImplicitGemmGroup{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.

Pull Request resolved: #196674
Approved by: https://github.com/jeffdaily

Co-authored-by: Jeff Daily <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/inductor ciflow/rocm-mi300 Trigger "default" config CI on ROCm MI300 ciflow/trunk Trigger trunk jobs on your pull request Merged module: inductor module: rocm AMD GPU support for Pytorch open source topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants