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

bitsandbytes-foundation/bitsandbytes

https://github.com/bitsandbytes-foundation/bitsandbytes
Mostly ready

bitsandbytes-foundation/bitsandbytes scored 79/100 for ROCm readiness (Mostly ready). Of 243 CUDA-related findings, 142 work as-is on ROCm PyTorch, 101 need a mechanical HIPify-style change, and 0 are manual blockers. The path to AMD is mostly mechanical: repin wheels and swap CUDA-only libraries for their ROCm builds.

142Works as-is
101Mechanical change
0Manual blocker
Findings
243
Python files
80
Files scanned
186
Custom CUDA kernels
detected

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

Findings by file

243 findings · 69 files
benchmarking/int8/training_benchmark.py· 7
B
bitsandbytes dependency
from bitsandbytes import functional as F
:12

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

Suggested change · advisory
# benchmarking/int8/training_benchmark.py:12
- from bitsandbytes import functional as F
+ from bitsandbytes import functional as F # advisory: see ROCm note above
A
Device string "cuda"
A = torch.randn(batch, seq, model, device="cuda").half()
: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"
grad = torch.randn(batch, seq, model, device="cuda").half()
: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.

A
Device string "cuda"
w1 = torch.randint(-128, 127, size=(hidden, model), device="cuda").half()
: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"
w2 = torch.randint(-128, 127, size=(model, hidden), device="cuda").half()
: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
torch.cuda API usage
torch.cuda.synchronize()
: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
torch.cuda API usage
torch.cuda.synchronize()
:57

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).

benchmarking/matmul_benchmark.py· 26
B
bitsandbytes dependency
import bitsandbytes as bnb
:12

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

Suggested change · advisory
# benchmarking/matmul_benchmark.py:12
- import bitsandbytes as bnb
+ import bitsandbytes as bnb # advisory: see ROCm note above
B
bitsandbytes dependency
from bitsandbytes import functional as F
:13

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

Suggested change · advisory
# benchmarking/matmul_benchmark.py:13
- from bitsandbytes import functional as F
+ from bitsandbytes import functional as F # advisory: see ROCm note above
A
Device string "cuda"
A = torch.randn(batch, seq, model, device="cuda").half()
: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
Device string "cuda"
B = torch.empty(hidden, model, dtype=torch.float16, device="cuda")
:35

The literal device 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
linear8bit = bnb.nn.Linear8bitLt(model, hidden, False, False).cuda().half()
:44

.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
outliers = torch.randint(0, model, size=(5,)).cuda()
:47

.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
linearMixedBit = bnb.nn.Linear8bitLt(model, hidden, False, False, threshold=6.0).cuda().half()
:50

.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
linear8bit_train = bnb.nn.Linear8bitLt(model, hidden, False).cuda().half()
:53

.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
linear8bit_train_thresh = bnb.nn.Linear8bitLt(model, hidden, False, threshold=6.0).cuda().half()
:54

.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
torch.cuda.synchronize()
:60

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()
:63

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()
:67

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()
:86

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()
: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
torch.cuda.synchronize()
:93

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()
: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
torch.cuda.synchronize()
: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
torch.cuda.synchronize()
:106

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()
:111

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
torch.cuda.synchronize()
: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
torch.cuda API usage
torch.cuda.synchronize()
: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()
:182

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()
:186

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()
: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
torch.cuda.synchronize()
: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).

benchmarking/optimizer_benchmark.py· 8
B
bitsandbytes dependency
import bitsandbytes as bnb
:13

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

Suggested change · advisory
# benchmarking/optimizer_benchmark.py:13
- import bitsandbytes as bnb
+ import bitsandbytes as bnb # advisory: see ROCm note above
A
.cuda() tensor/module move
layers1 = layers1.cuda()
:26

.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"
large_tensor = torch.empty((int(4.5e9),), 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
torch.cuda.synchronize()
:36

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"
batches = torch.randn(num_batches, 128, dim1, device="cuda").to(gtype)
:40

The literal device 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
lbls = torch.randint(0, 10, size=(num_batches, 128)).cuda()
:41

.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
torch.cuda.synchronize()
:47

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()
:55

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).

