Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/196525
Note: Links to docs will display an error until the docs builds have been completed. ❌ You can merge normally! (1 Unrelated Failure), 3 Unclassified FailuresAs of commit e2f720f with merge base 4d3ac9e ( UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
|
|
The following ciflow label(s) have been added but CI has not been triggered yet because the workflows are awaiting approval:
Once a maintainer approves the workflows (scroll to the bottom of the PR page), the corresponding CI jobs will be triggered automatically. Please ping one of the reviewers if you do not have access to approve and run workflows. |
3 similar comments
|
The following ciflow label(s) have been added but CI has not been triggered yet because the workflows are awaiting approval:
Once a maintainer approves the workflows (scroll to the bottom of the PR page), the corresponding CI jobs will be triggered automatically. Please ping one of the reviewers if you do not have access to approve and run workflows. |
|
The following ciflow label(s) have been added but CI has not been triggered yet because the workflows are awaiting approval:
Once a maintainer approves the workflows (scroll to the bottom of the PR page), the corresponding CI jobs will be triggered automatically. Please ping one of the reviewers if you do not have access to approve and run workflows. |
|
The following ciflow label(s) have been added but CI has not been triggered yet because the workflows are awaiting approval:
Once a maintainer approves the workflows (scroll to the bottom of the PR page), the corresponding CI jobs will be triggered automatically. Please ping one of the reviewers if you do not have access to approve and run workflows. |
Second of three PRs splitting the original gfx1250 Tensor Data Mover work. Depends on the dense MM PR, which lands the shared capability probe and descriptor primitives this consumes; nothing is re-declared here. Extends generic pointwise and reduction tensor-descriptor code generation to gfx1250 TDM: - use_gfx1250_descriptor_codegen composes the two existing descriptor opt-ins, config.triton.use_tensor_descriptor and config.assume_aligned_inputs, with the shared gfx1250 capability probe. It adds no AMD-specific switch: the same options that already enable descriptor codegen on CUDA/XPU enable it here. - TMACompatibilityChecker selects the TDM dtype set on a capable gfx1250 target and otherwise keeps the existing TMA policy unchanged, and applies the descriptor rank and int32 bounds on that path. - The capability probe result is cached per checker instance rather than process-wide, so a transient device-property failure cannot disable TDM for the whole process, and the probe is not repeated by every method that needs it. gfx1250 is probed before the CUDA/XPU predicate rather than alongside it. The probe result is cached per checker, whereas torch.cuda.get_device_capability() is not, and on ROCm device_type is also "cuda", so ordering it first avoids an uncached query in a checker invoked per load and store. The CUDA/XPU predicate itself is unchanged, including its assume_aligned_inputs requirement. The rank and int32 checks are scoped to the gfx1250 path with a comment explaining why. Rank 1-5 is a Triton descriptor API limit that the dense path already enforces in _is_tma_compatible, and the int32 rule requires a statically provable bound rather than merely an in-range hint; applying either to CUDA/XPU would change existing descriptor eligibility and belongs in its own change. Test coverage in this revision: - The negative-capability half of the checker-cache test was broken: with the probe false the checker continues into the shared TMA stride validation, which the fixture could not answer. It called an unmocked torch.cuda.get_device_capability(), a sizevars fake with no statically_known_equals, and an empty stride list. It now passes a complete descriptor whose final stride is deliberately non-unit, so the rejection happens before any tiling analysis and needs no device. - The backend dtype test now covers CUDA and XPU with the AMD probe false. FP8 and int32 are the discriminating dtypes: accepted on the shared TMA path and rejected on the narrower TDM path, which is what shows this change narrowed only the gfx1250 policy. - The force-path test now resolves a backed symbolic extent through its hint in both directions, and asserts a complete valid descriptor is accepted, so the negative cases cannot pass vacuously. - Three near-identical local fakes are replaced by shared _TDMFakeSizeVars and _tdm_fake_kernel helpers; incomplete fakes were the origin of the defect above. - New gfx1250 device cases: supported dtypes (FP16/BF16/FP32), non-tile-multiple tail shapes, an aligned row-slice view, and an unsuitable-layout fallback. The fallback case uses a stepped column slice rather than a transpose: descriptor construction sorts dimensions by stride before validation, so a transpose normalizes back to a unit innermost stride and stays eligible. Test Plan: - Static: ast.parse on all changed files; git diff --check clean; file scope verified to exactly the three expected files; 419 changed lines. - Equivalence of the backend-selection refactor: the CUDA/XPU predicate's AST is byte-identical to its previous form, and both function bodies agree on return value and on the ordered probe trace across all 64 combinations of device type, gfx1250 capability, CUDA major version, assume_aligned_inputs, use_tensor_descriptor and has_triton_stable_tma_api. A control that deletes assume_aligned_inputs fails that check on 8 cases, so it is not vacuous. - Host tests, development evidence only: all four generic descriptor host methods pass in an isolated harness that splices this working tree's changed functions and test bodies into an installed CPU wheel (torch 2.14.0+cu130, no GPU). The same harness run against the pre-repair source reproduces 3/4 with the fixture failure described above, so the pass is not vacuous. This is not a full-checkout run and does not satisfy the qualification gate. - NOT RUN in this environment (no built torch extension, no ROCm, no GPU, and neither spin nor lintrunner nor ruff installed): spin lint and lintrunner -a, the full-checkout ROCm host run of these tests, the CUDA and XPU coverage that TMACompatibilityChecker shares, every gfx1250 E2E case including all the new device cases added here, and performance measurements. All must pass before merge; mocked ROCm host tests are not sufficient for the shared checker path. *This description was drafted with AI assistance.* Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
f47cf8a to
4977bdb
Compare
naromero77amd
left a comment
There was a problem hiding this comment.
Approving since this is just a split from the original PR that had everything.
jeffdaily
left a comment
There was a problem hiding this comment.
Two small things on the shared codegen path, plus a housekeeping ask on the description. Neither code comment is about the gfx1250 logic itself, which is gated tightly enough that it cannot reach CUDA or XPU.
1.
torch/_inductor/codegen/triton.py:3014- restore the actionable detail in the debug message.The rewritten string drops the concrete requirements (
triton>=3.4.0,cc>=9.0) that a CUDA user needs in order to act on it, and replaces them with a mention of gfx1250 that is never relevant to them. This is the one user-visible change in the PR that reaches non-ROCm users. Suggest keeping the original text and appending the new clause:log.debug( "%s Requires triton>=3.4.0, a CUDA device with cc>=9.0 or an XPU device," " use_tensor_descriptor=True, and assume_aligned_inputs=True; or a" " TDM-capable gfx1250 target", self.failed_debug_prefix, )2.
torch/_inductor/codegen/triton.py:3063-3075- only resolveshapewhen it is used.Both the
forceand non-forcebranches now bindshape, but it is read only insideif self._gfx1250_capable(device):at line 3083. On CUDA that probe is always False, since_gfx1250_device_prereqsreturns early onnot torch.version.hip, so every forced descriptor on CUDA pays asimplify()plussubs()per dimension for a value that is then dead. Dropping both assignments and computing it at the point of use leaves the shared path unchanged:if self._gfx1250_capable(device): shape = ( [ V.graph.sizevars.replace_backed_symbols_with_hints(sz) for sz in block_params.shape ] if self.force else block_params.shape )3. Please update the PR description.
The body still reads "Opened as a draft ... That is why this is a draft" while the PR is marked ready for review and already carries an approval. It also lists the gfx1250 end-to-end cases, the ROCm host run, CUDA, XPU, performance measurements, and
lintrunner -aas NOT RUN. Sincerunning_on_tdm_device()skips every device test in upstream CI, the description is the only durable record of what was actually exercised. Please update it to state plainly which of those have since been run and which have not, so the next reader is not relying on a stale note.
This review comment was drafted with AI assistance.
|
@jeffdaily, I asked Codex to apply the plan for your review locally. Its update is quoted below.
Prepared with AI assistance. |
Restore actionable diagnostics and avoid resolving unused shape hints outside gfx1250. Make the mocked regression test backend independent. Test Plan: ``` spin lint -- torch/_inductor/codegen/triton.py test/inductor/test_max_autotune.py lintrunner -a --revision HEAD ``` Eight isolated host checks passed, including two negative controls. GPU qualification remains pending. Assisted by OpenAI Codex.
|
None of the 5 failures is caused by the PR's changes. |
jeffdaily
left a comment
There was a problem hiding this comment.
Re-reviewed 6022f9ca88d. Both of my earlier code asks are addressed, and I pulled the test-report artifacts for this head to confirm what actually ran: the four TestTDMConfigDenseAndGeneric host tests passed on gfx942 and gfx950, and the new ungated TestTensorDescriptorCompatibility tests passed on real CUDA 12.8 and 13.2. The gating itself I am satisfied with: has_triton_stable_tma_api() is unconditionally false on any ROCm build, so no ROCm device could reach this path before, and nothing existing changes behavior.
Two items left, plus one optional. Both blockers are about the gfx1250 qualification run rather than the gating logic.
1.
torch/_inductor/heuristics/triton_codegen/reduction.py:663-667- the device-TMANUM_STAGEScap now applies to gfx1250 for an NVIDIA-only reason.
if inductor_meta.get("uses_device_tma"): MAX_NUM_STAGES = 1, with the comment citing Triton's pipeliner andttng.tensormap_create. That op is NVIDIA-only; AMD lowers TDM through its own async ops. This PR is the first thing that makes a gfx1250 reduction kernel setuses_device_tma(triton.py:4495), andtriton.mix_order_reductiondefaults on in OSS, so enabling descriptors for generic reductions silently throttles gfx1250 mix-order reductions. Please measure this during qualification. If AMD does not need the cap, scope the gate to NVIDIA; otherwise the descriptor path can land slower than the fallback it replaces.2.
test/inductor/test_max_autotune.py:7284,7293,7313,7338- tighten the selection assertions to match the negative case.These assert the bare substring
"make_tensor_descriptor", while the fallback test at:7356correctly uses"tl.make_tensor_descriptor(in_ptr". The bare form matches any occurrence in the generated source, including the output-store descriptor, so it does not establish that the generic load selected a descriptor. SinceTestTDMEndToEndskips in all upstream CI, these are the only gfx1250 evidence that will exist, so a weak assertion here becomes a qualification report that overstates what was observed. The rest of the repo uses the qualified form (test_torchinductor_strided_blocks.py:1616,test_max_autotune_blackwell.py:132).3. Optional, non-blocking:
torch/_inductor/codegen/triton.py:2951-2971-_gfx1250_cachelooks like more machinery than the probe needs.A checker is constructed per load/store site (
triton.py:5029,5257,6490) and each method runs once per instance, so the memo can serve at most one hit, and none whencan_use_tma()returns false or whenforce=Truereturns early. On non-ROCm builds_gfx1250_device_prereqsbails ontorch.version.hipbefore touching device properties, so there is nothing to save there either. Callinguse_gfx1250_descriptor_codegen(device)at both sites would drop theinit=Falsedataclass field along with the twoassert_called_once()assertions, which currently pin a three-calls-per-checker pattern that production code never performs.
This review comment was drafted with AI assistance.
The four generic selection tests asserted the bare substring "make_tensor_descriptor". A descriptor for the contiguous output store is legal and expected on this path, so that substring is satisfied by the store alone: a kernel whose generic load fell back to scalar loads would still pass. Match the qualified form the fallback test in the same class already uses, "tl.make_tensor_descriptor(in_ptr", so each test establishes that an input load selected a descriptor rather than that a descriptor appears anywhere in the generated source. The dense MM tests are left alone. They are the template path and already pair their assertion with a load_tensor_descriptor check. Test Plan: - lintrunner -a on the changed file: no lint issues. - Host tests unaffected: the four TestTDMConfigDenseAndGeneric generic descriptor methods still pass in an isolated harness against an installed CPU wheel (torch 2.14.0+cu130). TestTensorDescriptorCompatibility is untouched. - NOT RUN: the changed assertions themselves. They live in TestTDMEndToEnd, which skips wherever running_on_tdm_device() is false, so they need gfx1250 hardware. They are strictly stronger than what they replace, but if inductor emits in_out_ptr0 through buffer reuse rather than in_ptr0 the prefix would not match; the aligned-view case is the most exposed. This must be confirmed by the gfx1250 qualification run. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Thanks — 1 and 2 make sense. 2. Done: the four generic selection assertions now check 1. Agreed this needs measuring, and I'd rather not scope the gate on the dialect argument alone. At our Triton pin AMD's pipeliner does predicate the TDM ops ( 3. You're right that the memo serves at most one hit, but I'd like to keep it. |
The four mocked TMACompatibilityChecker tests added for generic descriptor codegen are all device-independent, but only two were placed in the ungated TestTensorDescriptorCompatibility class. The one that matters most stayed behind: test_tdm_generic_descriptor_checker_preserves_backend_dtype_policy is the only test proving that CUDA and XPU keep the wider _TMA_SUPPORTED_DTYPES after this change narrows the table on the gfx1250 path, and it sat inside TestTDMConfigDenseAndGeneric, which is skipUnless(TEST_WITH_ROCM). The single regression this PR is most exposed to was therefore checked only on ROCm CI. Move it into the ungated class; it uses no class state, notably not _PREREQS, so the move is a straight relocation with no edits to the test body.
The @parametrize("device_type", ("cuda", "xpu")) on the two tests already in that class does not discriminate anything. In are_block_parameters_compatible, device_type is read only for the "cpu" early return, nothing branches cuda versus xpu, and use_gfx1250_descriptor_codegen is mocked in both tests, so the two parametrized instances execute identical code. Drop it and pin the mocked graph device to cuda. Real cuda/xpu coverage now comes from the moved test, which loops over both and reaches the predicate in can_use_tma where the distinction is live. With no parametrized tests left, the class no longer needs @instantiate_parametrized_tests.
Finally, restore actionable detail to the dtype rejection log. Replacing "dtype %s has no CUtensorMapDataType mapping" with "is not supported by this descriptor backend" left a CUDA user with no way to tell which table rejected them. Log the selected set instead: it names the policy that applied and shows what would have been accepted, and it is one line shorter than the message it replaces, which matters because can_use_tma is at the docstring linter's function length limit.
Test Plan:
```
lintrunner -a test/inductor/test_max_autotune.py torch/_inductor/codegen/triton.py
```
Clean for both files. The one remaining PYREFLY missing-attribute report on an untouched line of triton.py is an artifact of linting in a worktree with no built extension; it reproduces identically on the unmodified parent commit.
NOT RUN: the tests themselves. This host's editable install predates the parent commit, so its libtorch is missing ops the current Python expects (aten._philox_randint_) and the tree cannot be imported without a full rebuild. The moved test's body is unchanged and already passes on ROCm CI, so the move only widens where it runs, but the ungated class still has to come back green on the CUDA and XPU jobs.
Prepared with assistance from Claude (Claude Code).
|
Pushed e2f720f to your branch directly rather than sending another round of review comments. Three changes, all mechanical:
I could not run the tests locally, so the ungated class needs to come back green on the CUDA and XPU jobs before any of this means much. Still open from my side, unchanged: the I also refreshed the PR description, which still pointed at 6022f9c as the head. This comment was drafted with AI assistance. |
|
@jeffdaily Can we merge? |
|
Confirmed that all remaining CI failures are not caused by this PR. @pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 4 checks: Limited CI on H100 / linux-jammy-cuda13.2-py3.10-gcc11-sm90 / build, Limited CI on H100 / linux-jammy-cuda13.0-py3.10-gcc11-sm90 / build, .github/workflows/trunk.yml / linux-jammy-cuda13.2-py3.10-gcc11 / test (default, 14, 14, mt-l-x86aavx2-29-113-l4), xpu / linux-noble-xpu-n-py3.10 / test (default, 12, 12, linux.idc.xpu) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…ecode (#197329) Third of the gfx1250 Tensor Data Mover series, after #191166 (dense mm/addmm) and #196525 (generic descriptor codegen). Selects TDM descriptors for the FlexAttention forward and decode kernels on gfx1250. It reuses the existing `USE_TMA` kernel option rather than adding an AMD-specific switch, because both backends render the same descriptor branch of the templates. | `USE_TMA` | gfx1250 forward/decode | | --- | --- | | omitted | descriptors when the capability, dtype, layout and block checks pass | | `False` | pointer path | | `True` | descriptors, still subject to those checks; falls back when ineligible | CUDA and XPU behavior is unchanged, and backward is untouched. The operand policy shared with the dense MM path is factored into `_tdm_operand_policy_violation`; rank, orientation, block rules and hint preparation stay with each caller, so the flex gate keeps proving alignment symbolically while dense MM keeps its hint-based admission and exact guards. Test plan: the host-side gate tests pass. All device paths are unrun — `TestFlexAttentionTDMEndToEnd` requires gfx1250, and the CUDA/XPU selection test requires a TMA-capable device. The commit message records the exact commands and limitations. Generated and cross-reviewed with Claude Opus 5 and GPT-6 Astra. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Pull Request resolved: #197329 Approved by: https://github.com/jeffdaily Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Backport of the gfx1250 Tensor Data Mover (TDM) Inductor support to release/2.14. Upstream PRs (landed on pytorch/pytorch `main`): - pytorch#191166 (`6ee9ad6564b`): dense mm/addmm - pytorch#196525 (`0b5ae20834c`): generic pointwise/reduction descriptor codegen - pytorch#197329 (`3727c0c8773`): flex attention forward/decode The following summary was prepared with AI assistance (Claude Opus 5.5 and GPT-6 Astra) from a per-file comparison against the upstream commits and from my October 7 test run. I have reviewed it: > **Differences from a pure cherry-pick** > > *Release adaptations (conflict resolutions):* > - `kernel/mm.py`: keeps release's `blackwell_ws_persistent_device_tma_mm_template`. TDM is added as an extra candidate next to the ordinary persistent template, as upstream does; it does not replace it. > - `testing/_internal/inductor_utils.py`: keeps release's `HAS_MULTIGPU` and adds `running_on_tdm_device`. > - `utils.py`: `tma_inner_dim` already exists in upstream's parent, and the new TDM code calls it. It is added here and also reused in `can_use_tma` in place of the old inline stride-one scan. `TRITON_FLOAT8_DTYPES` and `_tma_descriptor_max_offset_fits_in_int32` were unrelated upstream context that release lacks; they are not TDM code dropped by this backport. > - `heuristics/template/triton.py`: `_rocm_version_tuple` is kept as upstream introduced it, but upstream's switch of the Origami ROCm-version gate to that helper is not taken. Release's existing Origami policy (`config.rocm.origami` only) is unchanged. The ROCm 10.0 Origami cutoff (pytorch#193843) predates TDM and is not part of this backport. > - Test mocks use release's `strict_sum_rblock` / `has_strict_sum_multirow_reduction` names. > - Six files are byte-identical to a clean merge of the three upstream commits: `config.py`, `kernel/flex/flex_attention.py`, `kernel/flex/flex_decoding.py`, `kernel/flex/templates/common.py.jinja`, `nn/attention/flex_attention.py`, `utils/_triton.py`. > > *Local hardening (not in upstream):* > - `codegen/triton.py:2980`: `and torch.version.hip is None` on the unforced CUDA branch of `TMACompatibilityChecker.can_use_tma`. This makes backend routing explicit and skips the CUDA capability query on HIP. `has_triton_stable_tma_api()` already rejects plain HIP, so this is not a behavior change for ordinary MI300/MI350/gfx1250 configurations. The guard only matters when that helper is true for another backend or is mocked. Covered by `test_failed_amd_gate_preserves_backend_routing`. > - `heuristics/template/triton.py:2414–2515`, Origami fallback: > - An empty preprocessed pool skips selector construction. TDM templates then yield nothing, and non-TDM templates use the regular generator. > - A `RuntimeError` from `OrigamiMatmulSelector(...)` whose message starts with `Attempting to retrieve hardware constants for unsupported architecture:` falls back to the regular generator. Every other error propagates. > - That message text was verified in the `rocm-origami==0.0.3` source. It has not been verified for the CI pin `0.0.2`. > - This affects every ROCm Triton GEMM template that reaches Origami, not just TDM. > - Covered by `test_tdm_real_preprocessing_handles_empty_pool`, `test_origami_unsupported_hardware_uses_regular_configs` and `test_origami_unexpected_selector_error_propagates`. > > *Tests:* > - Following this repo's test guidance (`CLAUDE.md`: `assertEqual` for tensor comparisons, `instantiate_device_type_tests` for device numerics), 24 `torch.testing.assert_close` calls became `assertEqual` with the same explicit `atol`/`rtol`. > - `TestTDMEndToEnd` is now instantiated per device. On ROCm the class is therefore `TestTDMEndToEndCUDA`, and tests take a `device` argument. > - New `test_tdm_dense_dtypes_layouts_and_scaling` is a 48-case matrix: fp16/bf16/fp32 × 4 operand orientations × storage offset {0, 16 B} × {mm, addmm with alpha=0.5/beta=-0.25}. It forces the `mm_persistent_tdm` candidate and checks descriptor codegen and numerics. > - The second commit fixes keyword-only `Buffer(...)` construction in a test helper. > > **Test results (2026-10-07, MI455X A0 / gfx1250, ROCm 10.2 nightly, PyTorch built from release/2.14 at `c299f659`, with this PR's package files overlaid)** > > | Suite | Collected | Passed | Failed | > | --- | ---: | ---: | ---: | > | `TestTDMConfigDenseAndGeneric` | 34 | 34 | 0 | > | `TestTensorDescriptorCompatibility` | 15 | 15 | 0 | > | `TestFlexAttentionTDMOptions` | 6 | 6 | 0 | > | `TestTDMEndToEndCUDA` | 62 | 61 | 1 | > | `TestFlexAttentionTDMEndToEndCUDA` | 35 | 35 | 0 | > > - All 48 dense-matrix cases passed. > - **Compiler used:** Triton `ROCm/triton@669b31ac` (the 2.14 pin), rebuilt against LLVM `5f07f818` plus llvm/llvm-project#214885 (the gfx125x `needs-tdm-drain` workaround). The stock pin lacks that LLVM fix, and the release's capability probes do not check for it. > - **The one failure** is `test_tdm_generic_reduction_loop_partial_tail_cuda`, an fp32 `[512, 1500].sum(dim=1)`. The assertion is in Triton's AMD lowering, and static analysis traces it to a Triton bug rather than this PR's code: > - The reduction's 1D TDM output store has a 4-element block, and the kernel runs `num_warps=8`. > - Triton's `tdmGetWarpDistribution` gives that block 8 warps, so each warp's share rounds to zero. Lowering then asserts `layout.getNumInDims() == indices.size()` (`Utility.cpp:301`). > - Matches the crash fixed upstream by triton-lang/triton#11749 (issue pytorch#11748); not yet confirmed by a rerun with that fix. The fix is in ROCm/triton `release/3.9.x` but not in `release/internal/3.8.x`, the line the 2.14 pin is on. > - The saved MLIR reproduces the assertion in `triton-opt` without a GPU. The same reduction without descriptors passes. > > On 2026-10-11 the branch was updated by merging release/2.14 at `87e0d36` (new head `121919f`). The PR's 13 files are byte-identical to the tested `a7a9d50`, and none of the 8 merged release commits touch them, so these results still apply to this PR's code. > > Commands (from the PR's test tree, against the installed wheel): > ``` > python -m pytest test/inductor/test_max_autotune.py -k 'TestTDMConfigDenseAndGeneric or TestTensorDescriptorCompatibility' > python -m pytest test/inductor/test_flex_attention.py -k TestFlexAttentionTDMOptions > python -m pytest test/inductor/test_max_autotune.py -k TestTDMEndToEnd # selects TestTDMEndToEndCUDA > python -m pytest test/inductor/test_flex_attention.py -k TestFlexAttentionTDMEndToEnd > ``` > > **Not yet qualified** > - The reduction failure is expected to need triton-lang/triton#11749 in the 2.14 Triton pin; confirm by rerunning with all assertions unchanged after the pin moves. The 2.14 Triton also needs llvm/llvm-project#214885. > - The final shipping Triton artifact has not been tested; the run above used a locally rebuilt wheel. > - ROCm 10.1 is not covered. > - Origami enabled is untested. rocm-origami was not installed in the test environment, and `rocm-origami` 0.0.2 (the CI pin) and 0.0.3 have no gfx1250 hardware entry. Because release has no ROCm 10.0 Origami cutoff, enabling it on ROCm 10.x also needs the Python package and the native library it loads to be shown compatible. > - No performance comparison, and no CUDA/XPU runs. > - CI on the current head `121919f` (as on the previous head `a7a9d50`): 8 check runs, all skipped (6 NVIDIA sm90 CUDA jobs plus `get-label-type` and `capture`). No ROCm CI job ran, and there are no commit statuses.
Second of three PRs splitting the gfx1250 Tensor Data Mover work. Builds on #191166, which landed the shared capability probe and descriptor primitives this consumes.
Extends generic pointwise and reduction tensor-descriptor codegen to gfx1250 TDM through the existing
TMACompatibilityChecker.use_gfx1250_descriptor_codegencomposes the two descriptor opt-ins that already gate this path on CUDA and XPU,config.triton.use_tensor_descriptorandconfig.assume_aligned_inputs, with the shared gfx1250 capability probe. Both default to off, so nothing changes for anyone who does not opt in twice, and no AMD-specific switch is added. The checker selects the narrower TDM dtype table only on a capable gfx1250 target and applies the descriptor rank and int32 bounds on that path; CUDA and XPU eligibility is unchanged.gfx1250 is probed before the CUDA/XPU predicate because ROCm devices also report
device_type == "cuda", and the probe result is cached per checker instance whereastorch.cuda.get_device_capability()is not.To review: start with the gate in
torch/_inductor/utils.py, thenTMACompatibilityCheckerintorch/_inductor/codegen/triton.pyfor how that gate narrows dtype admission and shape validation, then the tests.Test Plan:
Host tests, no TDM hardware required:
TestTensorDescriptorCompatibilityis ungated and runs on CUDA and XPU. It covers the shared dtype policy, the forced path not resolving unused shape hints, and the unforced int32 bound expanding a precomputed extent.TestTDMConfigDenseAndGenericis ROCm-gated and fully mocked.gfx1250 end-to-end, which requires hardware and skips everywhere else:
Two gaps are carried deliberately. No gfx1250 E2E case has executed; all ten skip in CI for want of a runner, which is the same condition under which #191166 landed. And the device-TMA
NUM_STAGEScap intorch/_inductor/heuristics/triton_codegen/reduction.pynow applies to gfx1250 for an NVIDIA-only reason, since this PR is the first thing that makes a gfx1250 reduction setuses_device_tma. That cap has not been measured on gfx1250; if AMD does not need it, the gate should be scoped to NVIDIA.Authored by @glen-amd with AI assistance. Commit e2f720f is a maintainer commit that moves the dtype-policy test into the ungated class so the shared CUDA and XPU path is actually covered, drops a parametrization that did not discriminate, and restores detail to a debug message.
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