MCPcopy Create free account
hub / github.com/unslothai/unsloth / _torch_step_label

Function _torch_step_label

studio/install_python_stack.py:1460–1474  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

1458
1459
1460def _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 ----------------------------------------------------------

Callers 1

install_python_stackFunction · 0.85

Calls 2

_has_usable_nvidia_gpuFunction · 0.85
_has_rocm_gpuFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…