Return a progress label like 'torch check (cuda)' using the known backend. Falls back to GPU detection when UNSLOTH_TORCH_BACKEND is not set (e.g. standalone `unsloth studio update` runs that bypass install.sh).
(suffix: str)
| 1458 | |
| 1459 | |
| 1460 | def _torch_step_label(suffix: str) -> str: |
| 1461 | """Return a progress label like 'torch check (cuda)' using the known backend. |
| 1462 | |
| 1463 | Falls back to GPU detection when UNSLOTH_TORCH_BACKEND is not set (e.g. |
| 1464 | standalone `unsloth studio update` runs that bypass install.sh). |
| 1465 | """ |
| 1466 | backend = _TORCH_BACKEND |
| 1467 | if not backend: |
| 1468 | if _has_usable_nvidia_gpu(): |
| 1469 | backend = "cuda" |
| 1470 | elif _has_rocm_gpu(): |
| 1471 | backend = "rocm" |
| 1472 | else: |
| 1473 | backend = "cpu" |
| 1474 | return f"torch {suffix} ({backend})" |
| 1475 | |
| 1476 | |
| 1477 | # -- Verbosity control ---------------------------------------------------------- |
no test coverage detected
searching dependent graphs…