unsloth/studio/backend/utils
Daniel Han be0fd8b822 Fix AMD/ROCm support bugs found during audit and expand test coverage
Address 2 high, 3 medium, and 1 low severity issues identified during
an audit of the ROCm support implementation. Also adds 24 new test cases
(21 Python + 3 shell) to cover edge cases and prevent regressions on
CUDA, CPU, macOS, and Windows pathways.

Bug fixes:
- install.sh: add validation guard for _rocm_tag to reject malformed
  output (e.g. "rocm." from garbled amd-smi) that would produce bogus
  PyTorch index URLs
- install.sh: strip Debian epoch prefix (e.g. "2:6.2.0") from
  dpkg-query output before parsing ROCm version
- install_python_stack.py: add timeout=30 to the subprocess probe that
  checks whether torch is already GPU-enabled, preventing hangs
- install_llama_prebuilt.py: log a warning that the ROCm prebuilt is
  compiled for ROCm 7.2 and may fall back to source build on other
  ROCm versions
- install_llama_prebuilt.py: log a message when Windows HIP prebuilt
  is not found before silently falling through to CPU
- tests/sh/test_get_torch_index_url.sh: replace no-op test 18 (could
  not actually test /opt/rocm path) with 3 real tests for malformed
  amd-smi output (empty version, "N/A", trailing text)

Additional changes:
- Export IS_ROCM from studio/backend/utils/hardware/__init__.py so
  downstream code can import it directly from the package

Test results: 23/23 shell, 68/68 Python, 205/206 full suite (1
pre-existing failure unrelated to this change).
2026-03-31 08:24:16 +00:00
..
datasets fix(studio): avoid UnicodeEncodeError on Windows cp1252 consoles (#4699) 2026-03-30 06:40:47 -07:00
hardware Fix AMD/ROCm support bugs found during audit and expand test coverage 2026-03-31 08:24:16 +00:00
inference studio: improve onboarding UX, tooltips, and training defaults (#4355) 2026-03-17 07:46:07 -07:00
models Fix HF cache default and show LM Studio models in chat/inference (#4653) 2026-03-27 06:59:27 -07:00
paths fix: preserve Windows drive-letter paths on native Windows (#4665) 2026-03-27 08:19:41 -07:00
.gitkeep root studio folder 2026-02-02 09:13:49 +00:00
__init__.py Final cleanup 2026-03-12 18:28:04 +00:00
cache_cleanup.py fix(studio): prevent ModuleNotFoundError in dataset.map() on Windows (#4473) 2026-03-22 06:11:24 -07:00
downsample.py feat(studio): training history persistence and past runs viewer (#4501) 2026-03-25 00:58:55 -07:00
transformers_version.py feat: support GGUF export for non-PEFT models + fix venv_t5 switching for local checkpoints (#4455) 2026-03-20 12:13:18 +04:00
utils.py Final cleanup 2026-03-12 18:28:04 +00:00