PortPilot
Benchmark · pre-generated, always available← back to leaderboard
Migration Readiness Report

facebookresearch/xformers

https://github.com/facebookresearch/xformers
Manual blockers present

Advisory Summary — xformers ROCm Migration

This repo is largely ROCm-ready: 452 of 567 assessed findings work as-is, and 112 are mechanical fixes (header swaps, API renames, cudahip substitutions) that can be batched with minimal risk. The real gating items are the 3 manual blockers in bucket C — these likely involve custom kernels, CUTLASS-dependent code paths, or architecture-specific intrinsics that require human review and possibly alternative implementations. Recommended first step: triage and resolve the 3 bucket-C items before sweeping the 112 mechanical changes, since the blockers may invalidate or

452Works as-is
112Mechanical change
3Manual blocker
Findings
567
Python files
105
Files scanned
239
Custom CUDA kernels
detected

Detected but out of scope (not analyzed): C++, C/C++ header

Findings by file

567 findings · 73 files
setup.py· 5
A
torch.cuda API usage
torch.cuda.is_available()
:143

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

C
Inline PTX assembly
"--ptxas-options=-v",
:178

The --ptxas-options=-v flag is nvcc-specific, passing verbose output to the PTX assembler to report register/shared-memory usage. ROCm's HIP compiler (hipcc/clang) has no ptxas equivalent; verbose compilation can be obtained with -v passed directly to hipcc, and register/occupancy analysis is done via roc-obj-extract or --offload-arch with -Rpass. This flag must be removed or guarded behind a CUDA-only conditional to avoid breaking the ROCm build.

RecommendRewrite the PTX block in HIP or a portable high-level equivalent.

Suggested change · advisory
--- setup.py
+++ setup.py
@@ -178,1 +178,2 @@
- "--ptxas-options=-v",
+ # "--ptxas-options=-v", # nvcc-only; no ptxas in ROCm
+ "-v" if hip_enabled else "--ptxas-options=-v",
C
Inline PTX assembly
"--ptxas-options=-O2",
:199

The --ptxas-options=-O2 flag is nvcc-specific, controlling the NVIDIA PTX assembler optimization level, and has no ROCm/HIP equivalent since AMD uses GCN ISA rather than PTX. This flag should be removed or replaced with standard hipcc optimization flags (e.g., -O2) in the build configuration. Leaving it in will cause hipcc to error or ignore it depending on the build system's flag-passing mechanism.

RecommendRewrite the PTX block in HIP or a portable high-level equivalent.

Suggested change · advisory
--- setup.py
+++ setup.py
@@ -199,1 +199,1 @@
- "--ptxas-options=-O2",
+ "-O2",
C
Inline PTX assembly
"--ptxas-options=-allow-expensive-optimizations=true",
:200

The --ptxas-options=-allow-expensive-optimizations=true flag is specific to NVIDIA's PTX assembler (ptxas) and has no ROCm/hipcc equivalent, since ROCm does not use a PTX intermediate representation. This flag should be removed from the build configuration; ROCm's LLVM-based compiler already applies its own optimization pipeline controlled by -O levels.

RecommendRewrite the PTX block in HIP or a portable high-level equivalent.

Suggested change · advisory
--- setup.py
+++ setup.py
@@ -200,1 +200,0
- "--ptxas-options=-allow-expensive-optimizations=true",
A
Device string "cuda"
"cuda": cuda_version,
:214

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

.github/gpu_benchmark_diff.py· 1
B
xFormers dependency
import xformers.benchmarks.utils as utils
:10

xFormers is a CUDA-centric library and is not officially supported on ROCm, so this import will fail on AMD Instinct GPUs. The benchmark utility functions it provides have no direct ROCm equivalent, and you should either gate the import behind a CUDA availability check or replace it with PyTorch-native alternatives (e.g., torch.nn.functional.scaleddotproduct_attention, which ROCm supports).

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

Suggested change · advisory
--- .github/gpu_benchmark_diff.py
+++ .github/gpu_benchmark_diff.py
@@ -7,7 +7,12 @@
import torch
-import xformers.benchmarks.utils as utils
+try:
+ import xformers.benchmarks.utils as utils
+except ImportError:
+ # xFormers is not supported on ROCm; fall back to a no-op or torch-native utility
+ utils = None
.github/run_benchmark_wrapper.py· 2
B
xFormers dependency
import xformers
:14