bitsandbytes/__main__.py· 1
B
bitsandbytes dependency
from bitsandbytes.diagnostics.main import main
:2

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

Suggested change · advisory
# bitsandbytes/__main__.py:2
- from bitsandbytes.diagnostics.main import main
+ from bitsandbytes.diagnostics.main import main # advisory: see ROCm note above
bitsandbytes/autograd/_functions.py· 1
B
bitsandbytes dependency
import bitsandbytes.functional as F
:10

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

Suggested change · advisory
# bitsandbytes/autograd/_functions.py:10
- import bitsandbytes.functional as F
+ import bitsandbytes.functional as F # advisory: see ROCm note above
bitsandbytes/backends/cpu/ops.py· 1
B
bitsandbytes dependency
from bitsandbytes.functional import get_ptr, has_avx512bf16
:10

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

Suggested change · advisory
# bitsandbytes/backends/cpu/ops.py:10
- from bitsandbytes.functional import get_ptr, has_avx512bf16
+ from bitsandbytes.functional import get_ptr, has_avx512bf16 # advisory: see ROCm note above
bitsandbytes/backends/cuda/ops.py· 19
B
bitsandbytes dependency
from bitsandbytes.functional import CUBLAS_Context, _cuda_device_of, get_ptr
:10

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

Suggested change · advisory
# bitsandbytes/backends/cuda/ops.py:10
- from bitsandbytes.functional import CUBLAS_Context, _cuda_device_of, get_ptr
+ from bitsandbytes.functional import CUBLAS_Context, _cuda_device_of, get_ptr # advisory: see ROCm note above
A
torch.cuda API usage
props = torch.cuda.get_device_properties(device_index)
:74

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"
@register_kernel("bitsandbytes::int8_linear_matmul", "cuda")
:78

