unsloth/studio/backend/utils
Daniel Han 8ec9a74fd3
studio: ROCm cleanups follow-up to #5301 (#5874)
Follow-up cleanups to the merged AMD ROCm support PR #5301:

1. De-duplicate the torchao Windows-ROCm import stub into a single shared
   module (studio/backend/core/_torchao_stub.py); both workers call one
   install_torchao_windows_rocm_stub() entrypoint.
2. Align the gfx name/arch comment columns in setup.sh and setup.ps1.
3. Isolate the float16 dtype fallback to AMD without native bf16; NVIDIA
   keeps dtype=None so unsloth's own bf16/fp16/FORCE_FLOAT32 detection is
   honored.
4. Hoist unconditional stdlib imports (gc, glob, re, subprocess, copy,
   types, sys, importlib.metadata) from function bodies to module top
   across the PR #5301-touched files; heavy/optional/relative imports stay
   lazy.
5. bitsandbytes Windows-ROCm install now uses plain pip (force_pip=True)
   instead of UV_SKIP_WHEEL_FILENAME_CHECK, per the AMD hackathon docs.

Also adds scripts/verify_import_hoist.py (a scope-aware LEGB AST resolver
that catches dangling-alias and rename-clash bugs in import-hoist
refactors) and wires it into the Lint CI source-lint job as a self-test
plus a pull_request compare gate.
2026-05-30 03:06:47 -07:00
..
datasets Studio: tools, thinking blocks, code execution and web search for safetensors (#5520) 2026-05-19 06:30:17 -07:00
hardware studio: ROCm cleanups follow-up to #5301 (#5874) 2026-05-30 03:06:47 -07:00
inference Fix Windows local GGUF model loading crash (#4730) 2026-04-01 01:38:09 -07:00
models studio: extend offline DNS auto-detect to inference parent + training (#5512) 2026-05-18 00:31:33 -07:00
paths studio: security and hardening pass (auth rate-limit, sandbox, path containment, schema validation, headers) (#5375) 2026-05-13 06:12:18 -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
_studio_release_build.py Add Studio web update banner and release version display (#5308) 2026-05-11 18:24:01 +04:00
cache_cleanup.py fix(studio): prevent ModuleNotFoundError in dataset.map() on Windows (#4473) 2026-03-22 06:11:24 -07:00
cpu_threads.py Studio: add configurable CPU thread pool limit (#5760) 2026-05-27 05:09:34 -07:00
downsample.py feat(studio): training history persistence and past runs viewer (#4501) 2026-03-25 00:58:55 -07:00
llama_cpp_freshness.py Studio: warn when llama.cpp prebuilt is at least 3 days behind (#5529) 2026-05-18 00:21:50 -07:00
native_path_leases.py Add native GGUF intake to Studio (#5246) 2026-05-04 11:46:18 +02:00
studio_version.py Add Studio web update banner and release version display (#5308) 2026-05-11 18:24:01 +04:00
subprocess_compat.py Add tauri (#5144) 2026-04-23 04:50:10 -07:00
transformers_version.py studio: extend offline DNS auto-detect to inference parent + training (#5512) 2026-05-18 00:31:33 -07:00
update_status.py Add Studio web update banner and release version display (#5308) 2026-05-11 18:24:01 +04:00
utils.py Final cleanup 2026-03-12 18:28:04 +00:00
wheel_utils.py fix/strix halo and windows AMD ROCm support (#5301) 2026-05-29 22:29:56 -07:00