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

NVIDIA/apex

https://github.com/NVIDIA/apex
Mostly ready

Advisory Summary — NVIDIA/apex ROCm Migration

With a readiness score of 86/100 and zero manual blockers (Bucket C), this repo is close to running on AMD Instinct GPUs — the 637 Bucket-A items should work as-is, and the remaining effort is concentrated in 249 mechanical fixes (Bucket B). These are likely CUDA-specific API calls, kernel syntax, or build-flag substitutions that can be addressed with well-known HIP/CUDA-to-ROCm translation patterns (e.g., cudaMemcpyhipMemcpy, __launch_bounds__ compatibility, nvcchipcc/hipify tooling). Recommended first step: run the hipify-perl or hipify-clang tool across the codebase

637Works as-is
249Mechanical change
0Manual blocker
Findings
886
Python files
159
Files scanned
354
Custom CUDA kernels
detected

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

Findings by file

886 findings · 200 files
apex/contrib/bottleneck/bottleneck.py· 46
B
NVIDIA Apex dependency
from apex import check_cudnn_version_and_warn
:6

This import depends on NVIDIA Apex, which is not available on ROCm; the function also checks for cuDNN, an NVIDIA-specific library with no ROCm equivalent (ROCm uses MIOpen). The import should be removed or guarded so the module can load on AMD Instinct systems.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

Suggested change · advisory
--- a/apex/contrib/bottleneck/bottleneck.py
+++ b/apex/contrib/bottleneck/bottleneck.py
@@ -3,7 +3,6 @@
import torch
import torch.nn as nn
import torch.nn.functional as F
-from apex import check_cudnn_version_and_warn
# Advisory: NVIDIA Apex and cuDNN are unavailable on ROCm; remove or guard this import.
A
Device string "cuda"
out1_pad = torch.empty([N, Hs + 2, W, C], dtype=out1.dtype, device="cuda")
:347