The literal device 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"
@register_kernel("bitsandbytes::int8_linear_matmul.out", "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"
@register_kernel("bitsandbytes::int8_mm_dequant", "cuda")
:171

The literal device 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"
@register_kernel("bitsandbytes::int8_vectorwise_quant", "cuda")
:213

The literal device 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"
@register_kernel("bitsandbytes::int8_double_quant", "cuda")
:257

The literal device 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"
@register_kernel("bitsandbytes::quantize_blockwise", "cuda")
:299

The literal device 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"
@register_kernel("bitsandbytes::dequantize_blockwise", "cuda")
:335

The literal device 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"
@register_kernel("bitsandbytes::dequantize_blockwise.out", "cuda")
:342

The literal device 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"
@register_kernel("bitsandbytes::quantize_4bit", "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"
@register_kernel("bitsandbytes::dequantize_4bit", "cuda")
:423

The literal device 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"
@register_kernel("bitsandbytes::dequantize_4bit.out", "cuda")
:437

The literal device 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"
@register_kernel("bitsandbytes::gemv_4bit", "cuda")
:494

The literal device 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"
@register_kernel("bitsandbytes::gemv_4bit.out", "cuda")
:504

The literal device 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
name = getattr(torch.cuda.get_device_properties(device_index), "gcnArchName", "") or ""
:829

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"
@register_kernel("bitsandbytes::gemm_4bit", "cuda")
:921

The literal device 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"
register_kernel("bitsandbytes::optimizer_update_8bit_blockwise", "cuda")(_optimizer_update_8bit_blockwise_impl)
:1198

The literal device 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"
register_kernel("bitsandbytes::optimizer_update_32bit", "cuda")(_optimizer_update_32bit_impl)
:1199

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

RecommendNo change required on ROCm PyTorch.

bitsandbytes/backends/triton/kernels_4bit.py· 2
B
Triton dependency
import triton
:3

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.

Suggested change · advisory
# bitsandbytes/backends/triton/kernels_4bit.py:3
- import triton
+ import triton # advisory: see ROCm note above
B
Triton dependency
import triton.language as tl
:4

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.

Suggested change · advisory
# bitsandbytes/backends/triton/kernels_4bit.py:4
- import triton.language as tl
+ import triton.language as tl # advisory: see ROCm note above
bitsandbytes/backends/triton/kernels_8bit_quant.py· 2
B
Triton dependency
import triton
:3

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.

Suggested change · advisory
# bitsandbytes/backends/triton/kernels_8bit_quant.py:3
- import triton
+ import triton # advisory: see ROCm note above
B
Triton dependency
import triton.language as tl
:4

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.

Suggested change · advisory
# bitsandbytes/backends/triton/kernels_8bit_quant.py:4
- import triton.language as tl
+ import triton.language as tl # advisory: see ROCm note above
bitsandbytes/backends/triton/kernels_optim.py· 2
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.

Suggested change · advisory
# bitsandbytes/backends/triton/kernels_optim.py:6
- import triton
+ import triton # advisory: see ROCm note above
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.

Suggested change · advisory
# bitsandbytes/backends/triton/kernels_optim.py:7
- import triton.language as tl
+ import triton.language as tl # advisory: see ROCm note above
bitsandbytes/backends/utils.py· 3
B
Triton dependency
import triton # noqa: F401
: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.

Suggested change · advisory
# bitsandbytes/backends/utils.py:7
- import triton # noqa: F401
+ import triton # noqa: F401 # advisory: see ROCm note above
B
Triton dependency
import triton.language as tl # noqa: F401
: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.

Suggested change · advisory
# bitsandbytes/backends/utils.py:8
- import triton.language as tl # noqa: F401
+ import triton.language as tl # noqa: F401 # advisory: see ROCm note above
B
bitsandbytes dependency
from bitsandbytes.functional import get_4bit_type
:72

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

Suggested change · advisory
# bitsandbytes/backends/utils.py:72
- from bitsandbytes.functional import get_4bit_type
+ from bitsandbytes.functional import get_4bit_type # advisory: see ROCm note above
bitsandbytes/backends/xpu/ops.py· 3
B
bitsandbytes dependency
from bitsandbytes.functional import _get_tensor_stream, get_ptr
:10

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

Suggested change · advisory
# bitsandbytes/backends/xpu/ops.py:10
- from bitsandbytes.functional import _get_tensor_stream, get_ptr
+ from bitsandbytes.functional import _get_tensor_stream, get_ptr # advisory: see ROCm note above
B
Triton dependency
from ..triton import ops as triton_ops
:215

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.

Suggested change · advisory
# bitsandbytes/backends/xpu/ops.py:215
- from ..triton import ops as triton_ops
+ from ..triton import ops as triton_ops # advisory: see ROCm note above
B
Triton dependency
from ..triton import ops as triton_ops
:293

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.

Suggested change · advisory
# bitsandbytes/backends/xpu/ops.py:293
- from ..triton import ops as triton_ops
+ from ..triton import ops as triton_ops # advisory: see ROCm note above
bitsandbytes/cextension.py· 5
B
bitsandbytes dependency
from bitsandbytes.consts import DYNAMIC_LIBRARY_SUFFIX, PACKAGE_DIR
:11

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
from bitsandbytes.cuda_specs import (
:12

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

A
Device string "cuda"
prefix = "rocm" if is_hip else "cuda"
:37

The literal device 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"
prefix = "rocm" if is_hip else "cuda"
:155

The literal device 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
elif torch.cuda.is_available():
:373

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).

bitsandbytes/diagnostics/cuda.py· 3
B
bitsandbytes dependency
from bitsandbytes.cextension import HIP_ENVIRONMENT, get_cuda_bnb_library_path
:8

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
from bitsandbytes.cuda_specs import CUDASpecs
:9

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
from bitsandbytes.diagnostics.utils import print_dedented
:10

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

bitsandbytes/diagnostics/main.py· 11
B
bitsandbytes dependency
from bitsandbytes import __version__ as bnb_version
:8

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
from bitsandbytes.consts import PACKAGE_GITHUB_URL
:9

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
from bitsandbytes.cuda_specs import get_cuda_specs
:10

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
from bitsandbytes.diagnostics.cuda import print_diagnostics
:11

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
from bitsandbytes.diagnostics.utils import print_dedented, print_header
:12

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
from bitsandbytes.optim import Adam
:28

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

A
.cuda() tensor/module move
p = torch.nn.Parameter(torch.rand(10, 10).cuda())
:30

.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
a = torch.rand(10, 10).cuda()
:31

.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
has_cuda = not has_rocm and torch.version.cuda is not None and torch.cuda.is_available()
: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).

B
bitsandbytes dependency
from bitsandbytes.cextension import ErrorHandlerMockBNBNativeLibrary, lib
:84

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
from bitsandbytes.backends.utils import triton_available
:93

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

bitsandbytes/functional.py· 14
B
bitsandbytes dependency
from bitsandbytes.utils import pack_dict_to_tensor, unpack_tensor_to_dict
:15

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

A
torch.cuda API usage
prev_device = torch.cuda.current_device()
:66

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(device)
:67

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(prev_device)
:69

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"
FIRST_CUDA_DEVICE = torch.device("cuda", index=0)
: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
torch.cuda API usage
if torch.cuda.device_count() > 1:
: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
return torch.cuda.device_of(a)
: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
if torch.cuda.is_available():
: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).

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

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.device.type == "cuda":
:394

