Skip to content

[ROCm][BE] Remove outdated version conditions - #193927

Closed
cyyever wants to merge 6 commits into
pytorch:mainfrom
cyyever:remove_outdatdd_rocm
Closed

cyyever wants to merge 6 commits into
pytorch:mainfrom
cyyever:remove_outdatdd_rocm

Conversation

@cyyever

@cyyever cyyever commented Aug 18, 2026 •

Copy link
Copy Markdown
Collaborator

ROCm minimum supported version is now 7.0, so guards for ROCM_VERSION >= 60300/60400/60500/70000 are always true and can be dropped.

cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @naromero77amd @pragupta @jerrymannil @xinyazhang

@pytorch-bot

pytorch-bot Bot commented Aug 18, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ You can merge normally! (2 Unrelated Failures)

As of commit 4c9f660 with merge base 6dd4bb6 (image):

CRCR (non-blocking) - The following CRCR downstream CI jobs failed but are non-blocking:

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

@pytorch-bot pytorch-bot Bot added ciflow/b200 ciflow/h100 ciflow/rocm-mi300 Trigger "default" config CI on ROCm MI300 module: rocm AMD GPU support for Pytorch labels Aug 18, 2026
@cyyever
cyyever requested a review from jeffdaily August 18, 2026 09:46
@cyyever

cyyever commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator Author

@pytorchbot label "topic: not user facing"

