(platform_name)
| 245 | |
| 246 | |
| 247 | def get_variant_name(platform_name): |
| 248 | if platform_name == "cuda": |
| 249 | # deduce the variant from gpu compute capability |
| 250 | from torchruntime.device_db import get_gpus |
| 251 | from torchruntime.gpu_db import get_nvidia_arch |
| 252 | from torchruntime.consts import NVIDIA |
| 253 | |
| 254 | gpus = get_gpus() |
| 255 | for gpu in gpus: |
| 256 | if gpu.vendor_id == NVIDIA and gpu.is_discrete: |
| 257 | arch = get_nvidia_arch([gpu.device_name]) # 7.5, 12 etc |
| 258 | arch = int(arch * 10) |
| 259 | return f"sm{arch}" |
| 260 | |
| 261 | return "any" |