The literal device 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
return ct.c_void_p(torch._C._cuda_getCurrentRawStream(torch.cuda.current_device()))
:401

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"
:773

The literal device 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 not torch.cuda.is_initialized():
:1215

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.init()
:1216

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).

bitsandbytes/nn/modules.py· 7
B
bitsandbytes dependency
import bitsandbytes as bnb
:13

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
from bitsandbytes.functional import (
:14

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
from bitsandbytes.optim import GlobalOptimManager
:20

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
from bitsandbytes.utils import INVERSE_LINEAR_8BIT_WEIGHTS_FORMAT_MAPPING, OutlierTracer
:21

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

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

The literal device 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"
return self.to(device="cuda" if device is None else device, non_blocking=non_blocking)
:403

The literal device 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"
return self.to(device="cuda" if device is None else device, non_blocking=non_blocking)
:754

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

RecommendNo change required on ROCm PyTorch.

bitsandbytes/optim/adagrad.py· 1
B
bitsandbytes dependency
from bitsandbytes.optim.optimizer import Optimizer1State
:5

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

bitsandbytes/optim/adam.py· 1
B
bitsandbytes dependency
from bitsandbytes.optim.optimizer import Optimizer2State
:6

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

bitsandbytes/optim/adamw.py· 1
B
bitsandbytes dependency
from bitsandbytes.optim.optimizer import Optimizer2State
:6

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

bitsandbytes/optim/ademamix.py· 2
B
bitsandbytes dependency
import bitsandbytes.functional as F
:7

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
from bitsandbytes.optim.optimizer import Optimizer2State
:8

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

bitsandbytes/optim/lamb.py· 1
B
bitsandbytes dependency
from bitsandbytes.optim.optimizer import Optimizer2State
:5

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

bitsandbytes/optim/lars.py· 1
B
bitsandbytes dependency
from bitsandbytes.optim.optimizer import Optimizer1State
:8

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

bitsandbytes/optim/lion.py· 1
B
bitsandbytes dependency
from bitsandbytes.optim.optimizer import Optimizer1State
:5

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

bitsandbytes/optim/optimizer.py· 2
B
bitsandbytes dependency
import bitsandbytes.functional as F
:14

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
from bitsandbytes.utils import sync_gpu
:15

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

bitsandbytes/optim/rmsprop.py· 1
B
bitsandbytes dependency
from bitsandbytes.optim.optimizer import Optimizer1State
:5

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

bitsandbytes/optim/sgd.py· 1
B
bitsandbytes dependency
from bitsandbytes.optim.optimizer import Optimizer1State
:5

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

check_bnb_install.py· 3
B
bitsandbytes dependency
import bitsandbytes as bnb
:3

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

A
.cuda() tensor/module move
p = torch.nn.Parameter(torch.rand(10, 10).cuda())
:5

.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
a = torch.rand(10, 10).cuda()
:6

.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.

csrc/common.cuh· 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.

csrc/compat_device.cuh· 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.

csrc/compat.cuh· 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.

csrc/gemm_4bit_common.cuh· 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.

csrc/gemm_4bit_mma.cuh· 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.

csrc/gemm_4bit_simt.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.

csrc/gemm_4bit_simt.cuh· 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.

csrc/gemm_4bit_sm75.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.

csrc/gemm_4bit_sm75.cuh· 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.

csrc/gemm_4bit_sm80.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.

csrc/gemm_4bit_sm80.cuh· 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.

csrc/gemm_4bit.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.

csrc/kernels.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.

csrc/kernels.cuh· 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.

csrc/ops.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.

csrc/ops.cuh· 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.

examples/cpu/cpu_training.py· 1
B
bitsandbytes dependency
import bitsandbytes as bnb
:22

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

examples/xpu/benchmark_paged_memory.py· 4
B
bitsandbytes dependency
import bitsandbytes as bnb
:19

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

A
torch.cuda API usage
return torch.cuda
: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"
elif device_type == "cuda":
: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
torch.cuda API usage
assert torch.cuda.is_available(), "CUDA not available!"
: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).