xFormers has no official ROCm support and its CUDA-specific attention kernels will not run on AMD Instinct GPUs. On ROCm, replace xFormers attention with PyTorch native scaled_dot_product_attention (which dispatches to AMD's Composable Kernel backend) or the ROCm build of flash-attn. Guard the import so the benchmark wrapper remains portable across CUDA and ROCm environments.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

Suggested change · advisory
--- .github/run_benchmark_wrapper.py
+++ .github/run_benchmark_wrapper.py
@@ -14,1 +14,7 @@
-import xformers
+# Advisory: xFormers is CUDA-only; use native SDPA on ROCm.
+import torch
+USE_XFORMERS = torch.cuda.is_available() and not torch.version.hip
+if USE_XFORMERS:
+ import xformers # noqa: F401
+else:
+ xformers = None # ROCm path relies on torch SDPA / flash-attn
A
torch.cuda API usage
torch.cuda.get_device_name(torch.cuda.current_device())
:35

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

examples/llama_inference/generate.py· 8
B
xFormers dependency
from xformers.ops.fmha.attn_bias import (
:23

xFormers is a CUDA-centric attention library with limited or no ROCm support on AMD Instinct GPUs. This import will likely fail or produce incorrect results on ROCm and should be replaced with PyTorch's native torch.nn.functional.scaled_dot_product_attention, which has ROCm-optimized backends (CK/MIOpen).

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

Suggested change · advisory
--- examples/llama_inference/generate.py
+++ examples/llama_inference/generate.py
@@ -23,1 +23,1 @@
-from xformers.ops.fmha.attn_bias import (
+# Advisory: xFormers is not supported on ROCm. Replace with PyTorch native SDPA:
+# import torch.nn.functional as F
+# Use F.scaled_dot_product_attention(query, key, value, attn_mask=...) instead.
+# from xformers.ops.fmha.attn_bias import (
A
Device string "cuda"
bias.q_seqinfo.to("cuda")
:119

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
bias.k_seqinfo.to("cuda")
:120

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
graph = torch.cuda.CUDAGraph()
:122

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
.cuda() tensor/module move
tokens = torch.IntTensor(sum(prompts, [])).cuda()
:127

.cuda() on tensors and modules is honoured by ROCm PyTorch and moves data to the AMD GPU. No change needed.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
if "capture_error_mode" in torch.cuda.graph.__init__.__annotations__:
:146

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.graph(graph, **recording_kwargs):
:150

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.synchronize()
:158

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

examples/llama_inference/model.py· 2
B
xFormers dependency
from xformers.ops import fmha, RMSNorm, rope_padded
:14

xFormers has limited/experimental ROCm support and its optimized kernels (fmha, RMSNorm, ropepadded) are primarily CUDA-centric, so this import may fail or fall back to unoptimized paths on AMD Instinct GPUs. The recommended migration path is to replace xFormers ops with ROCm-compatible equivalents such as PyTorch's native F.scaleddotproductattention (which dispatches to CK/MIWA attention on ROCm) or the flash_attn HIP build, and to use a standard RMSNorm implementation. This is advisory — you must verify functional equivalence and performance on your target MI series.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

Suggested change · advisory
--- examples/llama_inference/model.py
+++ examples/llama_inference/model.py
@@ -14,1 +14,1 @@
-from xformers.ops import fmha, RMSNorm, rope_padded
+# Advisory: xFormers has limited ROCm support; consider native torch SDPA or flash_attn (HIP build).
+# from xformers.ops import fmha, RMSNorm, rope_padded
+import torch.nn.functional as F
B
xFormers dependency
from xformers.ops.fmha.attn_bias import (
:15

xFormers ships CUDA-specific fused attention kernels and attention-bias types that are not guaranteed to work on ROCm. Replace xFormers attention with PyTorch native scaleddotproduct_attention (or a ROCm-compatible FlashAttention build) to avoid runtime errors on AMD Instinct GPUs.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

Suggested change · advisory
--- examples/llama_inference/model.py
+++ examples/llama_inference/model.py
@@ -15,1 +15,1 @@
-from xformers.ops.fmha.attn_bias import (
+# ROCm advisory: xFormers is CUDA-centric; use torch SDPA or ROCm FlashAttention instead.
+# from xformers.ops.fmha.attn_bias import (
examples/llama_inference/requirements.txt· 1
B
xFormers dependency
xformers>=0.0.22
:3

xFormers is a CUDA-centric attention library with no official ROCm support and will fail to build or run on AMD Instinct GPUs. The dependency should be removed and replaced with PyTorch's native torch.nn.functional.scaleddotproduct_attention (which ROCm backs with its own Memory-Efficient/Flash kernels) or the ROCm-compatible flash-attention package.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

Suggested change · advisory
--- a/examples/llama_inference/requirements.txt
+++ b/examples/llama_inference/requirements.txt
@@ -3,1 +3,0 @@
-xformers>=0.0.22
tests/test_attention_patterns.py· 1
B
xFormers dependency
import xformers.components.attention.attention_patterns as AP
:11

xFormers relies on CUDA-specific kernels and is not officially supported on ROCm, so this import will likely fail or produce incorrect results on AMD Instinct GPUs. The test should either be guarded behind a CUDA-only skip or rewritten to use an ROCm-compatible alternative (e.g., PyTorch native SDPA or flash-attention for ROCm).

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

Suggested change · advisory
--- tests/test_attention_patterns.py
+++ tests/test_attention_patterns.py
@@ -8,7 +8,12 @@
import pytest
import torch
-import xformers.components.attention.attention_patterns as AP
+try:
+ import xformers.components.attention.attention_patterns as AP
+ _HAS_XFORMERS = True
+except ImportError:
+ AP = None
+ _HAS_XFORMERS = False
# Advisory: xFormers is not supported on ROCm. Guard tests that depend on AP:
# pytest.mark.skipif(not _HAS_XFORMERS, reason="xFormers unavailable on ROCm")
tests/test_checkpoint.py· 8
B
xFormers dependency
import xformers.ops
:13

xFormers is a CUDA-centric attention library with limited or experimental ROCm support; importing it unconditionally on AMD Instinct systems can cause import errors or fall back to unsupported code paths. The test should either guard the import behind a CUDA availability check or switch to a ROCm-compatible attention backend (e.g., FlashAttention-ROCm or native PyTorch SDPA).

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

Suggested change · advisory
--- a/tests/test_checkpoint.py
+++ b/tests/test_checkpoint.py
@@ -10,7 +10,11 @@
import torch
-import xformers.ops
+
+try:
+ import xformers.ops
+ HAS_XFORMERS = True
+except ImportError:
+ HAS_XFORMERS = False
B
xFormers dependency
from xformers.checkpoint import (
:15

xFormers has limited or no official ROCm support, and its checkpointing utilities may fail or produce incorrect results on AMD Instinct GPUs. The xformers.checkpoint module can typically be replaced with PyTorch's native torch.utils.checkpoint, which is fully functional on ROCm and provides equivalent memory-efficient gradient checkpointing.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

Suggested change · advisory
--- tests/test_checkpoint.py
+++ tests/test_checkpoint.py
@@ -15,1 +15,1 @@
-from xformers.checkpoint import (
+from torch.utils.checkpoint import (
A
torch.cuda API usage
if torch.cuda.is_available():
:28

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
_devices.append("cuda")
:29

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
cuda_cap = torch.cuda.get_device_capability(_devices[1])
:30

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
@pytest.mark.parametrize("device", ["cuda"])
:110

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
@pytest.mark.parametrize("device", ["cuda"])
:292

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
@pytest.mark.parametrize("device", ["cuda"])
:334

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

tests/test_fmha_flop_formula.py· 11
B
xFormers dependency
import xformers.ops
:11

xFormers is a CUDA-centric attention library with no official ROCm support; importing it on AMD Instinct will raise ImportError or fail at runtime. The test should guard the import and skip gracefully when xFormers is unavailable, or be replaced with an ROCm-compatible FMHA path.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

Suggested change · advisory
-import xformers.ops
+try:
+ import xformers.ops
+ HAS_XFORMERS = True
+except ImportError:
+ HAS_XFORMERS = False
B
xFormers dependency
from xformers.ops import fmha
:12

xFormers is a CUDA-centric attention library with limited/unofficial ROCm support; importing it unconditionally on AMD Instinct may fail at import time or use unoptimized code paths. For ROCm migration, this test should either guard the import behind a backend check or use an ROCm-compatible attention backend (e.g., FlashAttention-ROCm) so the flop formula test can run on AMD GPUs.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

Suggested change · advisory
--- a/tests/test_fmha_flop_formula.py
+++ b/tests/test_fmha_flop_formula.py
@@ -9,7 +9,14 @@
import pytest
-from xformers.ops import fmha
+try:
+ from xformers.ops import fmha
+ _HAS_XFORMERS = True
+except ImportError:
+ # Advisory: xFormers is CUDA-centric; on ROCm prefer FlashAttention-ROCm.
+ fmha = None
+ _HAS_XFORMERS = False
# ... existing test code ...
+pytestmark = pytest.mark.skipif(not _HAS_XFORMERS,
+ reason="xFormers unavailable on this ROCm build")
A
torch.cuda API usage
if torch.cuda.is_available():
:17

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
compute_capability = torch.cuda.get_device_capability("cuda")
:18

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
compute_capability = torch.cuda.get_device_capability("cuda")
:18

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
[B, Mq, Hq, Kqk], dtype=dtype, device="cuda", requires_grad=True
:71

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
[B, Mkv, Hq, Kqk], dtype=dtype, device="cuda", requires_grad=True
:74

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
[B, Mkv, Hq, Kv], dtype=dtype, device="cuda", requires_grad=True
:77

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
q = torch.randn([B, Mq, Hq, Kqk], dtype=dtype, device="cuda", requires_grad=True)
:87

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
k = torch.randn([B, Mkv, Hkv, Kqk], dtype=dtype, device="cuda", requires_grad=True)
:88

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
v = torch.randn([B, Mkv, Hkv, Kv], dtype=dtype, device="cuda", requires_grad=True)
:89

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

tests/test_fmha_merge_attentions.py· 32
B
xFormers dependency
from xformers.ops import fmha
:12

xFormers' fmha relies on CUDA-specific fused attention kernels that are not supported on ROCm. On AMD Instinct GPUs, replace this with PyTorch's native scaled_dot_product_attention (which dispatches to ROCm's CK/MIOpen attention backends) or guard the import so tests can be skipped on non-CUDA platforms.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

Suggested change · advisory
--- tests/test_fmha_merge_attentions.py
+++ tests/test_fmha_merge_attentions.py
@@ -12,1 +12,7 @@
-from xformers.ops import fmha
+try:
+ from xformers.ops import fmha
+ HAS_XFORMERS = True
+except ImportError:
+ fmha = None
+ HAS_XFORMERS = False
+ # Advisory: on ROCm, use torch.nn.functional.scaled_dot_product_attention instead
B
xFormers dependency
from xformers.ops.fmha.common import AttentionFwOpBase
:13

xFormers has limited/unsupported ROCm builds for AMD Instinct, so this import may fail at collection time on ROCm. The test should either be guarded behind a CUDA/xFormers availability check or ported to a ROCm-compatible flash-attention equivalent. No automatic fix is applied; this is advisory only.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

Suggested change · advisory
--- tests/test_fmha_merge_attentions.py
+++ tests/test_fmha_merge_attentions.py
@@ -10,7 +10,11 @@
import torch
-try:
- from xformers.ops.fmha.common import AttentionFwOpBase
- _HAS_XFORMERS = True
-except ImportError:
- _HAS_XFORMERS = False
+# Advisory: xFormers is not reliably available on ROCm.
+# Guard the import so the test module can be skipped on non-CUDA platforms.
+try:
+ from xformers.ops.fmha.common import AttentionFwOpBase
+ _HAS_XFORMERS = True
+except ImportError:
+ AttentionFwOpBase = None
+ _HAS_XFORMERS = False
B
xFormers dependency
from xformers.ops.fmha.merge_training import (
:14

xFormers is a CUDA-centric library and its FMHA (fused multi-head attention) kernels are not supported on ROCm. This test imports from xformers.ops.fmha.merge_training, which will fail on AMD Instinct GPUs; the test should be skipped or ported to an ROCm-compatible attention backend (e.g., FlashAttention-ROCm or CK-based FMHA).

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

Suggested change · advisory
--- a/tests/test_fmha_merge_attentions.py
+++ b/tests/test_fmha_merge_attentions.py
@@ -11,6 +11,10 @@
import pytest
import torch
+import torch.cuda
+_IS_ROCM = torch.version.hip is not None
+if _IS_ROCM:
+ pytest.skip("xFormers FMHA is not supported on ROCm; skipping test.", allow_module_level=True)
+
from xformers.ops.fmha.merge_training import (
A
torch.cuda API usage
if torch.cuda.is_available():
:23

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
compute_capability = torch.cuda.get_device_capability("cuda")
:24

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
compute_capability = torch.cuda.get_device_capability("cuda")
:24

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
q = 3 * torch.rand(B, Mq, H, K, dtype=dtype, device="cuda")
:106

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
k = (3 * torch.rand(B, M, 1, K, dtype=dtype, device="cuda")).expand(B, M, H, K)
:107

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
v = (3 * torch.rand(B, M, 1, K, dtype=dtype, device="cuda")).expand(B, M, H, K)
:108

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
q = 3 * torch.rand(B, Mq, G, H, K, dtype=dtype, device="cuda")
:110

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
k = (3 * torch.rand(B, M, G, 1, K, dtype=dtype, device="cuda")).expand(
:111

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
v = (3 * torch.rand(B, M, G, 1, K, dtype=dtype, device="cuda")).expand(
:114

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
block_tables = torch.zeros((B, 1), dtype=torch.int32, device="cuda")
:163

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
q = torch.randn((1, B_T, G, N_H_L, D_H), dtype=dtype, device="cuda")
:169

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
k = torch.randn((1, page_size, G, 1, D_H), dtype=dtype, device="cuda")
:170

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
q = torch.randn((1, B_T, G, N_H_L, D_H), dtype=dtype, device="cuda")
:272

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
k = torch.randn((B, MAX_T, G, 1, D_H), dtype=dtype, device="cuda")
:273

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
q = torch.randn((1, 3, G, N_H_L, D_H), dtype=dtype, device="cuda")
:416

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
k = torch.randn((3, MAX_T, G, 1 if gqa else N_H_L, D_H), dtype=dtype, device="cuda")
:417

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
attn_split = torch.randn([split_k, B, M, G, N_H_L, D_H], dtype=dtype, device="cuda")
:499

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
lse_split = torch.randn([split_k, B, G, N_H_L, M], dtype=dtype, device="cuda")
:500

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
(3 * torch.rand(B, M, H, K, dtype=dtype, device="cuda")) for _ in range(3)
:549

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
q = 3 * torch.rand((B, M, H, K), device="cuda", dtype=dtype)
:579

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
k = 3 * torch.rand((B, M, H, K), device="cuda", dtype=dtype)
:580

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
v = 3 * torch.rand((B, M, H, K), device="cuda", dtype=dtype)
:581

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
grad_out = 3 * torch.rand((B, M, H, K), device="cuda", dtype=dtype)
:582

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
q = 3 * torch.rand((B, M, H, K), device="cuda", dtype=dtype)
:642

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
k = 3 * torch.rand((B, M, H, K), device="cuda", dtype=dtype)
:643

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
v = 3 * torch.rand((B, M, H, K), device="cuda", dtype=dtype)
:644

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
q = 3 * torch.rand((B, M, F * H, K), device="cuda", dtype=dtype)
:710

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
k = 3 * torch.rand((B, M, F * H, K), device="cuda", dtype=dtype)
:711

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
v = 3 * torch.rand((B, M, F * H, K), device="cuda", dtype=dtype)
:712

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

tests/test_fwbw_overlap.py· 10
B
xFormers dependency
from xformers.fwbw_overlap import (
:11

xFormers is a CUDA-centric library and its fwbw_overlap module relies on CUDA-specific overlap primitives not available on ROCm. This test import will fail on AMD Instinct GPUs, so the test should be guarded or the xFormers dependency replaced with a ROCm-compatible alternative (e.g., flash-attention for ROCm).

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

Suggested change · advisory
--- a/tests/test_fwbw_overlap.py
+++ b/tests/test_fwbw_overlap.py
@@ -8,6 +8,11 @@
import pytest
+import torch
+IS_HIP = torch.version.hip is not None
+
+pytestmark = pytest.mark.skipif(IS_HIP, reason="xFormers fwbw_overlap is CUDA-only; not supported on ROCm")
+
from xformers.fwbw_overlap import (
A
Device string "cuda"
w1 = torch.randn([128, 128], device="cuda", requires_grad=True)
:58

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
w2 = torch.randn([128, 128], device="cuda", requires_grad=True)
:59

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = torch.randn([128, 128], device="cuda", requires_grad=True)
:60

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = torch.randn([128], device="cuda", requires_grad=True)
:125

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
gy = torch.randn([128], device="cuda")
:126

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = torch.randn([128], device="cuda", requires_grad=True)
:157

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
gy = torch.randn([128], device="cuda")
:158

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = torch.randn([128], device="cuda", requires_grad=True)
:176

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
gy = torch.randn([128], device="cuda")
:177

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

tests/test_indexing.py· 8
B
xFormers dependency
import xformers.ops as xops
:11

xFormers is a CUDA-centric library whose custom kernels (e.g., memoryefficientattention) are not built or supported on ROCm, so this import will fail on AMD Instinct GPUs. For ROCm migration, replace xFormers attention calls with PyTorch's native F.scaleddotproductattention or the ROCm-compatible flashattn fork. This is advisory only and must be validated on target hardware.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

Suggested change · advisory
--- tests/test_indexing.py
+++ tests/test_indexing.py
@@ -8,7 +8,8 @@
-import xformers.ops as xops
+# xFormers is not supported on ROCm; use native SDPA or flash_attn (ROCm fork) instead.
+# import xformers.ops as xops # disabled for ROCm migration
+import torch.nn.functional as F
B
xFormers dependency
from xformers.ops import indexing
:12

xFormers is primarily optimized for NVIDIA CUDA and its indexing op may not be supported or performant on ROCm/AMD Instinct GPUs. This dependency should be replaced with native PyTorch indexing operations (e.g., torch.index_select or standard tensor indexing) to ensure portability across ROCm.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

Suggested change · advisory
--- tests/test_indexing.py
+++ tests/test_indexing.py
@@ -12,1 +12,1 @@
-from xformers.ops import indexing
+# Use native PyTorch indexing for ROCm compatibility
+# Replace xformers indexing calls with torch.index_select or equivalent
A
Device string "cuda"
inp = torch.randn([B_out, M, D], device="cuda", dtype=dtype, requires_grad=True)
:32

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
src = torch.randn([B_src, M, D], device="cuda", dtype=dtype, requires_grad=True)
:33

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
index = torch.tensor(index_py, dtype=torch.int64, device="cuda")
:38

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
scaling = torch.randn([D], device="cuda", dtype=dtype, requires_grad=True)
:41

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
src = torch.randn([num_rows, D], device="cuda", dtype=dtype, requires_grad=True)
:88

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
torch.tensor(index[: int(0.6 * B)], dtype=torch.int64, device="cuda")
:96

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

tests/test_mem_eff_attention.py· 74
B
xFormers dependency
import xformers.ops
:23

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.attn_bias_utils import create_attn_bias, pack_kv_cache
:26

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.ops import fmha
:27

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.ops.fmha import ALL_BW_OPS, ALL_FW_OPS
:28

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.ops.fmha.common import (
:29

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.ops.fmha.dispatch import _dispatch_fw_priority_list
:34

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

A
torch.cuda API usage
if torch.cuda.is_available():
:51

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
compute_capability = torch.cuda.get_device_capability("cuda")
:52

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
compute_capability = torch.cuda.get_device_capability("cuda")
:52

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
_devices += ["cuda"] if torch.cuda.is_available() else []
:80

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
_devices += ["cuda"] if torch.cuda.is_available() else []
:80

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
if device == "cuda" and op.CUDA_MINIMUM_COMPUTE_CAPABILITY > compute_capability:
:717

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device = "cuda"
:998

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device = "cuda"
:1061

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
if device != "cuda":
:1169

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
s_hipri = torch.cuda.Stream(priority=-1)
:1185

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
s_lopri = torch.cuda.Stream(priority=0)
:1186

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.synchronize()
:1190

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(s_lopri):
:1191

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda._sleep(100_000_000) # wait 100m cycles
:1192

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(s_hipri):
:1195

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.synchronize()
:1202

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
if device not in {"cuda", "mtia"}:
:1238

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
q = torch.empty([1, 1, K, 4], device="cuda", dtype=torch.float16).permute(
:1382

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
q = torch.empty([1, 2, 1, K + 1], device="cuda", dtype=torch.float16)[:, :, :, :K]
:1399

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
[1, 4, 1, 16], device="cuda", dtype=torch.float16, requires_grad=True
:1413

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
k = torch.randn((bsize, padding, n_heads, d), device="cuda", dtype=torch.float16)
:1596

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
v = torch.randn((bsize, padding, n_heads, d), device="cuda", dtype=torch.float16)
:1599

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
torch.randn((1, n_q_first, n_heads, d), device="cuda", dtype=torch.float16),
:1602

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
torch.randn((1, other, n_heads, d), device="cuda", dtype=torch.float16),
:1603

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

B
Triton dependency
import triton
:1675

OpenAI Triton has an AMD backend. Kernels usually run on ROCm with a matching Triton build; occasional tuning is needed.

RecommendInstall the ROCm-enabled Triton build.

A
Device string "cuda"
k = torch.randn(k_shape, dtype=dtype_, device="cuda")
:1695

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
v = torch.randn(k_shape, dtype=dtype_, device="cuda")
:1697

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
q = torch.randn(q_shape, dtype=dtype_, device="cuda")
:1698

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
k = torch.zeros(k_shape, dtype=torch.int32, device="cuda")
:1702

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
v = torch.zeros(k_shape, dtype=torch.int32, device="cuda")
:1705

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = x // (2 ** (4 * torch.arange(8, device="cuda")))
:1732

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

B
xFormers dependency
from xformers.ops import fmha
:1871

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

A
Device string "cuda"
device = "cuda"
:1878

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
torch.randn([B, Mq, H, K], device="cuda", dtype=dtype) * 3,
:1907

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
torch.randn([B, Mkv, H, K], device="cuda", dtype=dtype) * 3,
:1908

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
torch.randn([B, Mkv, H, Kv], device="cuda", dtype=dtype) * 3,
:1909

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
torch.randn([B, H, Mq, Mkv], device="cuda", dtype=dtype) * 3,
:1910

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device = "cuda"
:2152

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
(fmha.triton_splitk.FwOp, "cuda", torch.float16, type(None), *s)
:2256

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
(fmha.triton_splitk.FwOp, "cuda", torch.bfloat16, type(None), *s)
:2259

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

B
Triton dependency
import triton
:2502

OpenAI Triton has an AMD backend. Kernels usually run on ROCm with a matching Triton build; occasional tuning is needed.

RecommendInstall the ROCm-enabled Triton build.

A
Device string "cuda"
q = torch.randn((B, 1, N_H_L, D_H), dtype=torch.bfloat16, device="cuda")
:2538

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
0, 64, (B, MAX_T, N_KVH_L, D_H_KV * 4), dtype=torch.uint8, device="cuda"
:2547

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
0, 64, (B, MAX_T, N_KVH_L, D_H_KV * 4), dtype=torch.uint8, device="cuda"
:2551

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
(B, MAX_T, N_KVH_L, D_H), dtype=torch.bfloat16, device="cuda"
:2562

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
B * padded_per_row_len // page_size, device="cuda", dtype=torch.int32
:2580

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
g = torch.cuda.CUDAGraph()
:2612

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.graph(g):
:2613

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
g = torch.cuda.CUDAGraph()
:2636

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.graph(g):
:2637

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
g = torch.cuda.CUDAGraph()
:2722

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.graph(g):
:2723

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
"cuda",
:2764

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device = torch.device("cuda")
:2838

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
q = torch.randn(B, seq_len, nheads, head_dim, device="cuda", dtype=dtype_init)
:2918

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
k = torch.randn(B, seq_len, nheads, head_dim, device="cuda", dtype=dtype_init)
:2919

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
v = torch.randn(B, seq_len, nheads, head_dim, device="cuda", dtype=dtype_init)
:2920

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
q = torch.randn(B, seq_len_q, nheads_q, head_dim, device="cuda", dtype=dtype_init)
:3013

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
k = torch.randn(B, seq_len_kv, nheads_kv, head_dim, device="cuda", dtype=dtype_init)
:3014

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
v = torch.randn(B, seq_len_kv, nheads_kv, head_dim, device="cuda", dtype=dtype_init)
:3015

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
if "cuda" not in _devices:
:3062

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
q = torch.randn(B, seq_len_q, nheads_q, head_dim, device="cuda", dtype=dtype)
:3078

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
k = torch.randn(B, max_len_kv, nheads_kv, head_dim, device="cuda", dtype=dtype)
:3079

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
v = torch.randn(B, max_len_kv, nheads_kv, head_dim, device="cuda", dtype=dtype)
:3080

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
seqlens = torch.randint(max_len_kv // tile_sz, size=(B,), device="cuda")
:3089

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
seqlens = torch.randint(max_len_kv, size=(B,), device="cuda")
:3092

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
torch.arange(max_len_kv, device="cuda")[None, :].expand(B, max_len_kv)
:3106

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
B * padded_per_row_len // page_size, device="cuda", dtype=torch.int32
:3125

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

tests/test_profiler.py· 15
B
xFormers dependency
import xformers.ops as xops
:14

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
import xformers.ops.fmha as fmha
:15

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
import xformers.profiler
:16

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.profiler import profile_analyzer
:19

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

A
Device string "cuda"
x = torch.zeros([10, 10], device="cuda")
:34

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
x.record_stream(torch.cuda.Stream()) # type: ignore
:39

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
("cuda", 4096, 8),
:50

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
("cuda", 1, 1),
:52

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
if torch.cuda.is_available()
:54

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
w = torch.empty([128, 128], dtype=dtype, device="cuda", requires_grad=True)
:158

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = torch.ones([B, 1, N, 128], dtype=dtype, device="cuda", requires_grad=True)
:159

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = torch.ones([B, H, M, K], dtype=dtype, device="cuda", requires_grad=True)
:180

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
device_sm = torch.cuda.get_device_capability(x.device)
:185

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
x = torch.ones([B, M, H, K], dtype=dtype, device="cuda", requires_grad=True)
:211

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
device_sm = torch.cuda.get_device_capability(x.device)
:218

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

tests/test_rmsnorm.py· 9
B
xFormers dependency
from xformers.ops import RMSNorm
:12

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

A
torch.cuda API usage
if torch.cuda.is_available():
:17

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
compute_capability = torch.cuda.get_device_capability("cuda")
:18

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
compute_capability = torch.cuda.get_device_capability("cuda")
:18

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
device = torch.device("cuda")
:53

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
.cuda() tensor/module move
rms_layer = RMSNorm(K).cuda()
:55

.cuda() on tensors and modules is honoured by ROCm PyTorch and moves data to the AMD GPU. No change needed.

RecommendNo change required on ROCm PyTorch.

A
.cuda() tensor/module move
baseline_layer = RMSNormPytorch(K).cuda()
:56

.cuda() on tensors and modules is honoured by ROCm PyTorch and moves data to the AMD GPU. No change needed.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device = torch.device("cuda")
:85

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
.cuda() tensor/module move
rms_layer = RMSNorm(K, include_weight=include_weight).cuda()
:88

.cuda() on tensors and modules is honoured by ROCm PyTorch and moves data to the AMD GPU. No change needed.

RecommendNo change required on ROCm PyTorch.

tests/test_rope_padded.py· 8
B
xFormers dependency
from xformers.ops import rope_padded
:13

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.ops.fmha.attn_bias import BlockDiagonalCausalWithOffsetPaddedKeysMask
:14

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

A
torch.cuda API usage
if torch.cuda.is_available():
:19

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
compute_capability = torch.cuda.get_device_capability("cuda")
:20

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
compute_capability = torch.cuda.get_device_capability("cuda")
:20

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
device = torch.device("cuda")
:180

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device = "cuda"
:272

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device = "cuda"
:305

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

tests/test_seqpar.py· 11
B
xFormers dependency
from xformers.ops import (
:13

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

A
torch.cuda API usage
if torch.cuda.is_available():
:21

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
compute_capability = torch.cuda.get_device_capability("cuda")
:22

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
compute_capability = torch.cuda.get_device_capability("cuda")
:22

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.device_count() < 2, reason="needs at least 2 GPUs"
:27

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
device="cuda",
:98

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device="cuda",
:106

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device="cuda",
:116

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device="cuda",
:174

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device="cuda",
:181

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device="cuda",
:188

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

tests/test_sequence_parallel_fused_ops.py· 10
B
xFormers dependency
from xformers.ops import fused_allgather_and_linear, fused_linear_and_reducescatter
:14

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

A
torch.cuda API usage
if torch.cuda.is_available():
:19

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
compute_capability = torch.cuda.get_device_capability("cuda")
:20

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
compute_capability = torch.cuda.get_device_capability("cuda")
:20

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.device_count() < 2, reason="needs at least 2 GPUs"
:25

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
device="cuda",
:59

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
(inner_dim, outer_dim), dtype=dtype, device="cuda", low=0, high=1
:64

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device="cuda",
:82

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device="cuda",
:89

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
(world_size,) + subbatch_dims + (outer_dim,), dtype=dtype, device="cuda"
:96

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

tests/test_sparse_tensors.py· 7
B
xFormers dependency
import xformers # noqa: F401
:10

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.ops import masked_matmul
:11

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.sparse import BlockSparseTensor
:12

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

A
Device string "cuda"
["cpu", "cuda:0"] if torch.cuda.is_available() and torch.version.cuda else ["cpu"]
:17

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
["cpu", "cuda:0"] if torch.cuda.is_available() and torch.version.cuda else ["cpu"]
:17

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.manual_seed_all(42)
:45

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
if tensor_type == BlockSparseTensor and "cuda" in device:
:51

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

tests/test_sparsity24.py· 83
B
xFormers dependency
import xformers # noqa: F401
:15

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
import xformers.ops as xops
:16

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
import xformers.ops.sp24 as sp24
:17

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

A
torch.cuda API usage
if torch.cuda.is_available():
:23

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
compute_capability = torch.cuda.get_device_capability("cuda")
:24

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
compute_capability = torch.cuda.get_device_capability("cuda")
:24

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
device="cuda",
:67

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device="cuda",
:84

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device="cuda",
:105

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
inp = torch.randn([5, 5], device="cuda", dtype=dtype)
:123

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
inp = torch.randn([2048, 2048], device="cuda", dtype=dtype)
:131

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = torch.randn([128, 64], device="cuda", dtype=torch.float16, requires_grad=True)
:156

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = torch.randn([128, 64], device="cuda", dtype=torch.float16, requires_grad=False)
:174

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
a = torch.randn([M, K], device="cuda", dtype=dtype)
:280

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
b = torch.randn([K, N], device="cuda", dtype=dtype)
:281

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
.cuda() tensor/module move
packed_a = packed_a.cuda()
:288

.cuda() on tensors and modules is honoured by ROCm PyTorch and moves data to the AMD GPU. No change needed.

RecommendNo change required on ROCm PyTorch.

A
.cuda() tensor/module move
mask_reordered = mask_reordered.cuda()
:290

.cuda() on tensors and modules is honoured by ROCm PyTorch and moves data to the AMD GPU. No change needed.

RecommendNo change required on ROCm PyTorch.

A
.cuda() tensor/module move
mask = mask.to(dtype).cuda()
:291

.cuda() on tensors and modules is honoured by ROCm PyTorch and moves data to the AMD GPU. No change needed.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
local_meta = torch.zeros([4, 8, 8], dtype=torch.int64, device="cuda")
:302

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
0, 256, size=(2, 2, 8), dtype=torch.int64, device="cuda"
:304

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
.cuda() tensor/module move
a = a.cuda().to(dtype)
:357

.cuda() on tensors and modules is honoured by ROCm PyTorch and moves data to the AMD GPU. No change needed.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
b = torch.randn([a.shape[1], 128], device="cuda", dtype=dtype)
:358

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
.cuda() tensor/module move
mask_reordered = torch.ops.xformers._sparse24_reorder_meta(mask_packed).cuda()
:366

.cuda() on tensors and modules is honoured by ROCm PyTorch and moves data to the AMD GPU. No change needed.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
a = torch.randn([N, N], dtype=dtype, device="cuda")
:384

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
b = torch.eye(N, dtype=dtype, device="cuda")
:385

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device="cuda",
:426

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
a = torch.randn([32, 64], dtype=dtype, device="cuda")
:428

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = torch.randn([M, N], dtype=dtype, device="cuda")
:445

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = torch.randn([M, N], dtype=dtype, device="cuda")
:462

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
y = torch.randn([M, N], dtype=dtype, device="cuda")
:463

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = torch.randn([N, N], dtype=dtype, device="cuda")
:480

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
a = torch.zeros([M, N], device="cuda", dtype=torch.float16)
:517

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
_gen4x4(r), device="cuda", dtype=torch.float16
:522

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
a = torch.randn([M, K], device="cuda", dtype=dtype)
:574

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
b = torch.randn([K, N], device="cuda", dtype=dtype)
:575

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
a = torch.randn([64, 128], device="cuda", dtype=torch.float16)
:593

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
b = torch.randn([128], device="cuda", dtype=torch.float16)
:594

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
a = torch.randn([64, 128], device="cuda", dtype=torch.float16)
:604

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
b = torch.randn([5, 6, 128], device="cuda", dtype=torch.float16)
:605

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = torch.randn([B, in_ft], dtype=dtype, device="cuda", requires_grad=True)
:624

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
torch.randn([in_ft, hid_ft], dtype=dtype, device="cuda", requires_grad=False)
:626

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
torch.randn([hid_ft, out_ft], dtype=dtype, device="cuda", requires_grad=False)
:630

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
torch.randn([B, out_ft], dtype=dtype, device="cuda", requires_grad=False) * 0.1
:634

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = torch.randn([B, in_ft], dtype=dtype, device="cuda", requires_grad=True)
:672

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
torch.randn([in_ft, hid_ft], dtype=dtype, device="cuda", requires_grad=False)
:674

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
torch.randn([in_ft, hid_ft], dtype=dtype, device="cuda", requires_grad=False)
:678

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
torch.randn([hid_ft, out_ft], dtype=dtype, device="cuda", requires_grad=False)
:682

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
torch.randn([B, out_ft], dtype=dtype, device="cuda", requires_grad=False) * 0.1
:686

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
A = torch.randn([M, K], dtype=dtype, device="cuda")
:727

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
B = torch.randn([K, N], dtype=dtype, device="cuda")
:728

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = torch.randn([M, N], dtype=dtype, device="cuda")
:742

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = torch.randn([N, M], dtype=dtype, device="cuda").t()
:744

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = torch.randn([128, 512], dtype=dtype, device="cuda", requires_grad=True)
:756

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
w = torch.randn([1024, 512], dtype=dtype, device="cuda", requires_grad=True)
:757

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x0 = torch.randn([128, 128], device="cuda", dtype=torch.float16, requires_grad=True)
:795

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
.cuda() tensor/module move
m = LinearW24(128, 128, bias=False).cuda().to(torch.float16)
:796

.cuda() on tensors and modules is honoured by ROCm PyTorch and moves data to the AMD GPU. No change needed.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = torch.randn([B, ft_in], device="cuda", dtype=model_dtype, requires_grad=True)
:814

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
grad = torch.randn([B, ft_out], device="cuda", dtype=model_dtype)
:815

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
.cuda() tensor/module move
m = torch.nn.Linear(ft_in, ft_out, bias=bias).cuda().to(model_dtype)
:816

.cuda() on tensors and modules is honoured by ROCm PyTorch and moves data to the AMD GPU. No change needed.

RecommendNo change required on ROCm PyTorch.

A
.cuda() tensor/module move
m24 = LinearW24(ft_in, ft_out, bias=bias).cuda().to(model_dtype)
:817

.cuda() on tensors and modules is honoured by ROCm PyTorch and moves data to the AMD GPU. No change needed.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
with torch.autocast("cuda", dtype=dtype, enabled=amp):
:819

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
A = torch.randn([128, 128], device="cuda", dtype=torch.float16)
:872

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
B = torch.randn([128, 4], device="cuda", dtype=torch.float16)
:873

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
A = torch.randn([128, 128], device="cuda", dtype=torch.float16)
:882

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
B = torch.randn([128, 8], device="cuda", dtype=torch.float16)
:883

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
A = torch.randn([128, 128], device="cuda", dtype=torch.float16)
:891

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
B = torch.randn([128, 16], device="cuda", dtype=torch.float32)
:892

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = torch.randn([B, ft_in], device="cuda", dtype=torch.float16)
:903

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
weight = torch.randn([ft_out, ft_in], device="cuda", dtype=torch.float16)
:904

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
torch.randn([ft_out], device="cuda", dtype=torch.float16) if with_bias else None
:906

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = torch.randn([1024, 512], device="cuda", dtype=torch.float16, requires_grad=True)
:939

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
e = torch.eye(x.shape[0], x.shape[0], device="cuda", dtype=torch.float16)
:940

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
m = _TransformerFFN(FT_IN, FT_HIDDEN, linear_cls=LinearW24).to("cuda").to(dtype)
:988

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
m_c = _TransformerFFN(FT_IN, FT_HIDDEN, linear_cls=LinearW24).to("cuda").to(dtype)
:989

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x, grad = [torch.randn([B, FT_IN], dtype=dtype, device="cuda") for _ in range(2)]
:993

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = torch.randn([512, 512], dtype=torch.float16, device="cuda", requires_grad=True)
:1018

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
x = torch.randn([512, 512], dtype=dtype, device="cuda", requires_grad=True)
:1028

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
y = torch.randn([512, 512], dtype=dtype, device="cuda", requires_grad=True)
:1029

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
[1024, 1024], device="cuda", dtype=torch.float16, requires_grad=True
:1070

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
A = torch.randn([128, 128], device="cuda", dtype=dtype)
:1091

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
A = torch.randn([M, K], device="cuda", dtype=torch.bfloat16)
:1119

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
A = torch.randn([M, K], device="cuda", dtype=torch.bfloat16)
:1154

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
torch.randn([N, K], device="cuda", dtype=torch.bfloat16), dtype
:1159

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

tests/test_splitk_reference.py· 2
B
xFormers dependency
import xformers.ops
:11

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.ops import fmha
:12

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

tests/test_tiled_matmul.py· 9
B
xFormers dependency
from xformers import _is_triton_available
:11

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.ops.tiled_matmul import tiled_matmul
:12

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

A
torch.cuda API usage
if torch.cuda.is_available():
:17

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
compute_capability = torch.cuda.get_device_capability("cuda")
:18

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
compute_capability = torch.cuda.get_device_capability("cuda")
:18

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

B
xFormers dependency
from xformers.ops._triton.tiled_matmul_kernels import _xformers_tiled_matmul_kernel
:26

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

A
.cuda() tensor/module move
a = a.cuda().requires_grad_()
:129

.cuda() on tensors and modules is honoured by ROCm PyTorch and moves data to the AMD GPU. No change needed.

RecommendNo change required on ROCm PyTorch.

A
.cuda() tensor/module move
b = b.cuda().requires_grad_()
:130

.cuda() on tensors and modules is honoured by ROCm PyTorch and moves data to the AMD GPU. No change needed.

RecommendNo change required on ROCm PyTorch.

A
.cuda() tensor/module move
c_reference = c_reference.cuda()
:131

.cuda() on tensors and modules is honoured by ROCm PyTorch and moves data to the AMD GPU. No change needed.

RecommendNo change required on ROCm PyTorch.

tests/test_tree_attention.py· 20
B
xFormers dependency
from xformers.ops import fmha
:13

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.ops.fmha.attn_bias import (
:14

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.ops.fmha.common import AttentionFwOpBase
:18

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.ops.tree_attention import (
:19

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.utils import do_bench_cudagraph
:26

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

A
torch.cuda API usage
if torch.cuda.is_available():
:29

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
compute_capability = torch.cuda.get_device_capability("cuda")
:30

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
compute_capability = torch.cuda.get_device_capability("cuda")
:30

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
q_full = torch.randn([B, tree_size_kv, G, H, D], device="cuda", dtype=dtype)
:138

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
spec_k = torch.randn([B, tree_size_kv, G, 1, D], device="cuda", dtype=dtype)
:140

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
cache_k = torch.randn([B, Mk, G, 1, D], device="cuda", dtype=dtype)
:146

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
torch.cuda.synchronize()
:189

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
bench_stream = torch.cuda.Stream()
:190

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(bench_stream):
:191

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.synchronize()
:206

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
bench_stream = torch.cuda.Stream()
:207

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(bench_stream):
:208

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.synchronize()
:257

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
bench_stream = torch.cuda.Stream()
:265

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(bench_stream):
:266

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

tests/test_unbind.py· 2
B
xFormers dependency
import xformers.ops
:11

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.ops.common import _get_storage_base
:12

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

tests/utils.py· 7
B
xFormers dependency
from xformers.attn_bias_utils import pack_kv_cache, ref_attention, ref_attention_bmhk
:13

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.ops.fmha import Inputs
:14

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.ops.fmha.attn_bias import (
:15

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.ops.fmha.triton_splitk import InputsFp8
:19

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

A
torch.cuda API usage
not torch.cuda.is_available() and not torch.mtia.is_available(),
:22

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
cuda_only = pytest.mark.skipif(not torch.cuda.is_available(), reason="requires CUDA")
:25

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
not torch.cuda.is_available() or not torch.version.hip, reason="requires ROCM"
:27

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

xformers/__init__.py· 4
A
torch.cuda API usage
if not torch.cuda.is_available():
:48

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
if torch.cuda.get_device_capability("cuda") < (8, 0):
:54

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
if torch.cuda.get_device_capability("cuda") < (8, 0):
:54

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

B
Triton dependency
import triton # noqa
:57

OpenAI Triton has an AMD backend. Kernels usually run on ROCm with a matching Triton build; occasional tuning is needed.

RecommendInstall the ROCm-enabled Triton build.

xformers/benchmarks/benchmark_attn_decoding.py· 14
B
xFormers dependency
import xformers.ops as xops
:15

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.attn_bias_utils import create_attn_bias
:16

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.benchmarks.utils import benchmark_main_helper2, NotSupportedInputError
:17

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

A
Device string "cuda"
device = torch.device("cuda")
:20

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
[B, Mq, Hkv, Hq // Hkv, K], device="cuda", dtype=dtype, requires_grad=bw
:101

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
[B, Mkv, Hkv, 1, K], device="cuda", dtype=dtype, requires_grad=bw
:104

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
[B, Mkv, Hkv, 1, K], device="cuda", dtype=dtype, requires_grad=bw
:107

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
[B, Mq, Hkv, Hq // Hkv, K], device="cuda", dtype=dtype, requires_grad=bw
:194

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
[B, Mkv, Hkv, 1, K], device="cuda", dtype=dtype, requires_grad=bw
:197

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
[B, Mkv, Hkv, 1, K], device="cuda", dtype=dtype, requires_grad=bw
:200

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
[B, Mq, Hkv, Hq // Hkv, K], device="cuda", dtype=dtype, requires_grad=bw
:274

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
[B, Mkv, Hkv, 1, K], device="cuda", dtype=dtype, requires_grad=bw
:277

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
[B, Mkv, Hkv, 1, K], device="cuda", dtype=dtype, requires_grad=bw
:280

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

B
FlashAttention dependency
import flash_attn
:367

FlashAttention has an official ROCm/CK implementation. Swapping the wheel (or using PyTorch SDPA) is mechanical.

RecommendInstall the ROCm FlashAttention build or fall back to torch SDPA.

xformers/benchmarks/benchmark_indexing.py· 9
B
xFormers dependency
import xformers.ops as xops
:11

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

A
Device string "cuda"
device = torch.device("cuda")
:15

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
[B_out, M, D], device="cuda", dtype=dtype, requires_grad=bw
:60

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
[B_src, M, D], device="cuda", dtype=dtype, requires_grad=bw
:63

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
torch.randn([D], device="cuda", dtype=dtype, requires_grad=bw)
:66

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
[i for i in range(self.src.shape[0])], dtype=torch.int64, device="cuda"
:71

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
self.grad = torch.randn([B_out, M, D], device="cuda", dtype=dtype)
:73

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device="cuda",
:121

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
[B, seqlen * D], dtype=dtype, device="cuda", requires_grad=bw
:125

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

xformers/benchmarks/benchmark_mem_eff_attention.py· 6
B
xFormers dependency
import xformers.ops
:13

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
import xformers.ops.fmha as fmha
:14

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.attn_bias_utils import create_attn_bias, ref_attention
:16

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.benchmarks.utils import benchmark_main_helper, create_argparser
:17

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

A
Device string "cuda"
device = torch.device("cuda")
:22

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
NUM_THREADS = [1] if device.type == "cuda" else [1, 40]
:24

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

xformers/benchmarks/benchmark_merge_attentions.py· 6
B
xFormers dependency
from xformers.ops import fmha
:8

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.utils import do_bench_cudagraph
:9

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

A
torch.cuda API usage
bench_stream = torch.cuda.Stream()
:40

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(bench_stream):
:41

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
[B, M, G, N_H_L, D_H], dtype=dtype, device="cuda", requires_grad=True
:45

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
[B, G, N_H_L, M], dtype=dtype, device="cuda", requires_grad=True
:51

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

xformers/benchmarks/benchmark_sequence_parallel_fused.py· 9
A
torch.cuda API usage
torch.cuda.set_device(my_rank)
:135

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

B
xFormers dependency
from xformers.ops import fused_allgather_and_linear
:220

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.ops import fused_linear_and_reducescatter
:231

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.ops import fused_allgather_and_linear
:242

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.ops import fused_linear_and_reducescatter
:254

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.ops import fused_allgather_and_linear
:266

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.ops import fused_linear_and_reducescatter
:279

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

A
torch.cuda API usage
tuple(torch.cuda.Event(enable_timing=my_rank == 0) for _ in range(2))
:364

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.synchronize()
:405

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

xformers/benchmarks/benchmark_sp24.py· 6
B
xFormers dependency
import xformers.ops as xops
:12

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

A
Device string "cuda"
device = torch.device("cuda")
:17

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
self.grad = torch.randn([B, out_ft], device="cuda", dtype=dtype)
:58

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
[B, in_ft], device="cuda", dtype=dtype, requires_grad=True
:60

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
self.to("cuda").to(dtype)
:63

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
[B, in_ft], device="cuda", dtype=dtype, requires_grad=True
:126

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

xformers/benchmarks/benchmark_tiled_matmul.py· 4
B
xFormers dependency
from xformers.benchmarks.utils import benchmark_main_helper, DTYPE2STR
:12

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
xFormers dependency
from xformers.ops.tiled_matmul import tiled_matmul
:13

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

A
Device string "cuda"
a = torch.randn((m, k), device="cuda", dtype=dtype)
:68

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
b = torch.randn((k, n), device="cuda", dtype=dtype)
:69

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

xformers/benchmarks/utils.py· 15
A
torch.cuda API usage
_triton_is_available = torch.cuda.is_available()
:38

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

B
Triton dependency
import triton
:41

OpenAI Triton has an AMD backend. Kernels usually run on ROCm with a matching Triton build; occasional tuning is needed.

RecommendInstall the ROCm-enabled Triton build.

A
Device string "cuda"
device = torch.device("cuda")
:126

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
torch.cuda.get_device_name(torch.cuda.current_device())
:492

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.synchronize()
:546

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.reset_peak_memory_stats()
:547

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
mem_begin = torch.cuda.max_memory_allocated() / 2**20
:548

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.synchronize()
:576

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.synchronize()
:583

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
memory = torch.cuda.max_memory_allocated() / 2**20 - mem_begin
:586

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.reset_peak_memory_stats()
:589

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
mem_begin = torch.cuda.max_memory_allocated() / 2**20
:590

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
e, (torch.cuda.OutOfMemoryError, triton.runtime.autotuner.OutOfResources)
:645

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
g = torch.cuda.CUDAGraph()
:735

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.graph(g):
:736

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

xformers/csrc/nvcc_info.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

Hand-written .cu/.cuh kernels compile only with nvcc. AMD's HIPify tools translate the vast majority of CUDA C++ to HIP automatically.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

xformers/csrc/pt_stable_utils.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

Hand-written .cu/.cuh kernels compile only with nvcc. AMD's HIPify tools translate the vast majority of CUDA C++ to HIP automatically.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

xformers/csrc/sparse24/gemm.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

Hand-written .cu/.cuh kernels compile only with nvcc. AMD's HIPify tools translate the vast majority of CUDA C++ to HIP automatically.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

xformers/csrc/sparse24/meta_utils.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

Hand-written .cu/.cuh kernels compile only with nvcc. AMD's HIPify tools translate the vast majority of CUDA C++ to HIP automatically.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

xformers/csrc/sparse24/sparse24_apply_dense_output.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

Hand-written .cu/.cuh kernels compile only with nvcc. AMD's HIPify tools translate the vast majority of CUDA C++ to HIP automatically.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

xformers/csrc/sparse24/sparse24_apply.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

Hand-written .cu/.cuh kernels compile only with nvcc. AMD's HIPify tools translate the vast majority of CUDA C++ to HIP automatically.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

xformers/csrc/sparse24/sparse24_gemm_sm90.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

Hand-written .cu/.cuh kernels compile only with nvcc. AMD's HIPify tools translate the vast majority of CUDA C++ to HIP automatically.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

xformers/csrc/sparse24/sparse24_largest_mask_2d.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

Hand-written .cu/.cuh kernels compile only with nvcc. AMD's HIPify tools translate the vast majority of CUDA C++ to HIP automatically.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

xformers/csrc/sparse24/sparse24_pack_test.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

Hand-written .cu/.cuh kernels compile only with nvcc. AMD's HIPify tools translate the vast majority of CUDA C++ to HIP automatically.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

xformers/csrc/sparse24/sparse24_pack.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

Hand-written .cu/.cuh kernels compile only with nvcc. AMD's HIPify tools translate the vast majority of CUDA C++ to HIP automatically.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

xformers/csrc/sparse24/sparseNM_dense.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

Hand-written .cu/.cuh kernels compile only with nvcc. AMD's HIPify tools translate the vast majority of CUDA C++ to HIP automatically.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

xformers/ops/_triton/__init__.py· 1
B
xFormers dependency
import xformers
:12

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

xformers/ops/_triton/k_index_select_cat.py· 2
B
Triton dependency
import triton
:7

OpenAI Triton has an AMD backend. Kernels usually run on ROCm with a matching Triton build; occasional tuning is needed.

RecommendInstall the ROCm-enabled Triton build.

B
Triton dependency
import triton.language as tl
:8

OpenAI Triton has an AMD backend. Kernels usually run on ROCm with a matching Triton build; occasional tuning is needed.

RecommendInstall the ROCm-enabled Triton build.

xformers/ops/_triton/k_scaled_index_add.py· 2
B
Triton dependency
import triton
:9

OpenAI Triton has an AMD backend. Kernels usually run on ROCm with a matching Triton build; occasional tuning is needed.

RecommendInstall the ROCm-enabled Triton build.

B
Triton dependency
import triton.language as tl
:10

OpenAI Triton has an AMD backend. Kernels usually run on ROCm with a matching Triton build; occasional tuning is needed.

RecommendInstall the ROCm-enabled Triton build.

xformers/ops/_triton/matmul_perf_model.py· 8
B
Triton dependency
from triton import cdiv
:34

OpenAI Triton has an AMD backend. Kernels usually run on ROCm with a matching Triton build; occasional tuning is needed.

RecommendInstall the ROCm-enabled Triton build.

B
Triton dependency
from triton.runtime import driver
:35

OpenAI Triton has an AMD backend. Kernels usually run on ROCm with a matching Triton build; occasional tuning is needed.

RecommendInstall the ROCm-enabled Triton build.

B
Triton dependency
from triton.testing import (
:36

OpenAI Triton has an AMD backend. Kernels usually run on ROCm with a matching Triton build; occasional tuning is needed.

RecommendInstall the ROCm-enabled Triton build.

B
pynvml (NVML) dependency
import pynvml
:49

pynvml queries NVIDIA-only NVML. On AMD the equivalent is amdsmi / rocm-smi; the query calls map across mechanically.

RecommendReplace pynvml calls with amdsmi (ROCm SMI Python bindings).

A
torch.cuda API usage
capability = torch.cuda.get_device_capability(device)
:85

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
device = torch.cuda.current_device()
:110

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
device = torch.cuda.current_device()
:174

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
capability = torch.cuda.get_device_capability()
:175

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

xformers/ops/_triton/rmsnorm_kernels.py· 5
B
Triton dependency
import triton
:6

OpenAI Triton has an AMD backend. Kernels usually run on ROCm with a matching Triton build; occasional tuning is needed.

RecommendInstall the ROCm-enabled Triton build.

B
Triton dependency
import triton.language as tl
:7

OpenAI Triton has an AMD backend. Kernels usually run on ROCm with a matching Triton build; occasional tuning is needed.

RecommendInstall the ROCm-enabled Triton build.

B
xFormers dependency
from xformers.triton.importing import libdevice_find
:9

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

A
torch.cuda API usage
with torch.cuda.device(x.device):
:110

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.device(x.device):
:146

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

xformers/ops/_triton/rope_padded_kernels.py· 3
B
Triton dependency
import triton # type: ignore
:5

OpenAI Triton has an AMD backend. Kernels usually run on ROCm with a matching Triton build; occasional tuning is needed.

RecommendInstall the ROCm-enabled Triton build.

B
Triton dependency
import triton.language as tl # type: ignore
:6

OpenAI Triton has an AMD backend. Kernels usually run on ROCm with a matching Triton build; occasional tuning is needed.

RecommendInstall the ROCm-enabled Triton build.

B
xFormers dependency
from xformers.triton.importing import libdevice_find
:8

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

xformers/ops/_triton/tiled_matmul_kernels.py· 3
B
Triton dependency
import triton
:11

OpenAI Triton has an AMD backend. Kernels usually run on ROCm with a matching Triton build; occasional tuning is needed.

RecommendInstall the ROCm-enabled Triton build.

B
Triton dependency
import triton.language as tl
:12

OpenAI Triton has an AMD backend. Kernels usually run on ROCm with a matching Triton build; occasional tuning is needed.

RecommendInstall the ROCm-enabled Triton build.

B
xFormers dependency
from xformers.ops._triton.matmul_perf_model import (
:14

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

xformers/ops/indexing.py· 1
B
xFormers dependency
from xformers.ops._triton import (
:10

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

xformers/ops/rope_padded.py· 3
B
xFormers dependency
from xformers.ops.fmha.attn_bias import ( # type: ignore
:9

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

B
Triton dependency
import triton
:106

OpenAI Triton has an AMD backend. Kernels usually run on ROCm with a matching Triton build; occasional tuning is needed.

RecommendInstall the ROCm-enabled Triton build.

A
torch.cuda API usage
with torch.cuda.device(xq.device):
:244

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

xformers/sparse/blocksparse_tensor.py· 1
B
xFormers dependency
from xformers.ops import masked_matmul
:10

xFormers bundles CUDA kernels. Many ops fall back to PyTorch SDPA on ROCm; some need a ROCm build.

RecommendPrefer torch SDPA; use a ROCm xFormers build where required.

examples/llama_inference/mp_utils.py· 1
A
torch.cuda API usage
torch.cuda.set_device(local_rank)
:56

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

stubs/torch_stub_tests.py· 7
A
Device string "cuda"
(8, 9), dtype=torch.int64, device="cuda", requires_grad=True
:732

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
torch.cuda.reset_peak_memory_stats()
:1022

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
0, 1, size=(2, 3, 4), device="cuda", requires_grad=True
:1620

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
0, 1, size=(2, 3, 4), device="cuda", requires_grad=True
:1624

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
y: Tensor[torch.float32, L[2], L[3], L[4]] = Tensor((2, 3, 4), device="cuda")
:1771

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
y_error: Tensor[torch.float32, L[2], L[3], L[99]] = Tensor((2, 3, 4), device="cuda")
:1773

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
y2: Tensor[torch.float32, L[2], L[3], L[4]] = Tensor(2, 3, 4, device="cuda")
:1774

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

tests/multiprocessing_utils.py· 4
A
torch.cuda API usage
if torch.cuda.device_count() >= world_size:
:79

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.set_device(rank)
:81

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.empty_cache()
:119

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.empty_cache()
:157

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

xformers/_cpp_lib.py· 1
A
Device string "cuda"
return self.metadata["version"]["cuda"]
:26

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

xformers/checkpoint.py· 5
A
torch.cuda API usage
torch.cuda.synchronize()
:251

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.synchronize()
:255

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.reset_peak_memory_stats()
:259

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
mem1 = torch.cuda.max_memory_allocated() / 2**20
:260

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
mem2 = torch.cuda.max_memory_allocated() / 2**20
:262

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

xformers/fwbw_overlap.py· 1
A
torch.cuda API usage
self._event = torch.cuda.Event()
:26

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

xformers/info.py· 4
A
torch.cuda API usage
if torch.cuda.is_available():
:29

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
device = torch.cuda.current_device()
:31

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
cap = torch.cuda.get_device_capability(device)
:32

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
features["gpu.name"] = torch.cuda.get_device_name(device)
:34

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

xformers/ops/fmha/flash.py· 2
A
Device string "cuda"
device_types=["cuda"],
:15

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device_types=["cuda"],
:22

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

xformers/ops/fmha/flash3.py· 2
A
Device string "cuda"
device_types=["cuda"],
:21

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device_types=["cuda"],
:31

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

xformers/ops/fmha/triton_splitk.py· 2
A
Device string "cuda"
device_types=["cuda"],
:46

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device_types=["cuda"],
:59

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

xformers/ops/seqpar.py· 12
A
Device string "cuda"
device_types="cuda",
:30

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device_types="cuda",
:72

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
stream_factory: Callable[[], torch.cuda.Stream],
:102

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(stream_factory()):
:105

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
events = [torch.cuda.Event() for _ in weights]
:121

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
stream_factory: Callable[[], torch.cuda.Stream],
:126

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(stream_factory()):
:132

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
device_types="cuda",
:225

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
Device string "cuda"
device_types="cuda",
:263

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
stream_factory: Callable[[], torch.cuda.Stream],
:290

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(stream_factory()):
:293

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(stream_factory()):
:297

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

xformers/ops/sequence_parallel_fused_ops.py· 32
A
torch.cuda API usage
self.second_stream = torch.cuda.Stream()
:78

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
self.memcpy_stream = torch.cuda.Stream(priority=-1)
:82

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
self.compute_wait_stream = torch.cuda.Stream(priority=-1)
:84

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
self.memcpy_wait_stream = torch.cuda.Stream(priority=-1)
:85

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
self, current_stream: torch.cuda.Stream
:90

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
) -> Callable[[], torch.cuda.Stream]:
:91

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
[List[torch.Tensor], int, Callable[[], torch.cuda.Stream]], None
:104

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.device(self.my_device):
:119

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
current_stream = torch.cuda.current_stream()
:138

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(current_stream):
:145

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(self.memcpy_wait_stream):
:159

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(self.memcpy_stream):
:169

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(self.memcpy_stream):
:176

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(self.compute_wait_stream):
:192

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
[List[torch.Tensor], int, Callable[[], torch.cuda.Stream]], None
:212

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.device(self.my_device):
:231

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
current_stream = torch.cuda.current_stream()
:250

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(current_stream):
:257

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(self.compute_wait_stream):
:271

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(final_stream):
:295

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(self.memcpy_wait_stream):
:315

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(self.memcpy_stream):
:325

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
def _default_stream_factory() -> torch.cuda.Stream:
:374

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
return torch.cuda.current_stream()
:375

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
device_types="cuda",
:520

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
stream_factory: Callable[[], torch.cuda.Stream],
:538

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(stream_factory()):
:541

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
[List[torch.Tensor], int, Callable[[], torch.cuda.Stream]], None
:567

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
device_types="cuda",
:747

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
stream_factory: Callable[[], torch.cuda.Stream],
:765

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.stream(stream_factory()):
:768

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
[List[torch.Tensor], int, Callable[[], torch.cuda.Stream]], None
:793

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

xformers/ops/sp24.py· 6
A
torch.cuda API usage
if torch.cuda.is_available():
:82

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
compute_capability = torch.cuda.get_device_capability("cuda")
:83

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
compute_capability = torch.cuda.get_device_capability("cuda")
:83

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.synchronize()
:450

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.synchronize()
:454

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
@torch.library.custom_op("xformers::_cusplt_mm", mutates_args=(), device_types=["cuda"])
:462

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

xformers/ops/tiled_matmul.py· 2
A
torch.cuda API usage
device_capability = torch.cuda.get_device_capability(device)
:21

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
device_types="cuda",
:204

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

xformers/profiler/device_limits.py· 3
A
Device string "cuda"
if device is not None and device.type == "cuda":
:106

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
device_sm = torch.cuda.get_device_capability(device)
:107

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
device_name = torch.cuda.get_device_name(device)
:108

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

xformers/profiler/profiler_dcgm_impl.py· 1
A
Device string "cuda"
default_gpu: int = torch.empty([], device="cuda").device.index
:58

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

xformers/profiler/profiler.py· 10
A
torch.cuda API usage
torch.cuda.profiler.start()
:43

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.profiler.stop()
:46

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
Device string "cuda"
limits = get_device_limits(torch.device("cuda"))
:117

The literal device string "cuda" resolves to the active AMD GPU on ROCm PyTorch. .to("cuda") / device="cuda" need no edits.

RecommendNo change required on ROCm PyTorch.

A
torch.cuda API usage
torch.cuda.synchronize()
:138

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.synchronize()
:142

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
return hasattr(torch.cuda._memory_viz, "trace_plot")
:171

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.memory._record_memory_history(
:180

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
snapshot = torch.cuda.memory._snapshot()
:195

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.memory._record_memory_history(False)
:196

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda._memory_viz.trace_plot(
:206

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

xformers/utils.py· 13
A
torch.cuda API usage
if torch.cuda.current_stream() == torch.cuda.default_stream():
:97

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
g = torch.cuda.CUDAGraph()
:112

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.graph(g):
:113

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.synchronize()
:115

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
start_event = torch.cuda.Event(enable_timing=True)
:116

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
end_event = torch.cuda.Event(enable_timing=True)
:117

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.synchronize()
:121

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
g = torch.cuda.CUDAGraph()
:126

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
with torch.cuda.graph(g):
:127

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.synchronize()
:133

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
start_event = torch.cuda.Event(enable_timing=True)
:138

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
end_event = torch.cuda.Event(enable_timing=True)
:139

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).

A
torch.cuda API usage
torch.cuda.synchronize()
:143

Calls under torch.cuda.* are aliased by ROCm builds of PyTorch. The same code runs on AMD Instinct GPUs unchanged — torch.cuda.is_available(), streams, events and AMP all map onto HIP.

RecommendNo change required. Install the ROCm build of PyTorch (pip install torch --index-url https://download.pytorch.org/whl/rocm6.1).