|
68 | 68 | "RTX5000": "NVIDIA RTX 5000 Ada Generation", |
69 | 69 | "RTX4000": "NVIDIA RTX 4000 Ada Generation", |
70 | 70 | "RTX2000": "NVIDIA RTX 2000 Ada Generation", |
| 71 | + # AMD Instinct (ROCm). Launching these requires a ROCm container image, not |
| 72 | + # the default CUDA image — see _is_amd_gpu_id and the image selection in |
| 73 | + # launch_cluster(). |
| 74 | + "MI300X": "AMD Instinct MI300X OAM", |
71 | 75 | } |
72 | 76 |
|
| 77 | +# Runpod GPU type IDs for AMD/ROCm cards. Used to pick a ROCm container image at |
| 78 | +# launch time instead of the default CUDA image. |
| 79 | +_RUNPOD_AMD_GPU_IDS: frozenset = frozenset( |
| 80 | + { |
| 81 | + "AMD Instinct MI300X OAM", |
| 82 | + } |
| 83 | +) |
| 84 | + |
| 85 | +# Default ROCm container image for AMD pods. Overridable per-launch via the |
| 86 | +# provider config `image_name` (or legacy `template_id`). |
| 87 | +_RUNPOD_DEFAULT_ROCM_IMAGE = "rocm/pytorch:latest" |
| 88 | +# Default CUDA container image for NVIDIA pods. |
| 89 | +_RUNPOD_DEFAULT_CUDA_IMAGE = "runpod/pytorch:1.0.3-cu1281-torch290-ubuntu2204" |
| 90 | + |
| 91 | + |
| 92 | +def _is_amd_gpu_id(gpu_type_id: Optional[str]) -> bool: |
| 93 | + """Return True if the resolved Runpod GPU type ID is an AMD/ROCm card.""" |
| 94 | + if not gpu_type_id: |
| 95 | + return False |
| 96 | + return gpu_type_id in _RUNPOD_AMD_GPU_IDS or "AMD" in gpu_type_id |
| 97 | + |
73 | 98 |
|
74 | 99 | async def fetch_runpod_provider_logs( |
75 | 100 | provider_instance: ComputeProvider, |
@@ -360,8 +385,12 @@ def launch_cluster(self, cluster_name: str, config: ClusterConfig) -> Dict[str, |
360 | 385 | except ValueError: |
361 | 386 | gpu_count = 1 |
362 | 387 |
|
363 | | - # Use GPU-enabled image |
364 | | - default_image = "runpod/pytorch:1.0.3-cu1281-torch290-ubuntu2204" |
| 388 | + # Use a GPU-enabled image. AMD/ROCm cards need a ROCm image; the |
| 389 | + # default CUDA image will not run on them. |
| 390 | + if _is_amd_gpu_id(gpu_type_id): |
| 391 | + default_image = _RUNPOD_DEFAULT_ROCM_IMAGE |
| 392 | + else: |
| 393 | + default_image = _RUNPOD_DEFAULT_CUDA_IMAGE |
365 | 394 | else: |
366 | 395 | # CPU pod |
367 | 396 | compute_type = "CPU" |
|
0 commit comments