examples/xpu/paged_xpu_training.py· 3
B
bitsandbytes dependency
import bitsandbytes as bnb
:18

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

A
Device string "cuda"
elif args.device == "cuda":
:296

The literal device 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
assert torch.cuda.is_available(), "CUDA not available!"
: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).

pyproject.toml· 13
B
bitsandbytes dependency
name = "bitsandbytes"
:6

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
homepage = "https://github.com/bitsandbytes-foundation/bitsandbytes"
:52

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
changelog = "https://github.com/bitsandbytes-foundation/bitsandbytes/blob/main/CHANGELOG.md"
:53

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
docs = "https://huggingface.co/docs/bitsandbytes/main"
:54

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
issues = "https://github.com/bitsandbytes-foundation/bitsandbytes/issues"
:55

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
"bitsandbytes[test]",
:61

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
include = ["bitsandbytes*"]
:79

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
version = {attr = "bitsandbytes.__version__"}
:82

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
"bitsandbytes",
:108

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
"bitsandbytes/**/triton/**/*.py" = [
:150

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
"bitsandbytes/backends/utils.py" = [
:153

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
known-first-party = ["bitsandbytes"]
:161

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
Triton dependency
module = "triton.*"
:164

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.

tests/fsdp_state_dict_save.py· 6
B
bitsandbytes dependency
import bitsandbytes as bnb
:20

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

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"
return "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
Device string "cuda"
if device_type == "cuda":
:37

The literal device 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.set_device(index)
: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).

A
Device string "cuda"
backend_map = {"cuda": "nccl", "xpu": "xccl"}
: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.

tests/helpers.py· 3
B
bitsandbytes dependency
from bitsandbytes.cextension import HIP_ENVIRONMENT
:10

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

A
torch.cuda API usage
if torch.cuda.is_available():
: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).

A
Device string "cuda"
devices += ["cuda"]
:35

The literal device 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_autograd.py· 5
B
bitsandbytes dependency
import bitsandbytes as bnb
:4

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

A
Device string "cuda"
if 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
torch.cuda API usage
torch.cuda.synchronize()
: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
Device string "cuda"
if device == "cuda":
:207

The literal device 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()
: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).

tests/test_cuda_setup_evaluator.py· 3
B
bitsandbytes dependency
from bitsandbytes.cextension import get_cuda_bnb_library_path
:6

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
from bitsandbytes.consts import DYNAMIC_LIBRARY_SUFFIX
:7

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
from bitsandbytes.cuda_specs import CUDASpecs
:8

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

tests/test_functional.py· 19
B
bitsandbytes dependency
import bitsandbytes as bnb
:9

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
from bitsandbytes import functional as F
:10

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

A
torch.cuda API usage
self.starts[name] = torch.cuda.Event(enable_timing=True)
:74

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.ends[name] = torch.cuda.Event(enable_timing=True)
:75

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()
: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
Device string "cuda"
if device not in ["cuda", "xpu"]:
: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"
if device not in ["cuda", "xpu"]:
:182

The literal device 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.rand(1024, 1024, device="cuda").half()
:329

The literal device 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
code = F.create_fp8_map(True, 3, 0, 4).cuda()
:330

.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
torch.cuda.synchronize()
:337

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()
:341

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
@pytest.mark.skipif(not torch.cuda.is_available(), reason="CUDA is required")
:461

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"
A = torch.randn(dim1, dim2, device="cuda").half()
:466

The literal device 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 not in ["cuda", "xpu"]:
: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
torch.cuda API usage
@pytest.mark.skipif(not torch.cuda.is_available(), reason="CUDA is required")
:730

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"
a = torch.rand(1024 * 12 * 4, 1024 * 12, device="cuda").half()
:734