The literal device string "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",
: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
torch.cuda API usage
stream1.wait_stream(torch.cuda.current_stream())
:361

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
stream3.wait_stream(torch.cuda.current_stream())
:363

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(stream1):
: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
with torch.cuda.stream(stream2):
:387

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(stream1):
:404

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(stream3):
:429

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.current_stream().wait_stream(stream1)
:440

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(stream3):
:446

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.current_stream().wait_stream(stream1)
:463

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.current_stream().wait_stream(stream2)
:466

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.current_stream()
:477

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(stream2):
:479

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.current_stream()
: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
with torch.cuda.stream(stream1):
:494

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.current_stream().wait_stream(stream2)
:506

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.current_stream().wait_stream(stream1)
:508

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.current_stream().wait_stream(stream3)
:515

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
wgrad3_stream = torch.cuda.Stream()
:574

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
wgrad3_stream.wait_stream(torch.cuda.current_stream())
:575

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
wgrad2_stream = torch.cuda.Stream()
:579

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
wgrad2_stream.wait_stream(torch.cuda.current_stream())
:580

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
ctx.stream1.wait_stream(torch.cuda.current_stream())
: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
with torch.cuda.stream(ctx.stream1):
: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
with torch.cuda.stream(ctx.stream2):
:600

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(ctx.stream1):
:644

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.current_stream().wait_stream(ctx.stream2)
:716

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.current_stream().wait_stream(ctx.stream1)
:723

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.current_stream()
:740

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(ctx.stream2):
:742

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.current_stream()
:763

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(ctx.stream1):
: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
torch.cuda.current_stream().wait_stream(
:778

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.current_stream().wait_stream(ctx.stream1)
:782

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
wgrad1_stream = torch.cuda.Stream()
:784

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
wgrad1_stream.wait_stream(torch.cuda.current_stream())
:785

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(wgrad3_stream):
:789

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(wgrad2_stream):
:791

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(wgrad1_stream):
:805

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.current_stream().wait_stream(wgrad3_stream)
:809

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.current_stream().wait_stream(wgrad2_stream)
:810

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.current_stream().wait_stream(wgrad1_stream)
:811

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",
:948

The literal device string "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",
:953

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

RecommendNo change required on ROCm PyTorch.

apex/contrib/clip_grad/clip_grad.py· 1
B
NVIDIA Apex dependency
from apex.multi_tensor_apply import multi_tensor_applier
:8

The apex.multi_tensor_apply module is part of NVIDIA Apex, which is not supported on ROCm. This import will fail on AMD Instinct GPUs and needs to be replaced with a ROCm-compatible alternative or guarded with a platform check. PyTorch's native fused optimizers or a ROCm-ported Apex fork may provide equivalent functionality.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

Suggested change · advisory
--- a/apex/contrib/clip_grad/clip_grad.py
+++ b/apex/contrib/clip_grad/clip_grad.py
@@ -5,7 +5,12 @@
import torch
import torch.nn as nn
-from apex.multi_tensor_apply import multi_tensor_applier
+# Advisory: apex.multi_tensor_apply is NVIDIA-only and unavailable on ROCm.
+# Consider using a ROCm-compatible multi-tensor apply utility or guard
+# this import with a platform/runtime check for portability.
+try:
+ from apex.multi_tensor_apply import multi_tensor_applier
+except ImportError:
+ multi_tensor_applier = None
apex/contrib/conv_bias_relu/conv_bias_relu.py· 9
B
NVIDIA Apex dependency
from apex import check_cudnn_version_and_warn
:3

This import depends on NVIDIA Apex, which is not available on ROCm. The function check_cudnn_version_and_warn validates cuDNN (NVIDIA's library), which has no ROCm equivalent since ROCm uses MIOpen instead. This import will fail on AMD Instinct GPUs and should be removed or guarded.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

Suggested change · advisory
--- a/apex/contrib/conv_bias_relu/conv_bias_relu.py
+++ b/apex/contrib/conv_bias_relu/conv_bias_relu.py
@@ -1,5 +1,8 @@
import torch
-from apex import check_cudnn_version_and_warn
+# Advisory: apex and cuDNN are NVIDIA-specific; remove or guard for ROCm.
+# from apex import check_cudnn_version_and_warn
# ... existing code that calls check_cudnn_version_and_warn should also be removed/guarded
A
Device string "cuda"
@torch.amp.custom_fwd(cast_inputs=torch.half, device_type="cuda")
:11

The literal device string "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.amp.custom_bwd(device_type="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"
@torch.amp.custom_fwd(cast_inputs=torch.half, device_type="cuda")
: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"
@torch.amp.custom_bwd(device_type="cuda")
:43

The literal device string "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.amp.custom_fwd(cast_inputs=torch.half, device_type="cuda")
:55

The literal device string "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.amp.custom_bwd(device_type="cuda")
:65

The literal device string "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.amp.custom_fwd(cast_inputs=torch.half, device_type="cuda")
: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"
@torch.amp.custom_bwd(device_type="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.

apex/contrib/csrc/focal_loss/focal_loss_cuda_kernel.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

This is a custom CUDA kernel file that requires manual HIPification. While HIP shares much of CUDA's kernel syntax (<<<>>>, threadIdx, blockIdx, etc.), header includes and CUDA Runtime API calls must be converted, and the file should be processed through hipify-perl or hipify-clang, or renamed to .hip and integrated into the ROCm build system.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

Suggested change · advisory
--- a/apex/contrib/csrc/focal_loss/focal_loss_cuda_kernel.cu
+++ b/apex/contrib/csrc/focal_loss/focal_loss_cuda_kernel.cu
@@ -1,4 +1,5 @@
-#include <cuda_runtime.h>
-#include <cuda.h>
+// Advisory: run hipify-perl or hipify-clang on this file, or rename to .hip
+#include <hip/hip_runtime.h>
+#include <hip/hip_runtime_api.h>
// Kernel launch syntax (<<<>>>, threadIdx, blockIdx) is HIP-compatible.
-// Replace cudaMalloc/cudaMemcpy/cudaFree with hipMalloc/hipMemcpy/hipFree.
+// Replace cudaMalloc/cudaMemcpy/cudaFree with hipMalloc/hipMemcpy/hipFree.
apex/contrib/csrc/group_norm_v2/gn_cuda_host_template.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.

apex/contrib/csrc/group_norm_v2/gn_cuda_inst_1024_1280.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.

apex/contrib/csrc/group_norm_v2/gn_cuda_inst_1024_1920.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.

apex/contrib/csrc/group_norm_v2/gn_cuda_inst_1024_320.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.

apex/contrib/csrc/group_norm_v2/gn_cuda_inst_1024_640.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.

apex/contrib/csrc/group_norm_v2/gn_cuda_inst_1024_960.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.

apex/contrib/csrc/group_norm_v2/gn_cuda_inst_256_1280.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.

apex/contrib/csrc/group_norm_v2/gn_cuda_inst_256_1920.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.

apex/contrib/csrc/group_norm_v2/gn_cuda_inst_256_2560.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.

apex/contrib/csrc/group_norm_v2/gn_cuda_inst_256_640.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.

apex/contrib/csrc/group_norm_v2/gn_cuda_inst_4096_320.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.

apex/contrib/csrc/group_norm_v2/gn_cuda_inst_4096_640.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.

apex/contrib/csrc/group_norm_v2/gn_cuda_inst_4096_960.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.

apex/contrib/csrc/group_norm_v2/gn_cuda_inst_64_1280.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.

apex/contrib/csrc/group_norm_v2/gn_cuda_inst_64_2560.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.

apex/contrib/csrc/group_norm_v2/gn_cuda_kernel.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.

apex/contrib/csrc/group_norm_v2/gn_cuda.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.

apex/contrib/csrc/group_norm/group_norm_nhwc_bwd_one_pass_kernel.cuh· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

This is a custom CUDA kernel header for group norm backward pass. Migration to ROCm requires converting CUDA-specific syntax (threadIdx, blockIdx, _syncthreads, warp intrinsics like shflxor_sync) to HIP equivalents, and replacing CUDA math intrinsics with ROCm-compatible versions. The kernel logic itself is portable but all CUDA-specific APIs and launch patterns need adaptation.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

Suggested change · advisory
diff --git a/apex/contrib/csrc/group_norm/group_norm_nhwc_bwd_one_pass_kernel.cuh b/apex/contrib/csrc/group_norm/group_norm_nhwc_bwd_one_pass_kernel.cuh
--- a/apex/contrib/csrc/group_norm/group_norm_nhwc_bwd_one_pass_kernel.cuh
+++ b/apex/contrib/csrc/group_norm/group_norm_nhwc_bwd_one_pass_kernel.cuh
@@ -1,3 +1,9 @@
+// Advisory: This file contains custom CUDA kernels requiring manual HIP port.
+// Key migration steps:
+// 1. Replace __shfl_xor_sync(mask, val, offset) with __shfl_xor(val, offset)
+// 2. Replace threadIdx/blockIdx/blockDim with hipThreadIdx/hipBlockIdx/hipBlockDim
+// (or include hip_runtime.h which provides compatibility macros)
+// 3. Replace __syncthreads() with __syncthreads() (same in HIP)
+// 4. Replace any cudaFuncSetAttribute for shared memory carve-out with
+// hipFuncSetAttribute equivalents
#pragma once
#include <cuda_runtime.h>
-#include <cuda_fp16.h>
+#if defined(__HIP_PLATFORM_AMD__)
+#include <hip/hip_runtime.h>
+#include <hip/hip_fp16.h>
+#else
+#include <cuda_runtime.h>
+#include <cuda_fp16.h>
+#endif
apex/contrib/csrc/group_norm/group_norm_nhwc_bwd_two_pass.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

This is a custom CUDA kernel for group norm backward pass in NHWC layout. Migration to ROCm requires hipification of CUDA APIs, kernel launch syntax, and any warp-level primitives—note that AMD Instinct GPUs have a warp size of 64 versus NVIDIA's 32, which affects thread block sizing and warp shuffle operations. The .cu file should be processed through hipify-perl or hipify-clang, and the build system updated to use hipcc/hip instead of nvcc/cuda.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

apex/contrib/csrc/group_norm/group_norm_nhwc_fwd_one_pass_kernel.cuh· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

This is a custom CUDA kernel header (.cuh) for group norm forward pass. HIP supports the triple-chevron kernel launch syntax and built-in thread/block index variables, so most kernel logic can port with minimal changes; the primary migration effort is replacing CUDA headers and any CUDA-specific intrinsics (e.g., warp shuffle variants, atomicCAS) with HIP equivalents.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

Suggested change · advisory
--- a/apex/contrib/csrc/group_norm/group_norm_nhwc_fwd_one_pass_kernel.cuh
+++ b/apex/contrib/csrc/group_norm/group_norm_nhwc_fwd_one_pass_kernel.cuh
@@ -1,4 +1,9 @@
-#include <cuda_runtime.h>
-#include <cuda_fp16.h>
-#include <c10/cuda/CUDAStream.h>
-#include <c10/cuda/CUDAGuard.h>
+#if defined(__HIP_PLATFORM_AMD__)
+#include <hip/hip_runtime.h>
+#include <hip/hip_fp16.h>
+#include <c10/hip/HIPStream.h>
+#include <c10/hip/HIPGuard.h>
+#else
+#include <cuda_runtime.h>
+#include <cuda_fp16.h>
+#include <c10/cuda/CUDAStream.h>
+#include <c10/cuda/CUDAGuard.h>
+#endif
apex/contrib/csrc/group_norm/group_norm_nhwc_fwd_two_pass.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

This is a custom group-norm NHWC forward two-pass CUDA kernel that requires manual porting to HIP. Key migration concerns include CUDA runtime API calls (cudaMemcpy, cudaMalloc, etc.), kernel launch syntax, warp-level primitives (_shflsync, _ballotsync), and half-precision intrinsics which may have ROCm equivalents with different signatures or performance characteristics. The two-pass reduction pattern may also benefit from ROCm-specific LDS (shared memory) optimization.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

Suggested change · advisory
--- a/apex/contrib/csrc/group_norm/group_norm_nhwc_fwd_two_pass.cu
+++ b/apex/contrib/csrc/group_norm/group_norm_nhwc_fwd_two_pass.cu
@@ -1,8 +1,12 @@
-#include <cuda.h>
-#include <cuda_runtime.h>
-#include <cuda_fp16.h>
+#include <hip/hip_runtime.h>
+#include <hip/hip_fp16.h>
// If using cooperative groups or CUB:
-#include <cooperative_groups.h>
-#include <cub/cub.cuh>
+// ROCm: use rocPRIM instead of CUB
+#include <hip/hip_cooperative_groups.h>
+// #include <cub/cub.cuh> // replace with rocprim
+#include <rocprim/rocprim.hpp>
-// cudaGetLastError, cudaMemcpy, cudaMalloc → hipGetLastError, hipMemcpy, hipMalloc
+// Advisory: cudaGetLastError→hipGetLastError, cudaMemcpy→hipMemcpy, cudaMalloc→hipMalloc
+// Advisory: __shfl_xor_sync/__shfl_down_sync are available in HIP but verify mask semantics
+// Advisory: Consider renaming file to .hip for hipClang compilation
apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_10.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

This is a custom group norm CUDA kernel that will require manual HIP porting since it likely uses CUDA-specific intrinsics (e.g., warp shuffles, cooperative groups, or __half2 math) and launch patterns. While hipify-perl/hipify-clang can mechanically translate most API calls, kernel correctness and performance must be validated on MI-series GPUs, as occupancy, shared memory bank sizing, and warp-level primitives may behave differently.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_112.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

This file contains a custom CUDA kernel for group normalization (NHWC one-pass, 112-channel variant) that will require manual porting to HIP. Key migration concerns include the kernel launch syntax (<<<>>>), CUDA built-in thread/block index variables, warp-level intrinsics (e.g., _shfl, shfldown), and any CUDA-specific math functions or atomic operations.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

Suggested change · advisory
--- a/apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_112.cu
+++ b/apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_112.cu
@@ -1,1 +1,1 @@
-#include <cuda_runtime.h>
+#include <hip/hip_runtime.h>
@@
-// CUDA kernel launch: kernel<<<grid, block, smem, stream>>>(args...)
+// HIP equivalent: kernel<<<grid, block, smem, stream>>>(args...) // syntax is identical in HIP
@@
-// Warp shuffle intrinsics: __shfl, __shfl_down, __shfl_xor
+// HIP equivalents: __shfl, __shfl_down, __shfl_xor are supported via hip/hip_runtime.h
@@
-// threadIdx, blockIdx, blockDim, gridDim
+// These are available as-is in HIP; no change required.
apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_12.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

This is a custom CUDA kernel file for group normalization (NHWC one-pass) that must be hipified for ROCm. The primary migration steps are renaming the file extension to .hip (or running hipify), replacing CUDA headers with HIP equivalents, and converting CUDA runtime API calls and kernel launch syntax to HIP. Warp-level intrinsics and shared memory patterns are largely compatible but should be verified against the target MI architecture.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

Suggested change · advisory
--- a/apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_12.cu
+++ b/apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_12.cu
@@ -1,8 +1,9 @@
-#include <cuda.h>
-#include <cuda_runtime.h>
-#include <cuda_fp16.h>
+#include <hip/hip_runtime.h>
+#include <hip/hip_runtime_api.h>
+#include <hip/hip_fp16.h>
// If using cooperative groups or warp-level primitives:
-#include <cooperative_groups.h>
-#include <cooperative_groups/reduce.h>
-namespace cg = cooperative_groups;
+// HIP provides cooperative_groups support via hip/cooperative_groups.h
+#include <hip/cooperative_groups.h>
+#include <hip/cooperative_groups/reduce.h>
+namespace cg = cooperative_groups;
apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_120.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

This file contains a custom CUDA kernel for group normalization (NHWC one-pass variant) that will require manual hipification. While HIP preserves the __global__ kernel syntax and thread-index built-ins, any CUDA-specific headers, warp intrinsics, or atomics must be converted, and the file should be compiled with hipcc/hipify-perl or renamed to a HIP-aware build path.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

Suggested change · advisory
--- a/apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_120.cu
+++ b/apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_120.cu
@@ -1,4 +1,9 @@
-#include <cuda.h>
-#include <cuda_runtime.h>
+#include <hip/hip_runtime.h>
+#include <hip/hip_runtime_api.h>
/*
* Advisory: Run hipify-perl over this file to convert remaining
- * CUDA APIs (e.g. cudaMalloc, cudaMemcpy, __shfl_*).
+ * CUDA APIs (e.g. cudaMalloc -> hipMalloc, cudaMemcpy -> hipMemcpy,
+ * __shfl_down -> __shfl_down, __ballot -> __ballot).
+ * Kernel launch syntax <<<>>> is supported by hipcc unchanged.
*/
apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_128.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

This is a custom group norm NHWC kernel that will need HIPification for ROCm. The primary concerns are CUDA-specific headers (e.g., cuda_fp16.h), warp-shuffle intrinsics, and any CUDA runtime API calls, all of which have HIP equivalents but require explicit substitution or hipify tooling.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

Suggested change · advisory
--- a/apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_128.cu
+++ b/apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_128.cu
@@ -1,4 +1,8 @@
-#include <cuda_fp16.h>
-#include <cuda_runtime.h>
+#if defined(__HIP_PLATFORM_AMD__)
+#include <hip/hip_fp16.h>
+#include <hip/hip_runtime.h>
+#else
+#include <cuda_fp16.h>
+#include <cuda_runtime.h>
+#endif
// Advisory: run hipify-perl or use HIPIFY_EXPERIMENTAL flags; verify __shfl_*_sync variants and reduce ops map correctly.
apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_14.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

This is a hand-tuned custom CUDA kernel for group norm (NHWC, one-pass, 14-element variant) that will require hipification to run on ROCm. Thread/block index builtins, warp intrinsics, and shared memory syntax generally translate via HIPIFY, but occupancy tuning and register pressure may differ on MI300 series and should be revalidated. No automated fix is applied; this is advisory only.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_16.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

This file contains a custom CUDA group-norm kernel that must be ported to HIP for ROCm. The primary mechanical changes are swapping CUDA headers for HIP equivalents and ensuring any CUDA-specific math intrinsics or warp primitives have HIP-compatible replacements; kernel launch syntax and built-in thread/block variables are largely compatible under HIP.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

Suggested change · advisory
--- a/apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_16.cu
+++ b/apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_16.cu
@@ -1,4 +1,5 @@
-#include <cuda_runtime.h>
-#include <cuda_fp16.h>
+#include <hip/hip_runtime.h>
+#include <hip/hip_fp16.h>
+// Advisory: review any __shfl_sync, __shfl_down_sync, or CUDA math intrinsics for HIP equivalents.
apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_160.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

This is a custom CUDA kernel for group normalization (NHWC, one-pass, 160 channels) that will require manual porting to HIP. The kernel likely uses CUDA-specific constructs such as thread indexing, shared memory, warp-level primitives, and possibly cuBLAS/cuDNN calls that need HIP equivalents. Rename .cu to .hip, replace CUDA headers with ROCm headers, and verify thread/block configuration on AMD Instinct GPUs.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

Suggested change · advisory
--- apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_160.cu
+++ apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_160.cu
@@ -1,4 +1,8 @@
// Advisory: This file is a custom CUDA kernel requiring manual HIP porting.
// Migration steps:
// 1. Rename to .hip and replace <cuda_runtime.h> / <cuda.h> with <hip/hip_runtime.h> / <hip/hip_runtime_api.h>
// 2. Replace threadIdx/blockIdx/gridDim patterns — compatible but verify occupancy on MI300
// 3. Replace __shfl_* with __shfl_* (HIP supports these) or hip::warp::shuffle
// 4. Replace any cuBLAS/cuDNN calls with rocBLAS/MIOpen equivalents
// 5. Replace cudaMalloc/cudaMemcpy with hipMalloc/hipMemcpy
// 6. Re-tune block sizes and shared memory usage for AMD Instinct architecture
apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_20.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

This file contains a custom CUDA kernel for group normalization (NHWC one-pass), which requires manual porting to HIP. Key migration concerns include CUDA-specific headers, warp shuffle intrinsics, kernel launch syntax, and any device-side builtins that differ between nvcc and hipcc.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

Suggested change · advisory
--- a/apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_20.cu
+++ b/apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_20.cu
@@ -1,8 +1,12 @@
-#include <cuda.h>
-#include <cuda_runtime.h>
+#include <hip/hip_runtime.h>
+#include <hip/hip_runtime_api.h>
// If THC/ATen CUDA headers are used, replace with ROCm equivalents:
-// #include <THC/THCAtomics.cuh>
+// #include <ATen/hip/HIPAtomics.cuh>
-#define WARP_SIZE 32
+#ifndef WARP_SIZE
+#define WARP_SIZE 64 // AMD Instinct wavefront size is 64
+#endif
-__launch_bounds__(256, 2)
+__launch_bounds__(256, 2) // Verify occupancy for CU vs MI architecture
__global__ void group_norm_nhwc_one_pass_20_kernel(
/* ... */
) {
- // __shfl_xor, __shfl_down, __shfl_sync -> __shfl_xor, __shfl_down, __shfl_sync (HIP provides these)
+ // HIP provides __shfl_xor, __shfl_down, __shfl_sync; verify mask semantics for wavefront64
// Replace any cuda:: or cub:: primitives with rocPRIM or hipcub equivalents
- // #include <cub/cub.cuh> -> #include <hipcub/hipcub.hpp>
+ // #include <cub/cub.cuh> -> #include <hipcub/hipcub.hpp>
}
apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_24.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

This file contains a custom CUDA kernel for group normalization (NHWC one-pass) that will require hipification for ROCm. The kernel likely uses CUDA-specific headers, launch syntax, and possibly warp-level primitives that need translation to HIP equivalents. All kernel logic, shared memory usage, and thread indexing should be reviewed for architecture-specific assumptions (e.g., warp size, occupancy) that may differ on AMD Instinct GPUs.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

Suggested change · advisory
--- a/apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_24.cu
+++ b/apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_24.cu
@@ -1,4 +1,5 @@
-#include <cuda.h>
-#include <cuda_runtime.h>
-#include <cuda_fp16.h>
+#include <hip/hip_runtime.h>
+#include <hip/hip_fp16.h>
+// If using cooperative groups or warp-level intrinsics:
+// #include <hip/hip_cooperative_groups.h>
apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_26.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

This is a custom CUDA kernel file for group normalization that will require porting to HIP. The primary migration steps involve renaming the file extension to .hip (or adjusting build flags), replacing CUDA headers with HIP equivalents, and converting CUDA-specific launch syntax/APIs to HIP-compatible forms. Kernel logic itself is largely portable, but warp-level intrinsics, shared memory declarations, and launch configurations should be reviewed for AMD Instinct architecture differences.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

Suggested change · advisory
--- a/apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_26.cu
+++ b/apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_26.cu
@@ -1,8 +1,12 @@
-#include <cuda.h>
-#include <cuda_runtime.h>
-#include <cuda_fp16.h>
+#include <hip/hip_runtime.h>
+#include <hip/hip_fp16.h>
// If using cooperative groups or warp-level primitives:
-#include <cooperative_groups.h>
-#include <cooperative_groups/reduce.h>
+#include <hip/hip_cooperative_groups.h>
// Replace __shfl_xor_sync, __shfl_down_sync with __shfl_xor, __shfl_down
// Replace cudaGetLastError with hipGetLastError
// Replace blockIdx/threadIdx patterns remain the same under HIP
apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_28.cu· 1
B
Custom CUDA kernels (.cu/.cuh)
CUDA kernel source
file

This is a custom CUDA kernel implementing fused group norm in NHWC layout; HIP supports the <<<>>> launch syntax and built-in thread/block index variables, so most kernel logic ports directly. The primary migration work is replacing CUDA headers and any CUDA Runtime API calls (e.g., cudaMalloc, cudaMemcpy, cudaDeviceSynchronize) with HIP equivalents, typically via hipify-perl or manual header substitution. Verify warp-shuffle intrinsics and any dynamic shared-memory sizing, as those are compatible but should be tested on Instinct MI-series GPUs.

RecommendRun hipify-perl over the .cu/.cuh sources and build with hipcc.

Suggested change · advisory
--- a/apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_28.cu
+++ b/apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_28.cu
@@ -1,8 +1,12 @@
-#include <cuda.h>
-#include <cuda_runtime.h>
+#if defined(__HIP_PLATFORM_AMD__)
+#include <hip/hip_runtime.h>
+#include <hip/hip_runtime_api.h>
+#else
+#include <cuda.h>
+#include <cuda_runtime.h>
+#endif
// Advisory: kernel launch syntax (<<<>>>) and built-in vars
// (threadIdx, blockIdx, etc.) are HIP-compatible — no change needed.
// Replace any cudaMalloc/cudaMemcpy/cudaDeviceSynchronize with
// hipMalloc/hipMemcpy/hipDeviceSynchronize (or rely on hipify).
apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_30.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.

apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_32.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.

apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_4.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.

apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_40.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.

apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_42.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.

apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_48.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.

apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_56.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.

apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_60.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.

apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_64.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.

apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_70.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.

apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_8.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.

apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_80.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.

apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_84.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.

apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_96.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.

apex/contrib/csrc/group_norm/group_norm_nhwc_one_pass_98.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.

apex/contrib/csrc/groupbn/batch_norm_add_relu.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.

apex/contrib/csrc/groupbn/batch_norm.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.

apex/contrib/csrc/groupbn/ipc.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.

apex/contrib/csrc/index_mul_2d/index_mul_2d_cuda_kernel.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.

apex/contrib/csrc/layer_norm/ln_bwd_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.

apex/contrib/csrc/layer_norm/ln_bwd_semi_cuda_kernel.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.

apex/contrib/csrc/layer_norm/ln_fwd_cuda_kernel.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.

apex/contrib/csrc/layer_norm/ln_fwd_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.

apex/contrib/csrc/layer_norm/ln_utils.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.

apex/contrib/csrc/nccl_p2p/nccl_p2p_cuda.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.

apex/contrib/csrc/nccl_p2p/nccl_p2p_cuda.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.

apex/contrib/csrc/nccl_p2p/nccl_version_check.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.

apex/contrib/csrc/optimizers/fused_adam_cuda_kernel.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.

apex/contrib/csrc/optimizers/fused_lamb_cuda_kernel.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.

apex/contrib/csrc/optimizers/multi_tensor_distopt_adam_kernel.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.

apex/contrib/csrc/optimizers/multi_tensor_distopt_lamb_kernel.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.

apex/contrib/csrc/peer_memory/peer_memory_cuda.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.

apex/contrib/csrc/peer_memory/peer_memory_cuda.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.

apex/contrib/csrc/transducer/philox.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.

apex/contrib/csrc/transducer/transducer_joint_kernel.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.

apex/contrib/csrc/transducer/transducer_loss_kernel.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.

apex/contrib/csrc/xentropy/xentropy_kernel.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.

apex/contrib/examples/gpu_direct_storage/benchmark_load.py· 15
B
NVIDIA Apex dependency
import apex.contrib.gpu_direct_storage as gds
:3

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
torch.cuda.empty_cache()
:8

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 = torch.cuda.Stream()
:9

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.empty(size, device = "cuda")
:10

The literal device string "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.linspace(0, 1, size, device = "cuda")
:11

The literal device string "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()
:15

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()
: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
torch.cuda API usage
torch.cuda.synchronize()
: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
torch.cuda API usage
torch.cuda.empty_cache()
: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
s = torch.cuda.Stream()
: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
Device string "cuda"
x = torch.empty(size, device = "cuda")
: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"
y = torch.linspace(0, 1, size, 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()
: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
torch.cuda.synchronize()
:44

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

apex/contrib/examples/gpu_direct_storage/benchmark_save.py· 7
B
NVIDIA Apex dependency
import apex.contrib.gpu_direct_storage as gds
:4

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
torch.cuda.empty_cache()
:9

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 = torch.cuda.Stream()
:10

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.linspace(0, 1, size, device = "cuda")
:11

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

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

apex/contrib/examples/gpu_direct_storage/example_load.py· 3
B
NVIDIA Apex dependency
import apex.contrib.gpu_direct_storage as gds
:2

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
x = torch.empty(size, device = "cuda")
:5

The literal device string "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"
xx = torch.linspace(0, 1, size, device = "cuda")
:8

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

RecommendNo change required on ROCm PyTorch.

apex/contrib/examples/gpu_direct_storage/example_save.py· 2
B
NVIDIA Apex dependency
import apex.contrib.gpu_direct_storage as gds
:2

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
x = torch.linspace(0, 1, size, device = "cuda")
:5

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

RecommendNo change required on ROCm PyTorch.

apex/contrib/examples/nccl_allocator/allreduce.py· 4
B
NVIDIA Apex dependency
import apex.contrib.nccl_allocator as nccl_allocator
:4

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

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

A
Device string "cuda"
a = torch.ones(1024 * 1024 * 2, device="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
torch.cuda.synchronize()
: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).

apex/contrib/examples/nccl_allocator/cache.py· 9
B
NVIDIA Apex dependency
import apex.contrib.nccl_allocator as nccl_allocator
:2

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
pynvml (NVML) dependency
from pynvml.smi import nvidia_smi
:3

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
.cuda() tensor/module move
out = torch.randn(1024 * 1024 * 100).cuda() # >= 400 MB
: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
.cuda() tensor/module move
out = torch.randn(1024 * 1024 * 50 ).cuda() # == 200 MB
:33

.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.empty_cache()
: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
torch.cuda API usage
torch.cuda.empty_cache()
: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
.cuda() tensor/module move
out = torch.randn(1024 * 1024 * 100).cuda() # >= 400 MB
: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
torch.cuda API usage
torch.cuda.empty_cache()
: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
torch.cuda API usage
torch.cuda.empty_cache()
: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).

apex/contrib/examples/nccl_allocator/change_cuda_allocator.py· 5
B
NVIDIA Apex dependency
import apex.contrib.nccl_allocator as nccl_allocator
:2

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
.cuda() tensor/module move
out = torch.randn(1024).cuda()
:9

.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
out = torch.randn(1024).cuda()
:12

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

A
torch.cuda API usage
torch.cuda.empty_cache()
:15

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

apex/contrib/examples/nccl_allocator/toy_ddp.py· 3
B
NVIDIA Apex dependency
import apex.contrib.nccl_allocator as nccl_allocator
:8

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
torch.cuda.set_device(local_rank)
: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"
device = torch.device("cuda", local_rank)
: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.

apex/contrib/layer_norm/layer_norm.py· 2
B
NVIDIA Apex dependency
from apex._autocast_utils import _cast_if_autocast_enabled
:4

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
with torch.amp.autocast("cuda", enabled=False):
: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.

apex/contrib/openfold_triton/__init__.py· 6
B
Triton dependency
from triton.runtime.autotuner import Autotuner, Config, Heuristics
: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
from triton.runtime.jit import JITFunction
: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
NVIDIA Apex dependency
from apex.contrib.openfold_triton._layer_norm_backward_kernels import (
:14

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.openfold_triton._layer_norm_forward_kernels import (
:20

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.openfold_triton.layer_norm import LayerNormSmallShapeOptImpl
:24

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.openfold_triton.mha import (
:25

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

apex/contrib/openfold_triton/_layer_norm_backward_kernels.py· 3
B
Triton dependency
import triton
: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.

B
Triton dependency
import triton.language as tl
: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
from triton import Config
: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.

apex/contrib/openfold_triton/_layer_norm_config_ampere.py· 1
B
Triton dependency
from triton import Config
: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.

apex/contrib/openfold_triton/_layer_norm_config_hopper.py· 1
B
Triton dependency
from triton import Config
: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.

apex/contrib/openfold_triton/_layer_norm_forward_kernels.py· 3
B
Triton dependency
import triton
: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
: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
from triton import Config
: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.

apex/contrib/openfold_triton/_mha_kernel.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.

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.

apex/contrib/openfold_triton/fused_adam_swa.py· 2
B
Triton dependency
import triton
: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
Triton dependency
import triton.language as tl
:13

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.

apex/contrib/openfold_triton/layer_norm.py· 3
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
NVIDIA Apex dependency
from apex.contrib.openfold_triton._layer_norm_backward_kernels import (
:9

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.openfold_triton._layer_norm_forward_kernels import (
:17

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

apex/contrib/openfold_triton/mha.py· 3
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
NVIDIA Apex dependency
from apex.contrib.openfold_triton._mha_kernel import (
:10

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
dp = torch.zeros((Z, H, N_CTX, N_CTX), dtype=torch.float32, device="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.

apex/contrib/optimizers/distributed_fused_adam.py· 35
B
NVIDIA Apex dependency
import apex.contrib.nccl_allocator as nccl_allocator
:26

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.multi_tensor_apply import multi_tensor_applier
:30

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
if device1.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
index1 = torch.cuda.current_device()
:160

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
index2 = torch.cuda.current_device()
:162

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"
is_cuda = _devices_match(buf_in.device, "cuda") and _devices_match(buf_out.device, "cuda")
:189

The literal device string "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"
dummy_overflow_buf = torch.zeros([1], dtype=torch.int32, device="cuda")
:212

The literal device string "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: Optional[torch.device] = "cuda",
:553

The literal device string "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 not _devices_match(device, "cuda"):
:623

The literal device string "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.device: torch.device = torch.device("cuda", torch.cuda.current_device())
:625

The literal device string "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
self.device: torch.device = torch.device("cuda", torch.cuda.current_device())
:625

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._pipeline_streams: List[torch.cuda.Stream] = [
:763

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.Stream() for _ in range(self.pipeline_size)
:764

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._comm_streams: List[torch.cuda.Stream] = [
:767

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.Stream() for _ in range(self.pipeline_size)
: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
main_stream = torch.cuda.current_stream()
:1924

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(comm_stream):
:1931

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(comm_stream):
:1951

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
main_stream = torch.cuda.current_stream()
:1968

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
main_stream = torch.cuda.current_stream()
:2062

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(comm_stream):
:2069

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
main_stream = torch.cuda.current_stream()
:2086

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
grad_scaler: Optional[torch.cuda.amp.GradScaler] = None,
:2311

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
GradScalerOptState = torch.cuda.amp.grad_scaler.OptState
:2344

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
grad_scaler: Optional[torch.cuda.amp.GradScaler] = None,
:2372

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
GradScalerOptState = torch.cuda.amp.grad_scaler.OptState
:2399

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
main_stream = torch.cuda.current_stream()
:2981

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):
:2987

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(main_stream):
:3015

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
main_stream = torch.cuda.current_stream()
:3117

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):
:3150

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):
:3178

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):
:3207

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):
:3276

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.current_stream().synchronize()
:3488

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

apex/contrib/optimizers/distributed_fused_lamb.py· 66
B
NVIDIA Apex dependency
from apex.multi_tensor_apply import multi_tensor_applier
:6

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
self._overflow_buf = torch.cuda.IntTensor([0])
: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
self._group_size = torch.cuda.device_count() if dwu_group_size <= 0 else dwu_group_size
:179

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"
self._lr = torch.tensor(0.0, dtype=torch.float32, device="cuda")
:184

The literal device string "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
self._step = torch.cuda.IntTensor([0])
:187

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
print(f"group {i}: init barrier (device: {torch.cuda.current_device()})")
:232

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.distributed.barrier(group=grp, device_ids=[torch.cuda.current_device()])
:233

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._ar_st = [torch.cuda.Stream() for _ in range(self._num_ar_pg)]
:239

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

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._ag_st = [torch.cuda.Stream() for _ in range(self._num_ag_pg)]
:261

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
f"group {i}: init barrier (device: {torch.cuda.current_device()})"
:274

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
group=grp, device_ids=[torch.cuda.current_device()]
:277

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._ar_st = [torch.cuda.Stream() for _ in range(self._num_ar_pg)]
:284

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._rs_st = [torch.cuda.Stream() for _ in range(self._num_rs_pg)]
:300

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._ag_st = [torch.cuda.Stream() for _ in range(self._num_ag_pg)]
: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
self._l2_grad_norm_st = torch.cuda.Stream()
:319

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._completion_st = torch.cuda.Stream()
:320

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._one = torch.cuda.IntTensor([1])
:326

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",
: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"
self._flat_grads = torch.zeros([self._total_param_size], dtype=torch.float16, 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"
self._fp32_p = torch.zeros([self._mega_shard_size], dtype=torch.float32, device="cuda")
: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"
self._fp32_m = torch.zeros([self._mega_shard_size], dtype=torch.float32, device="cuda")
:433

The literal device string "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._fp32_v = torch.zeros([self._mega_shard_size], dtype=torch.float32, device="cuda")
:434

The literal device string "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._fp32_u = torch.zeros([self._mega_shard_size], dtype=torch.float32, device="cuda")
:435

The literal device string "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",
:440

The literal device string "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._fp16_g = torch.zeros([self._mega_shard_size], dtype=torch.float16, device="cuda")
:442

The literal device string "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",
:745

The literal device string "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",
:750

The literal device string "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._offsets = torch.tensor(self._model_param_is_contrib, dtype=torch.int64, device="cuda")
:752

The literal device string "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._contrib_beta1 = torch.tensor(beta1, dtype=math_type, device="cuda")
:762

The literal device string "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._contrib_beta2 = torch.tensor(beta2, dtype=math_type, device="cuda")
:763

The literal device string "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._contrib_beta3 = torch.tensor(beta3, dtype=math_type, device="cuda")
:764

The literal device string "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_correction, dtype=torch.int, device="cuda"
:766

The literal device string "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._contrib_epsilon = torch.tensor(epsilon, dtype=math_type, device="cuda")
:768

The literal device string "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._contrib_weight_decay = torch.tensor(decay, dtype=math_type, device="cuda")
:769

The literal device string "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
ar_stream.wait_stream(torch.cuda.current_stream())
:822

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(ar_stream):
:823

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
ar_stream.wait_stream(torch.cuda.current_stream())
:833

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(ar_stream):
:834

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
ar_stream.wait_stream(torch.cuda.current_stream())
:851

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(ar_stream):
:852

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
rs_stream.wait_stream(torch.cuda.current_stream())
:868

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(rs_stream):
:870

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(ar_stream):
:894

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
rs_stream.wait_stream(torch.cuda.current_stream())
:911

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(rs_stream):
:912

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(ar_stream):
:934

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._l2_grad_norm_st):
:954

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"
l2_grad_norm_sq = torch.empty([1], device="cuda")
:959

The literal device string "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
self._l2_grad_norm_st.wait_stream(torch.cuda.current_stream())
:981

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._l2_grad_norm_st):
:982

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.current_stream().wait_stream(self._l2_grad_norm_st)
:985

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",
:1034

The literal device string "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"
l2_norm = torch.zeros(size=[self._model_params_num], dtype=torch.float32, device="cuda")
:1055

The literal device string "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
self._completion_st.wait_stream(torch.cuda.current_stream())
:1095

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._completion_st):
:1100

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.current_stream().wait_stream(self._l2_grad_norm_st)
:1232

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.current_stream().wait_stream(self._l2_grad_norm_st)
:1252

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"
current_device = torch.device("cuda", torch.cuda.current_device())
:1267

The literal device string "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
current_device = torch.device("cuda", torch.cuda.current_device())
:1267

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._completion_st.wait_stream(torch.cuda.current_stream())
:1270

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._completion_st):
:1272

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.current_stream().wait_stream(self._completion_st)
:1288

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"
self._fp32_p = state_dict["fp32_p"].to(device="cuda")
:1330

The literal device string "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._fp32_m = state_dict["fp32_m"].to(device="cuda")
:1331

The literal device string "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._fp32_v = state_dict["fp32_v"].to(device="cuda")
:1332

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

RecommendNo change required on ROCm PyTorch.

apex/contrib/optimizers/fp16_optimizer.py· 3
B
NVIDIA Apex dependency
from apex.multi_tensor_apply import multi_tensor_applier
:2

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
if not torch.cuda.is_available:
: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
self.overflow_buf = torch.cuda.IntTensor([0])
:61

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

apex/contrib/optimizers/fused_adam.py· 4
B
NVIDIA Apex dependency
from apex.multi_tensor_apply import multi_tensor_applier
:4

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
self._overflow_buf = torch.cuda.IntTensor([0])
:61

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(p.device):
:198

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(tensordevice):
:217

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

apex/contrib/optimizers/fused_lamb.py· 2
B
NVIDIA Apex dependency
from apex.multi_tensor_apply import multi_tensor_applier
:4

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
self._dummy_overflow_buf = torch.cuda.IntTensor([0])
: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).

apex/contrib/optimizers/fused_sgd.py· 2
B
NVIDIA Apex dependency
from apex.multi_tensor_apply import multi_tensor_applier
:5

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
self._dummy_overflow_buf = torch.cuda.IntTensor([0])
: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).

apex/contrib/sparsity/permutation_search_kernels/CUDA_kernels/permutation_search_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.

apex/contrib/sparsity/test/checkpointing_test_part1.py· 5
B
NVIDIA Apex dependency
from apex.optimizers import FusedAdam
:4

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.sparsity import ASP
:5

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
.cuda() tensor/module move
input_batch = torch.randn([args.batch_size, args.input_features]).cuda()
:48

.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
target_batch = torch.randn([args.batch_size, args.output_features]).cuda()
:49

.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
model = build_model(args).cuda()
:61

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

apex/contrib/sparsity/test/checkpointing_test_part2.py· 5
B
NVIDIA Apex dependency
from apex.optimizers import FusedAdam
:4

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.sparsity import ASP
:5

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
.cuda() tensor/module move
input_batch = torch.randn([args.batch_size, args.input_features]).cuda()
:48

.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
target_batch = torch.randn([args.batch_size, args.output_features]).cuda()
:49

.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
model = build_model(args).cuda()
:59

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

apex/contrib/sparsity/test/checkpointing_test_reference.py· 5
B
NVIDIA Apex dependency
from apex.optimizers import FusedAdam
:4

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.sparsity import ASP
:5

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
.cuda() tensor/module move
input_batch = torch.randn([args.batch_size, args.input_features]).cuda()
:52

.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
target_batch = torch.randn([args.batch_size, args.output_features]).cuda()
: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
model = build_model(args).cuda()
:65

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

apex/contrib/sparsity/test/test_permutation_application.py· 1
B
NVIDIA Apex dependency
from apex.contrib.sparsity.permutation_lib import Permutation
:3

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

apex/contrib/sparsity/test/toy_problem.py· 5
B
NVIDIA Apex dependency
from apex.optimizers import FusedAdam
:4

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.sparsity import ASP
:5

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
.cuda() tensor/module move
input_batch = torch.randn([args.batch_size, args.input_features]).cuda()
:48

.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
target_batch = torch.randn([args.batch_size, args.output_features]).cuda()
:49

.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
model = build_model(args).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.

apex/contrib/test/bottleneck/test_bottleneck_module.py· 11
B
NVIDIA Apex dependency
from apex.distributed_testing.distributed_test_base import NcclDistributedTestBase
:6

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.bottleneck import Bottleneck, SpatialBottleneck
:10

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.bottleneck import HaloExchangerPeer
:11

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.peer_memory import PeerMemoryPool
:12

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
bottleneck.to(dtype=dtype, device="cuda")
:19

The literal device string "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 torch.cuda.make_graphed_callables(bottleneck, (x,))
:70

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.randn([N, H, W, C], dtype=dtype, device="cuda")
: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.

A
Device string "cuda"
spatial_bottleneck.to(dtype=dtype, device="cuda")
:160

The literal device string "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(rank)
:232

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 min(torch.cuda.device_count(), 2)
:289

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 or not torch.cuda.can_device_access_peer(0, 1),
:308

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

apex/contrib/test/clip_grad/test_clip_grad.py· 3
B
NVIDIA Apex dependency
from apex.contrib.clip_grad import clip_grad_norm_
:8

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
devices=["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
Device string "cuda"
devices=["cuda", "cpu"],
:56

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

RecommendNo change required on ROCm PyTorch.

apex/contrib/test/conv_bias_relu/test_conv_bias_relu.py· 15
B
NVIDIA Apex dependency
from apex.contrib.conv_bias_relu import (
:11

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
.cuda() tensor/module move
torch.randint(
:49

.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
torch.randn([self.batch_size, self.out_channels, self.out_height, self.out_width])
:63

.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
self.scale = torch.randn([1, self.out_channels, 1, 1]).half().cuda()
:70

.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
self.bias = torch.randn([1, self.out_channels, 1, 1]).half().cuda()
:72

.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
torch.nn.Conv2d(
:76

.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
torch.nn.Conv2d(
:89

.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.amp.autocast("cuda", dtype=torch.half):
: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
Device string "cuda"
with torch.amp.autocast("cuda", dtype=torch.half):
:130

The literal device string "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"
with torch.amp.autocast("cuda", dtype=torch.half):
:153

The literal device string "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"
with torch.amp.autocast("cuda", dtype=torch.half):
:164

The literal device string "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"
with torch.amp.autocast("cuda", dtype=torch.half):
:187

The literal device string "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"
with torch.amp.autocast("cuda", dtype=torch.half):
:198

The literal device string "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"
with torch.amp.autocast("cuda", dtype=torch.half):
:221

The literal device string "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"
with torch.amp.autocast("cuda", dtype=torch.half):
:232

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

RecommendNo change required on ROCm PyTorch.

apex/contrib/test/cudnn_gbn/test_cudnn_gbn_with_two_gpus.py· 6
B
NVIDIA Apex dependency
from apex.distributed_testing.distributed_test_base import NcclDistributedTestBase
:10

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.cudnn_gbn import GroupBatchNorm2d as GBN
:13

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
torch.cuda.manual_seed(333)
:95

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 min(torch.cuda.device_count(), 2)
:100

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", self.rank)
:113

The literal device string "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"
with torch.amp.autocast("cuda"):
:136

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

RecommendNo change required on ROCm PyTorch.

apex/contrib/test/focal_loss/test_focal_loss.py· 4
B
NVIDIA Apex dependency
from apex.contrib.focal_loss import focal_loss
:14

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
.cuda() tensor/module move
x = torch.randn(FocalLossTest.N_SAMPLES, FocalLossTest.N_CLASSES).cuda()
:37

.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
classes = torch.randint(0, FocalLossTest.N_CLASSES, (FocalLossTest.N_SAMPLES,)).cuda()
: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
Device string "cuda"
torch.ones([], device="cuda"),
:61

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

RecommendNo change required on ROCm PyTorch.

apex/contrib/test/fused_dense/test_fused_dense.py· 4
B
NVIDIA Apex dependency
from apex import fused_dense
:10

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
sequences * seq_length, hidden_dim, dtype=dtype, device=torch.device("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.

A
.cuda() tensor/module move
dense.cuda()
:32

.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"
instantiate_device_type_tests(FusedDenseTest, globals(), only_for=("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.

apex/contrib/test/group_norm/test_group_norm.py· 23
B
NVIDIA Apex dependency
from apex.contrib.group_norm.group_norm import cuda_group_norm_nhwc_one_pass
:18

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.group_norm.group_norm import cuda_group_norm_nhwc_two_pass
:19

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.group_norm.group_norm import cuda_group_norm_v2_nhwc
:20

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.group_norm.group_norm import get_cc_and_sm_count
:21

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.group_norm import GroupNorm
:22

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
if not torch.cuda.is_available():
:103

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
free_bytes, _total_bytes = torch.cuda.mem_get_info()
: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.get_device_properties().multi_processor_count < 16,
: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
Device string "cuda"
device="cuda",
:133

The literal device string "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.rand(w_shape, dtype=wdtype, device="cuda", requires_grad=True)
:139

The literal device string "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 = torch.rand(w_shape, dtype=wdtype, device="cuda", requires_grad=True)
: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"
x = -2.3 + 0.5 * torch.randn(x_shape, dtype=xdtype, device="cuda")
:141

The literal device string "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
torch.nn.Sequential(
:226

.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 = -2.3 + 0.5 * torch.randn((N, C, H, W), dtype=torch.float16, device="cuda")
:235

The literal device string "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
free_bytes, total_bytes = torch.cuda.mem_get_info()
:275

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
free_bytes, total_bytes = torch.cuda.mem_get_info()
:307

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
cc, sm_count = get_cc_and_sm_count(torch.cuda.current_device())
:345

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
cc, sm_count = get_cc_and_sm_count(torch.cuda.current_device())
:353

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",
:362

The literal device string "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",
:374

The literal device string "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.empty(8, 640, 32, 32, dtype=torch.float16, device="cuda")
:379

The literal device string "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",
:388

The literal device string "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",
:399

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

RecommendNo change required on ROCm PyTorch.

apex/contrib/test/index_mul_2d/test_index_mul_2d.py· 6
B
NVIDIA Apex dependency
from apex.contrib.index_mul_2d import index_mul_2d
:8

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
.cuda() tensor/module move
self.input1_float = torch.randn(
:24

.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
self.input2_float = torch.randn(
:27

.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
self.index1 = torch.randint(low=0, high=self.input1_size, size=(self.input2_size,)).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
torch.randn(
: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
.cuda() tensor/module move
torch.randn(
:48

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

apex/contrib/test/layer_norm/test_fast_layer_norm.py· 11
B
NVIDIA Apex dependency
from apex.contrib.layer_norm.layer_norm import FastLayerNorm
:8

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
self.start_ = torch.cuda.Event(enable_timing=True)
:16

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.stop_ = torch.cuda.Event(enable_timing=True)
: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"
device = torch.device("cuda")
:47

The literal device string "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 = torch.cuda.Stream()
: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
with torch.cuda.stream(stream):
: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.manual_seed(seed)
:144

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.half, torch.bfloat16) if torch.cuda.is_bf16_supported() else (torch.half,)
:274

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
layer_norm = FastLayerNorm(input_shape[-1]).cuda()
:277

.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
input = torch.randn(input_shape).cuda()
:278

.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.amp.autocast("cuda", enabled=True, dtype=dtype):
:283

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

RecommendNo change required on ROCm PyTorch.

apex/contrib/test/openfold_triton/test_fused_adam_swa.py· 2
B
NVIDIA Apex dependency
from apex.contrib.openfold_triton.fused_adam_swa import AdamMathType, FusedAdamSWA
:24

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
device = torch.device("cuda:0")
: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.

apex/contrib/test/openfold_triton/test_openfold_mha.py· 7
B
NVIDIA Apex dependency
from apex.contrib.openfold_triton import AttnTri as openfold_attention_triton
:9

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
torch.empty((One, Z, H, N_CTX, D_HEAD), dtype=dtype, device="cuda")
: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"
torch.empty((One, Z, H, N_CTX, D_HEAD), dtype=dtype, device="cuda")
: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.

A
Device string "cuda"
torch.empty((One, Z, H, N_CTX, D_HEAD), dtype=dtype, device="cuda")
: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"
torch.empty((One, One, H, N_CTX, N_CTX), dtype=dtype, device="cuda")
:79

The literal device string "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.empty((One, N_CTX, One, One, N_CTX), device="cuda").normal_(mean=0, std=0.5) > 0
: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"
mask = mask.to(device=torch.device("cuda"), dtype=dtype).requires_grad_(False)
:86

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

RecommendNo change required on ROCm PyTorch.

apex/contrib/test/openfold_triton/test_sync_triton_auto_tune_cache_across_gpus.py· 7
B
NVIDIA Apex dependency
from apex.contrib.openfold_triton import (
:12

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
device_type = "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
torch.cuda.synchronize()
: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
torch.cuda API usage
torch.cuda.empty_cache()
: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
return min(torch.cuda.device_count(), 2)
: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
torch.cuda API usage
device = torch.device(f"cuda:{self.rank % torch.cuda.device_count()}")
:71

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)
:72

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

apex/contrib/test/optimizers/test_dist_adam.py· 22
B
NVIDIA Apex dependency
from apex.contrib.optimizers.distributed_fused_adam import DistributedFusedAdam
:13

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.distributed_testing.distributed_test_base import NcclDistributedTestBase
:16

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
device: torch.device = "cuda",
:43

The literal device string "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_ids=[rank] if device == "cuda" else None,
: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"
output_device=rank if device == "cuda" else None,
: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: torch.device = "cuda",
: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
torch.cuda API usage
stream = torch.cuda.Stream()
:151

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):
:152

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):
: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
graph = torch.cuda.CUDAGraph() if with_cuda_graph else None
: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
with torch.cuda.stream(stream):
:188

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
ctx = torch.cuda.graph(graph)
:224

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

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 = x.to(dtype=torch.float32, device="cuda")
:406

The literal device string "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.tensor([[x]], dtype=torch.float32, device="cuda")
:431

The literal device string "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"
dy = torch.tensor([[dy]], dtype=torch.float32, device="cuda")
: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"
ref_scaler = torch.amp.GradScaler("cuda", **grad_scaler_args)
:464

The literal device string "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"
dist_scaler = torch.amp.GradScaler("cuda", **grad_scaler_args)
:465

The literal device string "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.tensor([[x]], dtype=torch.float32, 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
Device string "cuda"
dy = torch.tensor([[dy]], dtype=torch.float32, device="cuda")
:472

The literal device string "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.empty(batch_size, layer_size, device="cuda")
:589

The literal device string "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"
global_batch = torch.empty(batch_size, layer_size, device="cuda")
:616

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

RecommendNo change required on ROCm PyTorch.

apex/contrib/test/optimizers/test_distributed_fused_lamb.py· 9
B
NVIDIA Apex dependency
from apex.contrib.optimizers.distributed_fused_lamb import DistributedFusedLAMB
:8

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.distributed_testing.distributed_test_base import NcclDistributedTestBase
:9

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
return torch.cuda.device_count()
: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
.cuda() tensor/module move
lr = torch.tensor(0.1).cuda()
:86

.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
model = model.cuda().half()
:90

.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
opt_kwargs["full_ar"] = gpu_count == torch.cuda.device_count()
: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
.cuda() tensor/module move
x = torch.randn(4096, 128, dtype=torch.float16).cuda()
:137

.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
y = torch.randn(4096, 128, dtype=torch.float16).cuda()
:138

.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
return max(torch.cuda.device_count() - 1, 1)
:164

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

apex/contrib/test/peer_memory/test_peer_halo_exchange_module.py· 8
B
NVIDIA Apex dependency
from apex.distributed_testing.distributed_test_base import NcclDistributedTestBase
:7

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.peer_memory import PeerMemoryPool, PeerHaloExchanger1d
:10

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
y = torch.randn([1, H + 2 * half_halo, W, C], dtype=dtype, device="cuda")
:93

The literal device string "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([1, H, W + 2 * half_halo, C], 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.

A
Device string "cuda"
y = torch.randn([1, C, H + 2 * half_halo, W], dtype=dtype, device="cuda")
:103

The literal device string "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([1, C, H, W + 2 * half_halo], dtype=dtype, device="cuda")
: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
torch.cuda API usage
torch.cuda.set_device(rank)
:270

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 min(torch.cuda.device_count(), 2)
: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).

apex/contrib/test/transducer/test_transducer_joint.py· 3
B
NVIDIA Apex dependency
from apex.contrib.transducer import TransducerJoint
:7

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.transducer import _transducer_ref as transducer_ref
:8

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
device = "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.

apex/contrib/test/transducer/test_transducer_loss.py· 3
B
NVIDIA Apex dependency
from apex.contrib.transducer import TransducerLoss
:7

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.transducer import _transducer_ref as transducer_ref
:8

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
device = "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.

apex/contrib/test/xentropy/test_label_smoothing.py· 7
B
NVIDIA Apex dependency
from apex.contrib import xentropy as label_smoothing
:11

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
logits = torch.randn((N * T, H), dtype=dtype, device="cuda", requires_grad=True)
: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"
labels = torch.randint(0, H, [N * T], device="cuda")
: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.

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

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

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

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

apex/contrib/torchsched/backend.py· 5
B
NVIDIA Apex dependency
import apex.contrib.torchsched.config as config
:23

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.torchsched.inductor import patch_graph_lowering
:24

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.torchsched.passes import pre_grad_custom_pass
:25

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
if not output_mask[2] or grad_output.device.type != "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"
if not output_mask[2] or grad_output.device.type != "cuda":
:149

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

RecommendNo change required on ROCm PyTorch.

apex/contrib/torchsched/inductor/__init__.py· 1
B
NVIDIA Apex dependency
from apex.contrib.torchsched.inductor.graph import patch_graph_lowering
:3

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

apex/contrib/torchsched/inductor/event.py· 5
B
NVIDIA Apex dependency
import apex.contrib.torchsched.config as torchsched_config
:21

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.torchsched.inductor._utils import DEFAULT_STREAM_IDX
:22

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.torchsched.inductor._utils import ENTRANCE_EVENT
:23

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.torchsched.inductor._utils import EVENT_NAME_TEMPLATE
:24

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.torchsched.inductor._utils import get_stream_name
:25

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

apex/contrib/torchsched/inductor/graph.py· 4
B
NVIDIA Apex dependency
from apex.contrib.torchsched import config as torchsched_config
:21

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.torchsched.inductor.scheduler import MultiCudaStreamScheduler
:22

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.torchsched.inductor.wrapper import MultiStreamWrapperCodegen
:23

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
patching_device_type = "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.

apex/contrib/torchsched/inductor/scheduler.py· 7
B
NVIDIA Apex dependency
from apex.contrib.torchsched import config
:25

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.torchsched.inductor._utils import DEFAULT_STREAM_IDX
:26

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.torchsched.inductor._utils import get_stream_name
:27

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.torchsched.inductor.event import CudaEventFactory
:28

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.torchsched.inductor.event import CudaEventSym
:29

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.torchsched.inductor.wrapper import EnterCudaStreamContextLine
:30

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.torchsched.inductor.wrapper import MultiStreamWrapperCodegen
:33

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

apex/contrib/torchsched/inductor/wrapper.py· 6
B
NVIDIA Apex dependency
import apex.contrib.torchsched.config as config
:25

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.torchsched.inductor._utils import DEFAULT_STREAM
:26

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.torchsched.inductor._utils import ENTRANCE_EVENT
:27

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.torchsched.inductor._utils import STREAM_NAME_TEMPLATE
:28

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.torchsched.inductor._utils import get_stream_name
:29

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.contrib.torchsched.inductor.event import CudaEventSym
:35

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

apex/contrib/torchsched/passes/__init__.py· 1
B
NVIDIA Apex dependency
from apex.contrib.torchsched.passes.pre_grad_passes import pre_grad_custom_pass
:5

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

apex/contrib/torchsched/passes/pre_grad_passes.py· 1
B
NVIDIA Apex dependency
from apex.contrib.torchsched import config
:16

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

apex/distributed_testing/__init__.py· 1
B
NVIDIA Apex dependency
from apex.distributed_testing.distributed_test_base import (
:3

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

apex/distributed_testing/distributed_test_base.py· 6
B
NVIDIA Apex dependency
from apex.distributed_testing._ucc_util import HAS_UCC
:12

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

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
torch.cuda API usage
torch.cuda.empty_cache()
: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
torch.cuda API usage
return min(torch.cuda.device_count(), 4)
: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
torch.cuda API usage
self.assertTrue(torch.cuda.is_available())
:53

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(self.rank % torch.cuda.device_count())
:73

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

apex/fused_dense/fused_dense.py· 4
B
NVIDIA Apex dependency
from apex._autocast_utils import _cast_if_autocast_enabled
:4

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

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

The literal device string "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"
with torch.amp.autocast("cuda", enabled=False):
: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"
with torch.amp.autocast("cuda", enabled=False):
: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.

apex/mlp/mlp.py· 1
B
NVIDIA Apex dependency
from apex._autocast_utils import _cast_if_autocast_enabled
:7

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

apex/normalization/fused_layer_norm.py· 7
B
NVIDIA Apex dependency
from apex._autocast_utils import _cast_if_autocast_enabled
:10

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
with torch.amp.autocast("cuda", enabled=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"
with torch.amp.autocast("cuda", enabled=False):
:683

The literal device string "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"
with torch.amp.autocast("cuda", enabled=False):
:694

The literal device string "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"
with torch.amp.autocast("cuda", enabled=False):
:700

The literal device string "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"
with torch.amp.autocast("cuda", enabled=False):
:709

The literal device string "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"
with torch.amp.autocast("cuda", enabled=False):
:720

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

RecommendNo change required on ROCm PyTorch.

apex/optimizers/fused_adagrad.py· 2
B
NVIDIA Apex dependency
from apex.multi_tensor_apply import multi_tensor_applier
:2

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
self._dummy_overflow_buf = torch.cuda.IntTensor([0])
:62

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

apex/optimizers/fused_adam.py· 2
B
NVIDIA Apex dependency
from apex.multi_tensor_apply import multi_tensor_applier
:2

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
self._dummy_overflow_buf = torch.tensor([0], dtype=torch.int, device="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.

apex/optimizers/fused_lamb.py· 1
B
NVIDIA Apex dependency
from apex.multi_tensor_apply import multi_tensor_applier
:2

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

apex/optimizers/fused_mixed_precision_lamb.py· 1
B
NVIDIA Apex dependency
from apex.multi_tensor_apply import multi_tensor_applier
:6

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

apex/optimizers/fused_novograd.py· 5
B
NVIDIA Apex dependency
from apex.multi_tensor_apply import multi_tensor_applier
:2

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
torch.cuda.FloatTensor(
: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
torch.cuda API usage
torch.cuda.FloatTensor(
: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
group["exp_avg_sq"][0] = torch.cuda.FloatTensor(
:210

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
group["exp_avg_sq"][1] = torch.cuda.FloatTensor(
:213

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

apex/optimizers/fused_sgd.py· 1
B
NVIDIA Apex dependency
from apex.multi_tensor_apply import multi_tensor_applier
:4

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

csrc/fused_dense_cuda.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/layer_norm_cuda_kernel.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/megatron/fused_rotary_positional_embedding_cuda.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/megatron/fused_weight_gradient_dense_16bit_prec_cuda.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/megatron/fused_weight_gradient_dense_cuda.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/megatron/generic_scaled_masked_softmax_cuda.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/megatron/scaled_masked_softmax_cuda.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/megatron/scaled_softmax_cuda.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/megatron/scaled_upper_triang_masked_softmax_cuda.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/mlp_cuda.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/multi_tensor_adagrad.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/multi_tensor_adam.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/multi_tensor_apply.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/multi_tensor_axpby_kernel.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/multi_tensor_l2norm_kernel_mp.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/multi_tensor_l2norm_kernel.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/multi_tensor_l2norm_scale_kernel.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/multi_tensor_lamb_mp.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/multi_tensor_lamb_stage_1.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/multi_tensor_lamb_stage_2.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/multi_tensor_lamb.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/multi_tensor_novograd.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/multi_tensor_scale_kernel.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/multi_tensor_sgd_kernel.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/update_scale_hysteresis.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/welford.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.

examples/dcgan/main_amp.py· 2
B
NVIDIA Apex dependency
from apex import amp
:16

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
device = torch.device("cuda:0")
: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.

examples/imagenet/main_amp.py· 29
A
torch.cuda API usage
torch.cuda.set_device(args.gpu)
: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).

B
NVIDIA Apex dependency
import apex
:140

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
.cuda() tensor/module move
model = model.cuda().to(memory_format=memory_format)
:144

.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"
scaler = torch.amp.GradScaler("cuda")
:154

The literal device string "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
criterion = nn.CrossEntropyLoss().cuda()
:157

.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
checkpoint = torch.load(args.resume, map_location = lambda storage, loc: storage.cuda(args.gpu))
:165

.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
self.stream = torch.cuda.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
.cuda() tensor/module move
self.mean = torch.tensor([0.485 * 255, 0.456 * 255, 0.406 * 255]).cuda().view(1,3,1,1)
:251

.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
self.std = torch.tensor([0.229 * 255, 0.224 * 255, 0.225 * 255]).cuda().view(1,3,1,1)
:252

.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
with torch.cuda.stream(self.stream):
:273

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
self.next_input = self.next_input.cuda(non_blocking=True)
:274

.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
self.next_target = self.next_target.cuda(non_blocking=True)
:275

.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.current_stream().wait_stream(self.stream)
:291

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
input.record_stream(torch.cuda.current_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
target.record_stream(torch.cuda.current_stream())
: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).

A
torch.cuda API usage
torch.cuda.cudart().cudaProfilerStart()
:319

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 args.prof >= 0: torch.cuda.nvtx.range_push("Body of iteration {}".format(i))
:321

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"
with torch.autocast(device_type="cuda"):
:326

The literal device string "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 args.prof >= 0: torch.cuda.nvtx.range_push("forward")
:327

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 args.prof >= 0: torch.cuda.nvtx.range_pop()
:329

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 args.prof >= 0: torch.cuda.nvtx.range_push("backward")
:335

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 args.prof >= 0: torch.cuda.nvtx.range_pop()
: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
if args.prof >= 0: torch.cuda.nvtx.range_push("optimizer.step()")
:342

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 args.prof >= 0: torch.cuda.nvtx.range_pop()
:345

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

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 args.prof >= 0: torch.cuda.nvtx.range_push("prefetcher.next()")
:384

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 args.prof >= 0: torch.cuda.nvtx.range_pop()
:386

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 args.prof >= 0: torch.cuda.nvtx.range_pop()
:389

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.cudart().cudaProfilerStop()
:393

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/simple/distributed/distributed_data_parallel.py· 6
B
NVIDIA Apex dependency
from apex import amp
:4

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.parallel import DistributedDataParallel
:6

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
torch.cuda.set_device(args.local_rank)
: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
Device string "cuda"
x = torch.randn(N, D_in, device='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"
y = torch.randn(N, D_out, 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
.cuda() tensor/module move
model = torch.nn.Linear(D_in, D_out).cuda()
:40

.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/distributed/amp_master_params/amp_master_params.py· 6
B
NVIDIA Apex dependency
from apex import amp
:4

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.parallel import DistributedDataParallel
:7

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
torch.cuda.set_device(args.local_rank)
: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"
x = torch.randn(N, D_in, device="cuda")
:39

The literal device string "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(N, D_out, device="cuda")
: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
model = torch.nn.Linear(D_in, D_out).cuda()
:42

.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/distributed/DDP/ddp_race_condition_test.py· 8
B
NVIDIA Apex dependency
from apex.parallel import DistributedDataParallel as DDP
:4

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
args.gpu = args.local_rank % torch.cuda.device_count()
: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
torch.cuda API usage
torch.cuda.set_device(args.gpu)
: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
torch.cuda API usage
self.a = Parameter(torch.cuda.FloatTensor(4096 * 4096).fill_(1.0))
: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
torch.cuda API usage
self.b = Parameter(torch.cuda.FloatTensor(4096 * 4096).fill_(2.0))
: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
x = torch.cuda.FloatTensor(4096 * 4096)
: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.cudart().cudaProfilerStart()
: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
torch.cuda API usage
torch.cuda.cudart().cudaProfilerStop()
:76

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/distributed/synced_batchnorm/python_single_gpu_unit_test.py· 5
A
torch.cuda API usage
type_tensor = torch.cuda.FloatTensor
:33

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
ref_tensor = torch.cuda.DoubleTensor
: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
.cuda() tensor/module move
bn = torch.nn.BatchNorm2d(feature_size).cuda()
: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.

B
NVIDIA Apex dependency
from apex.parallel.sync_batchnorm import SyncBatchNorm
:62

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
.cuda() tensor/module move
sbn = SyncBatchNorm(feature_size).cuda()
:64

.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/distributed/synced_batchnorm/single_gpu_unit_test.py· 7
B
NVIDIA Apex dependency
import apex
:3

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
count = torch.cuda.IntTensor([batch_size * space_size**2])
: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
type_tensor = torch.cuda.FloatTensor
:44

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
ref_tensor = torch.cuda.DoubleTensor
: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
.cuda() tensor/module move
bn = torch.nn.BatchNorm2d(feature_size).cuda()
:68

.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
sbn = apex.parallel.SyncBatchNorm(feature_size).cuda()
:77

.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
sbn_c_last = apex.parallel.SyncBatchNorm(feature_size, channel_last=True).cuda()
:86

.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/distributed/synced_batchnorm/test_batchnorm1d.py· 4
B
NVIDIA Apex dependency
import apex
:2

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
.cuda() tensor/module move
model = apex.parallel.SyncBatchNorm(4).cuda()
:4

.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
data = torch.rand((8, 4)).cuda()
:7

.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
model_ref = torch.nn.BatchNorm1d(4).cuda()
:9

.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/distributed/synced_batchnorm/test_groups.py· 9
B
NVIDIA Apex dependency
import apex
:3

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.parallel import DistributedDataParallel as DDP
:29

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
torch.cuda.set_device(args.local_rank)
: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
torch.cuda API usage
type_tensor = torch.cuda.FloatTensor
:70

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
type_tensor = torch.cuda.HalfTensor
:72

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
type_tensor = torch.cuda.DoubleTensor
: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
ref_tensor = torch.cuda.DoubleTensor
:76

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
bn = torch.nn.BatchNorm2d(feature_size).cuda()
:98

.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
sbn = apex.parallel.SyncBatchNorm(
:118

.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/distributed/synced_batchnorm/two_gpu_test_different_batch_size.py· 2
B
NVIDIA Apex dependency
from apex.parallel import SyncBatchNorm as ApexSyncBatchNorm
:4

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
torch.cuda.set_device(args.local_rank)
: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).

tests/distributed/synced_batchnorm/two_gpu_unit_test.py· 10
B
NVIDIA Apex dependency
import apex
:3

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.parallel import DistributedDataParallel as DDP
:29

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
torch.cuda.set_device(args.local_rank)
:37

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
type_tensor = torch.cuda.FloatTensor
:58

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
type_tensor = torch.cuda.HalfTensor
: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
type_tensor = torch.cuda.DoubleTensor
:62

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
ref_tensor = torch.cuda.DoubleTensor
:64

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
bn = torch.nn.BatchNorm2d(feature_size).cuda()
:86

.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
sbn = apex.parallel.SyncBatchNorm(feature_size).cuda()
:105

.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
count = torch.cuda.IntTensor(count)
:124

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/L0/run_fused_layer_norm/test_fused_layer_norm.py· 40
B
NVIDIA Apex dependency
from apex.normalization import FusedLayerNorm
:4

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.normalization import FusedRMSNorm
:5

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.normalization import MixedFusedLayerNorm
:6

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.normalization import MixedFusedRMSNorm
:7

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
.cuda() tensor/module move
fused = torch.randn(shape).cuda().requires_grad_(True)
:17

.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
autocast_dtypes = (torch.half, torch.bfloat16) if torch.cuda.is_bf16_supported() else (torch.half,)
: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"
).to(device="cuda", dtype=dtype)
: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"
).to(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
torch.cuda API usage
torch.cuda.manual_seed(42)
: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
Device string "cuda"
input_cuda_ = input_.to(device="cuda", dtype=dtype).detach().requires_grad_(True)
: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"
input_src_.to(device="cuda", dtype=dtype)[::3, ::5, ::3]
:76

The literal device string "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"
gO = gO.to(device="cuda", dtype=dtype)
: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"
out_cpu_.to(device="cuda", dtype=dtype), out_cuda_, **fwd_thresholds
:93

The literal device string "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"
input_.grad.to(device="cuda", dtype=dtype),
: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.

A
Device string "cuda"
).to(device="cuda", dtype=dtype)
:124

The literal device string "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", dtype=dtype
:129

The literal device string "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.manual_seed(42)
: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"
input_cuda_ = input_.to(device="cuda", dtype=dtype).detach().requires_grad_(True)
:136

The literal device string "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"
input_src_.to(device="cuda", dtype=dtype)[::3, ::5, ::3]
:148

The literal device string "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"
out_cpu_.to(device="cuda", dtype=dtype),
:161

The literal device string "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"
gO = gO.to(device="cuda", dtype=dtype)
:165

The literal device string "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"
input_.grad.to(device="cuda", dtype=dtype),
: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"
module_cpu_.weight.grad.to(device="cuda", dtype=dtype),
: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"
).to(device="cuda", dtype=dtype)
:495

The literal device string "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
fused = FusedLayerNorm(
:496

.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.amp.autocast("cuda", dtype=dtype):
: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
.cuda() tensor/module move
fused = FusedRMSNorm(
:539

.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.amp.autocast("cuda", dtype=dtype):
:547

The literal device string "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
actual, expected.detach().clone().cuda(), **tols, check_dtype=False
:551

.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
g_fused = g_native.detach().clone().cuda()
:556

.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
torch.testing.assert_close(native_x.grad.cuda(), fused_x.grad, **tols, check_dtype=False)
:561

.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
fused = FusedRMSNorm(normalized_shape=normalized_shape, elementwise_affine=True).cuda()
:590

.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
fused_m = MixedFusedRMSNorm(normalized_shape=normalized_shape).cuda()
:591

.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
fused = FusedLayerNorm(normalized_shape=normalized_shape, elementwise_affine=True).cuda()
:599

.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
fused_m = MixedFusedLayerNorm(normalized_shape=normalized_shape).cuda()
:600

.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
eager_mod = FusedLayerNorm(
:609

.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"
eager_x = torch.randn(input_shape, device="cuda").requires_grad_(True)
:614

The literal device string "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
eager_mod = FusedRMSNorm(
:633

.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"
eager_x = torch.randn(input_shape, device="cuda").requires_grad_(True)
:638

The literal device string "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"
instantiate_device_type_tests(TestFusedLayerNorm, globals(), only_for=("cuda",))
:654

The literal device 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/L0/run_mlp/test_mlp.py· 22
B
NVIDIA Apex dependency
from apex.mlp import MLP
:12

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
.cuda() tensor/module move
mlp = MLP(mlp_sizes).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
.cuda() tensor/module move
ref_mlp = nn.Sequential(*mlp_layers).cuda()
:37

.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"
torch.empty(batch_size, mlp_sizes[0], device="cuda")
: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
mlp = MLP(mlp_sizes, bias=bias, activation=use_activation).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
.cuda() tensor/module move
ref_mlp = nn.Sequential(*mlp_layers).cuda()
:71

.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"
torch.empty(batch_size, mlp_sizes[0], device="cuda")
: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
torch.cuda API usage
with torch.cuda.amp.autocast_mode.autocast(enabled=enable_autocast):
: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
.cuda() tensor/module move
mlp = MLP(mlp_sizes).cuda()
:113

.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
ref_mlp = nn.Sequential(*mlp_layers).cuda()
:124

.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"
test_input = torch.empty(batch_size, mlp_sizes[0], device="cuda").uniform_(-1.0, 1.0)
: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
.cuda() tensor/module move
mlp = MLP(mlp_sizes).cuda().half()
:138

.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
ref_mlp = nn.Sequential(*mlp_layers).cuda().half()
:148

.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"
torch.empty(batch_size, mlp_sizes[0], device="cuda", dtype=torch.half)
:151

The literal device string "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.empty(batch_size, mlp_sizes[0], device="cuda", dtype=torch.half)
: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
torch.cuda.profiler.start()
:172

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

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()
: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
torch.cuda.synchronize()
: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
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.profiler.stop()
: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
Device string "cuda"
instantiate_device_type_tests(TestMLP, globals(), only_for=("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.

tests/L0/run_optimizers/test_adam.py· 27
B
NVIDIA Apex dependency
import apex
:9

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
.cuda() tensor/module move
self.model = Model().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
self.model_ = Model().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"
scaler = torch.amp.GradScaler("cuda", enabled=True)
: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"
scaler_ = torch.amp.GradScaler("cuda", enabled=True)
: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
.cuda() tensor/module move
x = torch.rand([32, 1, 28, 28]).cuda().to(memory_format=torch.channels_last)
:70

.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
gt = torch.rand([32, 10]).cuda()
:72

.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.amp.autocast("cuda", enabled=True):
:76

The literal device string "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"
with torch.amp.autocast("cuda", enabled=True):
: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
Device string "cuda"
scaler = torch.amp.GradScaler("cuda", enabled=True)
: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
Device string "cuda"
scaler_ = torch.amp.GradScaler("cuda", enabled=True)
:118

The literal device string "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
x = torch.rand([32, 1, 28, 28]).cuda().to(memory_format=torch.channels_last)
:121

.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
gt = torch.rand([32, 10]).cuda()
:123

.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.amp.autocast("cuda", enabled=True):
:127

The literal device string "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"
with torch.amp.autocast("cuda", enabled=True):
:136

The literal device string "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"
scaler = torch.amp.GradScaler("cuda", enabled=True)
: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"
scaler_ = torch.amp.GradScaler("cuda", enabled=True)
:175

The literal device string "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
x = torch.rand([32, 1, 28, 28]).cuda().to(memory_format=torch.channels_last)
:178

.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
gt = torch.rand([32, 10]).cuda()
:180

.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.amp.autocast("cuda", enabled=True):
:184

The literal device string "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"
with torch.amp.autocast("cuda", enabled=True):
:193

The literal device string "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
x = torch.rand([32, 1, 28, 28]).cuda().to(memory_format=torch.channels_last)
:231

.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
gt = torch.rand([32, 10]).cuda()
:233

.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"
@largeTensorTest("60GB", "cuda")
:271

The literal device string "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"
t = torch.zeros(2359332864, dtype=torch.half, 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"
t2 = torch.zeros(2359332864, dtype=torch.half, device="cuda")
: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
torch.cuda API usage
torch.cuda.synchronize()
:284

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/L0/run_optimizers/test_fused_novograd.py· 6
B
NVIDIA Apex dependency
import apex
:3

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
@unittest.skipIf(torch.cuda.device_count() < 2, "more than 1 GPU required")
:168

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:1", "cuda:0")
: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
torch.cuda API usage
with torch.cuda.device(current_dev):
:172

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

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"
tensors.append(torch.rand(size, dtype=torch.float, 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.

tests/L0/run_optimizers/test_fused_optimizer.py· 19
B
NVIDIA Apex dependency
import apex
:7

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
Device string "cuda"
self, param_type=torch.float, device="cuda", *, skip_assert: bool = False
: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
torch.cuda API usage
@unittest.skipIf(torch.cuda.device_count() < 2, "more than 1 GPU required")
: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
Device string "cuda"
devices = ("cuda:0", "cuda:1")
: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
torch.cuda API usage
with torch.cuda.device(current_dev):
: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
Device string "cuda"
tensors.append(torch.rand(size, dtype=torch.float, device="cuda"))
:130

The literal device string "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"
tensor = torch.rand(nelem, dtype=torch.float, device="cuda")
:144

The literal device string "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"
tensor = torch.rand(nelem, dtype=torch.float, device="cuda")
:161

The literal device string "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"
tensor = torch.rand(nelem, dtype=torch.float, device="cuda")
:189

The literal device string "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"
tensor = torch.rand(nelem, dtype=torch.float, device="cuda")
: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
@unittest.skipIf(torch.cuda.device_count() < 2, "more than 1 GPU required")
:241

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:0", "cuda:1")
:243

The literal device string "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
with torch.cuda.device(current_dev):
:245

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"
tensors.append(torch.rand(size, dtype=torch.float, device="cuda"))
:254

The literal device string "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
@unittest.skipIf(torch.cuda.device_count() < 2, "more than 1 GPU required")
: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
Device string "cuda"
tensor = torch.rand(nelem, dtype=torch.float, device="cuda")
:282

The literal device string "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
@unittest.skipIf(torch.cuda.device_count() < 2, "more than 1 GPU required")
:308

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:0", "cuda:1")
:310

The literal device string "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
with torch.cuda.device(current_dev):
:312

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/L0/run_optimizers/test_lamb.py· 16
B
NVIDIA Apex dependency
import apex
:6

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.multi_tensor_apply import multi_tensor_applier
:7

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
torch.cuda.manual_seed(9876)
:177

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"
def gen_single_type_test(self, param_type=torch.float, device="cuda"):
:206

The literal device string "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()
:230

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

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
@unittest.skipIf(torch.cuda.device_count() < 2, "more than 1 GPU required")
:249

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:0", "cuda:1")
:251

The literal device string "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
with torch.cuda.device(current_dev):
:253

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"
tensors.append(torch.rand(size, dtype=torch.float, device="cuda"))
:269

The literal device string "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"
tensor = torch.rand(nelem, dtype=torch.float, device="cuda")
: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
torch.cuda API usage
@unittest.skipIf(torch.cuda.device_count() < 2, "more than 1 GPU required")
:316

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:0", "cuda:1")
:318

The literal device string "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
with torch.cuda.device(current_dev):
:320

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"
tensors.append(torch.rand(size, dtype=torch.float, device="cuda"))
:336

The literal device string "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"
tensor = torch.rand(nelem, dtype=torch.float, device="cuda")
:347

The literal device 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/L1/common/main_amp.py· 20
B
NVIDIA Apex dependency
from apex.parallel import DistributedDataParallel as DDP
:21

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.fp16_utils import *
:22

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex import amp, optimizers
:23

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

B
NVIDIA Apex dependency
from apex.multi_tensor_apply import multi_tensor_applier
:24

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
torch.cuda API usage
args.gpu = args.local_rank % torch.cuda.device_count()
: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
torch.cuda.set_device(args.gpu)
: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).

B
NVIDIA Apex dependency
import apex
:205

Apex fused optimizers/AMP are CUDA-specific. ROCm PyTorch ships native AMP (torch.cuda.amp / torch.amp) covering most uses.

RecommendReplace Apex AMP with native torch.amp; use ROCm apex for fused ops.

A
.cuda() tensor/module move
model = model.cuda()
:210

.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
criterion = nn.CrossEntropyLoss().cuda()
:241

.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
map_location=lambda storage, loc: storage.cuda(args.gpu),
:251

.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
self.stream = torch.cuda.Stream()
:357

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
self.mean = torch.tensor([0.485 * 255, 0.456 * 255, 0.406 * 255]).cuda().view(1, 3, 1, 1)
:358

.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
self.std = torch.tensor([0.229 * 255, 0.224 * 255, 0.225 * 255]).cuda().view(1, 3, 1, 1)
:359

.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
with torch.cuda.stream(self.stream):
: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).

A
.cuda() tensor/module move
self.next_input = self.next_input.cuda(non_blocking=True)
:374

.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
self.next_target = self.next_target.cuda(non_blocking=True)
:375

.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.current_stream().wait_stream(self.stream)
:384

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.nvtx.range_push("step")
:447

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.nvtx.range_pop()
:449

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

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

apex/_autocast_utils.py· 2
A
torch.cuda API usage
if torch.cuda.is_bf16_supported():
:10

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.amp.autocast_mode._cast(args, torch.get_autocast_gpu_dtype())
: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).

apex/contrib/bottleneck/halo_exchangers.py· 9
A
torch.cuda API usage
self.stream1 = torch.cuda.Stream()
:12

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.stream2 = torch.cuda.Stream()
: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).

A
torch.cuda API usage
self.stream3 = torch.cuda.Stream()
: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).

A
.cuda() tensor/module move
nccl_id = inc.get_unique_nccl_id(1).cuda()
:98

.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
self.stream1 = torch.cuda.Stream()
: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
self.stream2 = 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(self.stream1):
:267

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.stream2):
:269

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

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

apex/contrib/bottleneck/test.py· 8
A
.cuda() tensor/module move
a = a_.cuda().half().to(memory_format=torch.channels_last).requires_grad_()
:13

.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
Bottleneck(32, 8, o_channel, stride=stride)
:15

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

A
torch.cuda API usage
torch.cuda.synchronize()
: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
.cuda() tensor/module move
nhwc_a = a_.permute(0, 2, 3, 1).contiguous().cuda().half().requires_grad_()
:65

.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
Bottleneck(32, 8, o_channel, stride=stride, explicit_nhwc=True, use_cudnn=True)
:67

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

apex/contrib/cudnn_gbn/batch_norm.py· 3
A
torch.cuda API usage
self.minibatch_mean = torch.cuda.FloatTensor(num_features)
:144

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.minibatch_inv_var = torch.cuda.FloatTensor(num_features)
: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
.cuda() tensor/module move
raw_ipc = pm.get_raw_ipc_address(raw).cuda()
:153

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

apex/contrib/group_norm/group_norm.py· 3
A
torch.cuda API usage
props = torch.cuda.get_device_properties(device_index)
: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"
sums = torch.empty(2 * x.shape[0] * G, device="cuda", dtype=torch.float32)
:99

The literal device string "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
sm = torch.cuda.get_device_capability(device)
:355

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

apex/contrib/groupbn/batch_norm.py· 8
A
torch.cuda API usage
bitmask = torch.cuda.IntTensor(((x.numel() + 31) // 32) * 2 * grid_dim_y)
:178

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.minibatch_mean = torch.cuda.FloatTensor(num_features)
:306

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.minibatch_riv = torch.cuda.FloatTensor(num_features)
:307

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
mp_count = torch.cuda.get_device_properties(None).multi_processor_count
:328

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.ret_cta = torch.cuda.ByteTensor(8192).fill_(0)
:343

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.ipc_buffer = torch.cuda.ByteTensor(bnp.get_buffer_size(bn_sync_steps))
:358

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
my_handle = torch.cuda.ByteTensor(np.frombuffer(internal_cuda_mem[1], dtype=np.uint8))
:365

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
my_offset = torch.cuda.IntTensor([internal_cuda_mem[3]])
:367

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

apex/contrib/nccl_allocator/nccl_allocator.py· 11
A
torch.cuda API usage
def create_nccl_mem_pool(symmetric: bool | None = None) -> torch.cuda.MemPool:
: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
torch.cuda API usage
_pool = torch.cuda.MemPool(_allocator)
: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
torch.cuda API usage
if "symmetric" in get_func_args(torch.cuda.MemPool):
: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
torch.cuda API usage
_pool = torch.cuda.MemPool(_allocator, symmetric=symmetric)
: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
elif "symm_mem" in get_func_args(torch.cuda.MemPool):
: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
_pool = torch.cuda.MemPool(_allocator, symm_mem=symmetric)
: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"
self.device = torch.device("cuda", torch.cuda.current_device())
: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
torch.cuda API usage
self.device = torch.device("cuda", torch.cuda.current_device())
:50

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"
self.device = torch.device("cuda", device)
: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
Device string "cuda"
assert "cuda" in device, "only cuda devices are supported"
: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
self.mem_context = torch.cuda.use_mem_pool(self.pool)
:62

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

apex/contrib/peer_memory/peer_memory.py· 2
A
torch.cuda API usage
ngpus = min(torch.cuda.device_count(), world_size)
:10

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
raw_ipc = pm.get_raw_ipc_address(self.raw).cuda()
:33

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

apex/contrib/sparsity/asp.py· 2
A
.cuda() tensor/module move
p.add_(pruned.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
.cuda() tensor/module move
p.add_(pruned.cuda())
:400

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

apex/contrib/sparsity/permutation_lib.py· 1
A
torch.cuda API usage
torch.cuda.manual_seed(identical_seed)
:179

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

apex/contrib/sparsity/sparse_masklib.py· 6
A
torch.cuda API usage
mat = torch.cuda.FloatTensor(
: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
.cuda() tensor/module move
patterns = compute_valid_1d_patterns(m, n).cuda()
: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
mask = torch.cuda.IntTensor(matrix.shape).fill_(1).view(-1, m)
: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
.cuda() tensor/module move
return torch.tensor(mask.cuda())
:115

.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
patterns = compute_valid_2d_patterns(m, n).cuda()
:152

.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
mask = torch.cuda.IntTensor(matrix.shape).fill_(1)
:155

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

apex/contrib/torchsched/inductor/_utils.py· 5
A
torch.cuda API usage
self.stream_queue: queue.Queue[torch.cuda.Stream] = queue.Queue(maxsize=pool_size)
:61

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 = torch.cuda.Stream(device=device)
:64

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 acquire(self) -> torch.cuda.Stream:
: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
def release(self, stream: torch.cuda.Stream | None) -> None:
: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
def __enter__(self) -> torch.cuda.Stream:
: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).

apex/contrib/torchsched/ops/layer_norm.py· 10
A
torch.cuda API usage
self._cudnn_stream = torch.cuda.Stream()
: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).

A
torch.cuda API usage
self._torch_stream = torch.cuda.current_stream()
: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
torch.cuda API usage
torch.cuda.set_stream(self._cudnn_stream)
: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
torch.cuda API usage
torch.cuda.set_stream(self._torch_stream)
: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
torch.cuda API usage
def set_stream(self, stream: torch.cuda.Stream) -> None:
: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).

A
torch.cuda API usage
def stream(self) -> torch.cuda.Stream:
: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
Device string "cuda"
@torch.library.custom_op("cudnn::layer_norm", mutates_args=(), device_types="cuda")
:268

The literal device string "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 = torch.cuda.current_stream()
:288

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",
:357

The literal device string "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 = torch.cuda.current_stream()
:371

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

setup.py· 1
A
torch.cuda API usage
if not torch.cuda.is_available():
:114

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/distributed/amp_master_params/compare.py· 4
A
.cuda() tensor/module move
model_params_rank0 = torch.load("rank0model.pth", map_location=lambda storage, loc: storage.cuda(0))
:3

.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
model_params_rank1 = torch.load("rank1model.pth", map_location=lambda storage, loc: storage.cuda(0))
:4

.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
"rank0master.pth", map_location=lambda storage, loc: storage.cuda(0)
: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.

A
.cuda() tensor/module move
"rank1master.pth", map_location=lambda storage, loc: storage.cuda(0)
:9

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