unsloth/tests
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
..
python tests: add no-torch / Intel Mac test suite (#4646) 2026-03-27 02:33:45 -07:00
qlora Revert "[pre-commit.ci] auto fixes from pre-commit.com hooks" 2025-12-01 07:24:58 -08:00
saving Revert "[pre-commit.ci] auto fixes from pre-commit.com hooks" 2025-12-01 07:24:58 -08:00
sh Fix AMD/ROCm support bugs found during audit and expand test coverage 2026-03-31 08:24:16 +00:00
studio/install Fix AMD/ROCm support bugs found during audit and expand test coverage 2026-03-31 08:24:16 +00:00
utils feat: Implement Q-GaLore optimizer and custom embedding learning rate… (#4511) 2026-03-25 01:03:10 -07:00
__init__.py Qwen 3, Bug Fixes (#2445) 2025-04-30 22:38:39 -07:00
run_all.sh tests: add no-torch / Intel Mac test suite (#4646) 2026-03-27 02:33:45 -07:00
test_get_model_name.py Fixup mapper issues and resolve properly (#4124) 2026-03-03 06:57:25 -08:00
test_model_registry.py Revert "[FIX] Vllm guided decoding params (#3662)" 2025-12-01 05:43:45 -08:00
test_raw_text.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2026-01-08 11:35:21 +00:00