The literal device 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, 1024 * 12, device="cuda").half()
:743

The literal device 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()
:746

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()
:751

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_linear4bit.py· 6
B
bitsandbytes dependency
import bitsandbytes as bnb
:13

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

A
Device string "cuda"
if device == "cuda":
:369

The literal device 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" and platform.system() == "Windows":
:468

The literal device 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"
:471

The literal device 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
and torch.cuda.is_available()
:472

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
and torch.cuda.get_device_capability() < (8, 0)
:473

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_linear8bitlt.py· 4
B
bitsandbytes dependency
import bitsandbytes as bnb
:12

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
from bitsandbytes.nn.modules import Linear8bitLt
:13

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

A
Device string "cuda"
if device == "cuda":
:265

The literal device 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" and mode == "reduce-overhead" and fullgraph and threshold > 0 and torch.__version__ >= (2, 10):
: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.

tests/test_modules.py· 1
B
bitsandbytes dependency
import bitsandbytes as bnb
:9

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

tests/test_ops.py· 3
B
bitsandbytes dependency
import bitsandbytes
:6

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

A
Device string "cuda"
if device not in ("cuda", "mps"):
:432

The literal device 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 not in ("cuda", "mps"):
:455

The literal device 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_optim.py· 3
B
bitsandbytes dependency
import bitsandbytes as bnb
:9

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
import bitsandbytes.functional as F
:10

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
from bitsandbytes.utils import sync_gpu
:11

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

tests/test_parametrize.py· 2
B
bitsandbytes dependency
from bitsandbytes import functional as F
:5

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

B
bitsandbytes dependency
from bitsandbytes.nn.parametrize import (
:6

bitsandbytes ships CUDA quantization kernels. A ROCm fork (bitsandbytes-rocm / multi-backend) exists and is a drop-in swap.

RecommendUse the ROCm multi-backend build of bitsandbytes.

agents/query_issues.py· 1
A
Device string "cuda"
"cuda",
: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.

benchmarking/inference_benchmark.py· 2
A
torch.cuda API usage
BFLOAT16_SUPPORT = torch.cuda.get_device_capability()[0] >= 8
: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"
device="cuda",
:137

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

RecommendNo change required on ROCm PyTorch.

benchmarking/int8/int8_benchmark.py· 1
A
torch.cuda API usage
torch.cuda.synchronize()
:55

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).

bitsandbytes/__init__.py· 2
A
Device string "cuda"
"cuda", # NVIDIA/AMD GPU
:28

The literal device 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():
: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).

bitsandbytes/backends/triton/ops.py· 2
A
Device string "cuda"
device_type = torch.accelerator.current_accelerator().type if hasattr(torch, "accelerator") else "cuda"
:13

The literal device 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_accelerator_module = getattr(torch, device_type, torch.cuda)
:14

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).

bitsandbytes/cuda_specs.py· 3
A
torch.cuda API usage
return sorted(torch.cuda.get_device_capability(torch.cuda.device(i)) for i in range(torch.cuda.device_count()))
: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
torch.cuda API usage
if not torch.cuda.is_available():
:57

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
if torch.cuda.is_available():
: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).

bitsandbytes/utils.py· 2
A
Device string "cuda"
if t.device.type == "cuda":
:205

The literal device 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()
: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).

examples/int8_inference_huggingface.py· 2
A
torch.cuda API usage
max_memory = f"{int(torch.cuda.mem_get_info()[0] / 1024**3) - 2}GB"
:11

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
n_gpus = torch.cuda.device_count()
:13

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/conftest.py· 4
A
torch.cuda API usage
torch.cuda.manual_seed_all(0)
:11

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
if torch.cuda.is_available():
: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
torch.cuda API usage
torch.cuda.empty_cache()
:42

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_available = torch.cuda.is_available()
:49

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_generation.py· 2
A
Device string "cuda"
inputs = tokenizer(text, return_tensors="pt").to("cuda:0")
: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"
inputs = tokenizer(text, return_tensors="pt").to("cuda:0")
:100

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

RecommendNo change required on ROCm PyTorch.