@pytorch-bot pytorch-bot Bot added the topic: not user facing topic category label Aug 18, 2026
@drisspg drisspg added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Aug 19, 2026
@cyyever
cyyever force-pushed the remove_outdatdd_rocm branch from d79ffd3 to d429481 Compare August 27, 2026 03:41
@cyyever
cyyever force-pushed the remove_outdatdd_rocm branch from d429481 to 771a4c4 Compare August 27, 2026 03:51
@cyyever
cyyever force-pushed the remove_outdatdd_rocm branch from 771a4c4 to a3b02fd Compare August 27, 2026 03:57
ROCm minimum supported version is now 7.1 (pytorch#192258), so guards for
ROCM_VERSION >= 60300/60400/60500/70000 and == 60400 are always true or
always false and can be dropped. Version-specific compiler/API
compatibility shims (e.g. typedefs for pre-7.0 toolchains, differing
HIP API call shapes) are left alone even where the same reasoning would
apply, since they can't be verified without a real ROCm build.
@cyyever
cyyever force-pushed the remove_outdatdd_rocm branch from a3b02fd to 68856a3 Compare August 27, 2026 04:04
jeffdaily and others added 2 commits August 31, 2026 23:50
ROCm minimum supported version is now 7.1 (pytorch#192258), so the
ROCM_VERSION == 60400 workarounds for the hipblaslt TT fp32 regression
are dead code. This bug-specific exact-match workaround was duplicated
in three places; all three are removed together here.

Signed-off-by: cyy <[email protected]>
@jeffdaily jeffdaily changed the title Remove outdated ROCm conditions [ROCm][BE] Remove outdated version conditions Sep 1, 2026
Extends this PR's sweep to ScaledBlas.cpp. The floor is ROCm 7.0, so every
guard at or below 70000 is always true and every branch behind an #else is dead. That
covers six ROCM_VERSION >= 70000 guards and four >= 60500 guards, including two
whose user-visible messages promise support "for ROCm 6.5 and above" -- a
version that never shipped, since 6.4 went straight to 7.0. Removing the 70000
guards at the two block-wise sites also drops the unreachable "requires ROCm 7.0
or later" branches. The >= 71400 guard stays; so do 70100, 70200 and < 70201
elsewhere in the tree, which are above the floor and still meaningful.

test_cuda.py carries a comment asking that its arch list stay in sync with
CUDAHooks::getHipblasltPreferredArchs. This PR deletes the 6.4 and 7.0 guards on
the C++ side, so fold gfx1200/gfx1201/gfx950 unconditionally into the Python
list to match. Note this block reads torch.version.hip rather than the SDK
version, so it is a HIP threshold wearing a ROCm name; pytorch#193602 is reworking that
plumbing and will touch these lines.

Installed headers are deliberately left alone. ROCM_VERSION is undefined for
out-of-tree extension builds -- cpp_extension.py passes only USE_ROCM,
__HIP_PLATFORM_AMD__ and HIPBLAS_V2 -- so in those headers a >= guard is
currently false and a < guard true, and removing either changes behavior rather
than being a no-op. That is a separate change with its own argument.

Test Plan:

Applied to a gfx90a tree, re-hipified and rebuilt; ScaledBlas.cpp.o compiles
clean and the full build exits 0 with no new warnings.

```
python tools/amd_build/build_amd.py
pip install -e . -v --no-build-isolation
```

Preprocessor nesting in ScaledBlas.cpp balances to zero, and the arch gate still
fires as expected on an unsupported part:

```
torch._scaled_mm(...) -> RuntimeError: torch._scaled_mm is only supported on
CUDA devices with compute capability >= 9.0 or 8.9, or ROCm MI300+
```

Lint:

```
lintrunner -a --take RUFF,PYFMT,FLAKE8 test/test_cuda.py
```

This commit was authored with an AI assistant.
@jeffdaily
jeffdaily force-pushed the remove_outdatdd_rocm branch from 61a27b6 to 26a9412 Compare September 1, 2026 15:20
@slayton58

Copy link
Copy Markdown
Contributor

@claude do a deep review, concentrating on if there are any unintended side-effects of this change

@claude

claude Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Claude finished @slayton58's task in 10m 46s —— View job


The sweep is mostly sound, but I found one real behavior change on the CUDA side (an #if ROCM_VERSION >= 70000 nested inside a ROCm-only block was replaced by an unguarded block whose guard was not actually redundant), plus a stale cross-reference in common_cuda.py that now points at deleted code — details below.

Deep review: unintended side-effects of removing outdated ROCm version guards

Scope of what I checked

Reviewed all 8 changed files across the 3 commits (68856a31, 8d0d8ca7, 26a9412d) against origin/main, focusing specifically on side-effects rather than style. I verified:

  • how ROCM_VERSION is actually defined and whether the floor is enforced,
  • preprocessor nesting correctness after each deletion,
  • whether each removed #else branch was genuinely dead,
  • whether the Python mirrors still agree with the C++,
  • whether the sweep leaves the tree internally inconsistent.

1. The premise: there is no build-time enforcement of the ROCm 7.0 floor

ROCM_VERSION is a plain -D from CMake, cmake/Dependencies.cmake:1115:

add_definitions(-DROCM_VERSION=${ROCM_VERSION_DEV_INT})

computed at cmake/public/LoadHIP.cmake:304 as major*10000 + minor*100 + patch. So the arithmetic in the PR description is right.

But I searched for a hard floor — #error, FATAL_ERROR on ROCM_VERSION < 70000, a ROCM_MINIMUM check in CMakeLists.txt/setup.py — and there is none. The only nearby thing is a workaround flag at aten/src/ATen/CMakeLists.txt:482 (VERSION_LESS "7.2.0"), not a floor. The floor is a policy (#192258) and a CI configuration, not a compile-time invariant.

That doesn't make the PR wrong — dropping support means dropping support, and CI only builds ROCm 7.x. But it does change the failure mode for an out-of-tree 6.x build from "clean TORCH_CHECK_NOT_IMPLEMENTED at runtime" to "silently takes the 7.x path and miscompiles or misbehaves." If the intent is that 6.x is truly unsupported, the highest-value follow-up is to add the #error that makes this sweep self-justifying:

#if defined(USE_ROCM) && ROCM_VERSION < 70000
#error "PyTorch requires ROCm 7.0 or newer"
#endif

Worth noting the PR description says 7.0 while the commit messages say 7.1 — please settle on one, since it determines whether the remaining >= 70100/>= 70200 guards are also dead.

2. Real issue: the >= 70000 guard in CUDABlas.cpp was not redundant

This is the one I'd actually block on. Before (aten/src/ATen/cuda/CUDABlas.cpp):

#if defined(USE_ROCM) && !defined(HIPBLASLT_OUTER_VEC) && defined(HIPBLASLT_VEC_EXT)
  ...
  else if (mat1_scale_dtype == kFloat8_e8m0fnu && mat2_scale_dtype == kFloat8_e8m0fnu) {
  #if ROCM_VERSION >= 70000        // <-- removed
            std::vector<std::string> mx_archs{"gfx950"};
  ...

The enclosing block requires !defined(HIPBLASLT_OUTER_VEC) && defined(HIPBLASLT_VEC_EXT) — the legacy hipblaslt scale-pointer mode. HIPBLASLT_OUTER_VEC / HIPBLASLT_VEC_EXT are set by a try_compile feature probe, not by version (cmake/public/LoadHIP.cmake:400-413). So the inner ROCM_VERSION >= 70000 was selecting for the combination "new enough ROCm but old-style vec-ext hipblaslt" — a genuinely reachable and unusual configuration, not a version tautology. Compare line 1961 in the same file, which the PR correctly leaves alone and which pairs the version with the feature macro explicitly:

#if CUDA_VERSION >= 12080 || (defined(USE_ROCM) && ROCM_VERSION >= 70000 && defined(HIPBLASLT_OUTER_VEC))

Under ROCM_VERSION >= 70000 the deletion is a no-op, so CI will be green and this will not be caught. It only bites a 6.x-with-vec-ext build, where the MX alignment TORCH_CHECK now runs where it previously did not. Low blast radius, but it is a semantic change hiding in what is presented as a pure dead-code removal, and it is the one deletion in the PR that I do not think follows from the stated premise. Given the surrounding #if is feature-probe-driven rather than version-driven, I'd keep this guard.

3. Stale cross-reference: common_cuda.py now points at deleted code

torch/testing/_internal/common_cuda.py:284-288 still reads:

if ROCM_VERSION >= (6, 5):
    # OCP fp8 (e4m3fn/e5m2) in scaled_mm requires ROCm 6.5+; see
    # the ROCM_VERSION checks in aten/src/ATen/native/cuda/ScaledBlas.cpp.
    # gfx120 and gfx95 only support OCP, so gate them on 6.5.
    archs.extend(['gfx95', 'gfx120'])

Those are exactly the Float8_e5m2 / Float8_e4m3fn >= 60500 checks this PR deletes from ScaledBlas.cpp. The comment now references code that no longer exists. Since the floor is >= 7.0, ROCM_VERSION >= (6, 5) is always true and this should be flattened the same way test_cuda.py was. Same class of leftover at test/test_linalg.py:72-75 (>= (6, 3), >= (6, 5)).

This matters more than a stale comment normally would: the PR did correctly fix the analogous mirror in test_cuda.py, so leaving this one creates the impression the sweep was complete when it wasn't. Note also that common_cuda.ROCM_VERSION prefers torch.version.rocm and falls back to torch.version.hip (common_cuda.py:30-47), whereas the test_cuda.py block this PR touched parses torch.version.hip directly — so the two mirrors don't even use the same version source. Not introduced here, but it means "mirror the C++" is shakier than it looks.

4. Internal inconsistency: sub-7.0 guards left behind

The same always-true comparisons survive elsewhere, so the tree ends up half-swept:

Location Guard
aten/src/ATen/cuda/tunable/GemmHipblaslt.h:70,79 #if ROCM_VERSION >= 60300
aten/src/ATen/cuda/CUDADataType.h:84 #if !defined(USE_ROCM) || ROCM_VERSION >= 60300
c10/cuda/CUDAEvent.h:144,171,255 >= 70000 / < 70000
c10/cuda/CUDAAllocatorConfig.cpp:18 ROCM_VERSION < 70000
torch/csrc/jit/codegen/fuser/cuda/resource_strings.h:15 ROCM_VERSION < 70000

The GemmHipblaslt.h:70 case is notable because this PR edits that very file — it removes the == 60400 block but leaves two >= 60300 guards a few lines away. Not a correctness bug; just worth stating explicitly in the PR description that this is a partial sweep, so a reader doesn't infer the remaining sub-7.0 guards are meaningful.

One genuine trap for whoever does the follow-up: torch/headeronly/cuda/KernelUtils.h:16-20 must not be mechanically swept.

// ROCM_VERSION arrives as -DROCM_VERSION=FB_ROCM_VERSION and collapses to 0
// wherever the tp2 toolchain does not substitute it, which selects this branch.
#if ROCM_VERSION < 60400

Here ROCM_VERSION can be 0 in fbcode, and the < 60400 branch is load-bearing precisely in that case. Deleting it as "always false" would break the fbcode build. Good that this PR left it alone; it deserves a mention so the next sweep doesn't.

5. Deletions I verified as genuinely safe

To be clear about what I'm not flagging — these all check out:

  • CUDAHooks.cpp arch lists and ScaledBlasDeviceUtils.cpp: pure list flattening, >= 71300/>= 71400 correctly retained. Verified the resulting initializer lists and trailing commas are well-formed (CUDAHooks.cpp:546-571).
  • ScaledBlas.cpp dtype checks: the four Float4_e2m1fn_x2 / Float8_e5m2 / Float8_e4m3fn checks were TORCH_CHECK(ROCM_VERSION >= ...) on a compile-time constant — always-pass at >= 7.0, so removal is behavior-preserving. The commit message correctly observes ROCm 6.5 never shipped (6.4 went to 7.0), so those messages were unreachable and misleading.
  • ScaledBlas.cpp check_blockwise_e8m0fnu_arch_supported(): the #if ROCM_VERSION >= 70000 wrapper around the definition is removed while the inner #if ROCM_VERSION >= 71400 and the outer #ifdef USE_ROCM (line 69 / 84) are preserved. Nesting is correct, and all three call sites (lines 630, 1070, 1152) remain inside #ifdef USE_ROCM, so no non-ROCm build sees the now-unguarded definition. I checked this carefully since a stray #endif here would break the CUDA build — it's fine.
  • _scaled_mxfp8_mxfp8 / _scaled_mxfp4_mxfp4: dropping the #else TORCH_CHECK_NOT_IMPLEMENTED(...) arms is correct; those were unreachable. The remaining #ifdef USE_ROCM / #else structure at 1069-1082 and 1147-1175 still balances.
  • hipblaslt TT-fp32 == 60400 workarounds (CUDABlas.cpp bgemm_internal_cublaslt, GemmHipblaslt.h:640, Blas.cpp:171): exact-match on a version below the floor, so dead. Removing all three together is the right call — a partial removal would have left an inconsistent backend-selection policy. In Blas.cpp the deletion also removes the only cublasCommonArgs construction in isInputCompliesAddmmCudaLt; I confirmed no later use of args in that function, so no orphaned variable or unused-variable warning.
  • test_matmul_cuda.py: the getRocmVersion() < (6, 4) Navi skip is dead, and the getRocmVersion import is correctly dropped. Confirmed NAVI_ARCH, MI200_ARCH, isRocmArchAnyOf are all still used (lines 350, 372, 487, 505, 1204, 1273), so no orphaned imports. getRocmVersion remains used in other files, so the helper itself should stay.

Summary

# Finding Severity
2 CUDABlas.cpp >= 70000 removal changes behavior in the feature-probe-gated HIPBLASLT_VEC_EXT path; guard was not a version tautology Medium — recommend restoring
3 common_cuda.py:284-288 comment references deleted ScaledBlas.cpp checks; >= (6, 5) now always true Low-Medium
1 ROCm 7.0 floor is unenforced; 6.x builds now silently take 7.x paths. PR body says 7.0, commits say 7.1 Low (worth an #error)
4 Partial sweep — sub-7.0 guards remain in 5+ other files; KernelUtils.h must be excluded from any follow-up Informational

Everything else in the diff is a faithful dead-code removal. Finding #2 is the only one I'd hold the merge for; #3 is a small follow-up in this PR; #1 and #4 are best handled as a note in the PR description or a separate change.

Fix this →

Review requested by @slayton58. Analysis only — no files were modified.
| branch remove_outdatdd_rocm

@jeffdaily

Copy link
Copy Markdown
Collaborator

Pushed a merge of latest viable/strict, your #194983 cherry-picked in with authorship preserved, and a maintainer commit extending the sweep. I closed #194983 since it is fully contained here -- semantically it is one change, and splitting it meant two nearly identical reviews. I checked nothing was lost: every ROCM_VERSION hunk is present and GemmHipblaslt.h is byte-identical.

The maintainer commit takes ScaledBlas.cpp. The floor is ROCm 7.0, so six >= 70000 guards and four >= 60500 guards are always true, and the #else branches behind two of them are unreachable. Two of the 60500 sites drive user-visible messages promising support "for ROCm 6.5 and above" -- a version that never shipped, since 6.4 went straight to 7.0. >= 71400 stays, as do 70100, 70200 and < 70201 elsewhere in the tree; those are above the floor and still meaningful.

It also syncs test/test_cuda.py. That block carries a comment asking it to stay in sync with CUDAHooks::getHipblasltPreferredArchs, and this PR deletes the 6.4 and 7.0 guards on the C++ side, so leaving the Python half behind is what the comment exists to prevent. Heads up that #193602 is reworking these exact lines, so expect a conflict there -- whichever lands second will need a trivial fixup. Related: that block reads torch.version.hip, not the SDK version, so it is a HIP threshold wearing a ROCm name, which is what #193602 is untangling.

I deliberately left the installed headers alone -- CUDADataType.h, CUDAEvent.h, CublasLtUtils.h, SortUtils.cuh, CUDAAllocatorConfig.h, GemmHipblaslt.h. ROCM_VERSION is undefined for out-of-tree extension builds, since cpp_extension.py passes only USE_ROCM, __HIP_PLATFORM_AMD__ and HIPBLAS_V2. So in those headers a >= guard is currently false and a < guard true regardless of the ROCm the extension was built against, and removing either changes behaviour rather than being a no-op. Worth doing, but it needs its own PR with that reasoning written down -- CUDADataType.h in particular has the same pattern twice with only one instance being cleaned up anywhere.

Validation: applied to a gfx90a tree, re-hipified and rebuilt. ScaledBlas.cpp.o compiles clean, full build exits 0, no new warnings, preprocessor nesting balances. Only the >= 71400 guard remains in that file.

Analysis assisted by AI.

cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 3, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 4, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 4, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 4, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 4, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 4, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 4, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 4, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 4, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 4, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 4, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 4, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 5, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 5, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 5, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 5, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 5, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 5, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 5, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 5, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 5, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 5, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 5, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 6, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 6, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 6, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 6, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 6, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 6, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
cyyever added a commit to cyyever/pytorch that referenced this pull request Sep 7, 2026
Upstream reverted pytorch#193927 because their internal ROCm is not at 7.0 yet. This
fork's floor is 7.14, declared in cmake/public/LoadHIP.cmake, so every condition
that revert restored is decidable here and the branch keeps its own bound.

True at the floor, so the guard goes and the body stays: the hipblaslt arch
lists in CUDAHooks (>= 60400, 70000, 71300, 71400 in the preferred set; >= 60300,
70000, 71400 in the supported set), the OCP fp8 hipDataType mappings and the
Float4_e2m1fn_x2 mapping in GemmHipblaslt.h, the fp8 cases in CUDADataType.h,
the scaled_mm arch list, the blockwise e8m0fnu paths in ScaledBlas.cpp, and the
external-event flags in CUDAEvent.h.

False at the floor, so guard and body both go: the two ROCm 6.4 hipblaslt TT
fp32 workarounds in CUDABlas.cpp, Blas.cpp and GemmHipblaslt.h, and the
"External CUDA-graph events on ROCm require ROCm 7.0+" check.

Two conditions only collapse halfway, because their other operand is about CUDA
rather than ROCm: `!defined(USE_ROCM) && CUDA_VERSION >= 12090` becomes
`!defined(USE_ROCM)` (the CUDA floor is 13.3), and the expandable-segments guard
in CUDAAllocatorConfig keeps its !defined(USE_ROCM) arm.

The runtime TORCH_CHECKs that told a user their ROCm was too old for
Float4_e2m1fn_x2 or the OCP fp8 types cannot fire, so they go too, along with the
Python mirrors: test_cuda's copy of the preferred-arch list, its three
getRocmVersion() >= (7, 14) skips, and common_cuda's fp8 arch gating. The two
`ROCM_VERSION >= (8, 0)` checks stay -- 8.0 is above this floor, not below it.

Test Plan:

```
lintrunner -a --revision HEAD
```

Clean. Every touched C++ file was checked for unchanged net #if/#endif depth and
brace balance against its parent, which caught a stray #endif that an earlier
conflict resolution had left in ScaledBlasDeviceUtils.cpp.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-td Do not run TD on this PR ciflow/b200 ciflow/h100 ciflow/rocm-mi300 Trigger "default" config CI on ROCm MI300 ciflow/trunk Trigger trunk jobs on your pull request Merged module: rocm AMD GPU support for Pytorch open source Reverted topic: not user facing topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants