Commit graph

4,672 commits

Author SHA1 Message Date
Daniel Han
a537ece7eb studio: use uv for Python package installs (8x faster)
Replace pip with uv in install_python_stack.py to speed up the Python
dependency installation phase of `unsloth studio setup`.

- Add _bootstrap_uv() that checks for uv on PATH, and if not found,
  installs it via pip. Falls back to pip if uv is unavailable.
- Translate pip flags to uv equivalents (--no-cache-dir dropped since
  uv caching is fast, --force-reinstall becomes --reinstall).
- Add --torch-backend=auto so uv auto-detects CUDA version for
  PyTorch ecosystem packages.
- Per-install fallback: if any uv install step fails, it retries that
  step with pip before exiting.

Measured on clean venv setup:
  Python packages (pip):  2m 28s
  Python packages (uv):  18s
  Speedup:               ~8x

Total setup time goes from ~4m 35s to ~2m 30s (llama.cpp build is
now the bottleneck at 1m 40s).
2026-03-14 00:54:09 -07:00
Daniel Han
2bb72a2244 Revert "add support for mixtral"
This reverts commit c8f712b614.
2026-03-13 22:39:15 -07:00
tohrnii
943e8f6d84 add support for mixtral
(cherry picked from commit a55b740062)
2026-03-13 22:39:15 -07:00
Daniel Han
936c18424e Revert "patch vlm trainer to resize images"
This reverts commit 481b22fdf4.
2026-03-13 22:39:07 -07:00
oliveirabruno01
aa8d91b241 patch vlm trainer to resize images
(cherry picked from commit 14c282c4ec)
2026-03-13 22:39:07 -07:00
Daniel Han
b8eee7a8ba Revert "Initial changes: Refactor Attention"
This reverts commit a2af843271.
2026-03-13 22:38:57 -07:00
Shikhar Mishra
7502195443 Initial changes: Refactor Attention
(cherry picked from commit 5a7237abfd)
2026-03-13 22:38:57 -07:00
Daniel Han
49132ced50 Revert "feat: Add Mixtral model support"
This reverts commit 99c302d873.
2026-03-13 22:38:49 -07:00
Shikhar Mishra
659281c508 feat: Add Mixtral model support
(cherry picked from commit 2258875885)
2026-03-13 22:38:49 -07:00
Daniel Han
30a18786bf Revert "Improve documentation on how to export model from Colab"
This reverts commit 703c235a7d.
2026-03-13 22:38:41 -07:00
Vishwanath Martur
022a5d566a Improve documentation on how to export model from Colab
Related to #1615

Add documentation and function for exporting models from Colab to local machines.

* **README.md**: Add a new section titled "Exporting Models from Colab to Local Machine" under " Finetune for Free" with detailed steps for exporting models from Colab to local machines.
* **CONTRIBUTING.md**: Add a note about the new documentation section for exporting models from Colab.
* **unsloth/save.py**: Add a new function `export_model_to_local` to handle exporting models from Colab to local machines.

(cherry picked from commit 0361bd658f)
2026-03-13 22:38:41 -07:00
Daniel Han
c5fa314937 Revert "adding tools to be able to profile model fwds to see what to turn into kernels"
This reverts commit d32b00ecd8.
2026-03-13 22:38:31 -07:00
cm2435
12898b5bef adding tools to be able to profile model fwds to see what to turn into kernels
(cherry picked from commit 6db5b126b6)
2026-03-13 22:38:31 -07:00
LeoBorcherding
3ab282fd40 fix: install data-designer plugin non-editable for Colab compatibility
Editable installs (-e) work via a .pth file that is only processed at
Python startup. In Colab the kernel is already running when setup.sh
installs the plugin, so the .pth file never gets picked up and
data_designer_unstructured_seed is not importable.

Remove -e so pip copies the package files directly into site-packages,
which the live kernel can find immediately. Local venv installs are
unaffected since the venv is always created fresh before install.
2026-03-13 13:44:08 -07:00
pre-commit-ci[bot]
6baa181890 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-03-13 13:38:19 -07:00
Daniel Han
eb7637013e Update CODEOWNERS 2026-03-13 13:38:19 -07:00
Roland Tannous
b95242a80f fix: only skip frontend build for PyPI prebuilt (site-packages + dist check) 2026-03-13 20:26:10 +00:00
Roland Tannous
bf54225f86 fix: site-packages + dist check for frontend
build, fix ruff blank lines
2026-03-13 20:13:34 +00:00
Roland Tannous
0e0325127d Revert "site-packages + dist check"
This reverts commit 82063d8edb.
2026-03-13 20:09:41 +00:00
Roland Tannous
82063d8edb site-packages + dist check 2026-03-13 20:04:15 +00:00
Roland Tannous
8ce2b64df7 allow install from source 2026-03-13 20:04:15 +00:00
Daniel Han
1f99dee027
fix(seed): disable remote code execution in seed inspect dataset loads (#4275)
* fix(seed): disable remote code execution for seed inspect loads

* fix(test): use __file__-relative path in seed test

The test used a CWD-relative path (`studio/backend/routes/...`) which
only resolved when pytest was invoked from the repo root. Use
`Path(__file__).resolve()` so the test passes regardless of CWD.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Test <test@test.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-03-13 19:37:43 +04:00
Daniel Han
88c7b08faa
fix: prevent ai-assist model config RCE via untrusted Hugging Face repos (#4274)
* fix: disable remote code loading for ai-assist model hint lookup

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Roland Tannous <115670425+rolandtannous@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-03-13 19:29:11 +04:00
Roland Tannous
e539965740 fix error for chat template 2026-03-13 15:18:04 +00:00
Roland Tannous
8108f1bf11 Fix nvm/npmrc prefix conflict in setup.sh 2026-03-13 08:59:51 +00:00
Daniel Han
3e8f085474 Limit rocm711-torch291 to Linux 2026-03-13 01:40:56 -07:00
sstamenk
a54a913431 Add more ROCm/PyTorch combinations
(cherry picked from commit d02aa7f9c3)
2026-03-13 01:40:56 -07:00
sstamenk
c752c8107a Add more ROCm/PyTorch versions
(cherry picked from commit ed6877fadd)
2026-03-13 01:40:56 -07:00
Daniel Han
51bf500f57
Remove Blackwell flex attention disable workaround from studio (#4273)
The studio was disabling flex attention entirely on Blackwell+ GPUs
(sm_120 and above) by setting UNSLOTH_ENABLE_FLEX_ATTENTION=0 at
startup. This was a workaround for the flex_attention backward kernel
exceeding shared memory limits on these GPUs.

The root cause is now fixed in unsloth-zoo (PR #542) which patches the
backward kernel config selection to generate safe fallback configs that
fit within the GPU's shared memory limit. With that fix, flex attention
works correctly on Blackwell GPUs and provides a ~1.3x speedup over
the SDPA fallback.
2026-03-13 01:35:17 -07:00
Daniel Han
37b8d5e440
remove duplicate import (#4271)
(cherry picked from commit d1f4fb5d6a)

Co-authored-by: electron271 <66094410+electron271@users.noreply.github.com>
2026-03-13 00:26:38 -07:00
Daniel Han
d6e40df8fa
Fix llm_int8_skip_modules for VLM dynamic quants on transformers 5.x (#4249)
Fix `llm_int8_skip_modules` not being respected for VLMs with dynamic quantization on transformers 5.x.

Dynamic quant checkpoints (e.g. `gemma-3-4b-it-unsloth-bnb-4bit`) encode skip paths as `language_model.model.layers.*`, but the live module tree on 5.x surfaces them as `model.language_model.layers.*`. This prefix mismatch causes `should_convert_module` to miss the skip list, so 22 modules meant to stay in 16-bit get wrapped in `Linear4bit` without a `quant_state`, producing "Skipping ... no quant_state found" warnings.

Patches `should_convert_module` to expand both the module name and the skip patterns into all equivalent alias forms before matching. Guarded by `hasattr` so it is a no-op on transformers 4.x where the bug does not exist.

Closes #4208
2026-03-13 00:17:00 -07:00
Daniel Han
1ca441a3f3
[Feature] VLMs support for GRPO (#4265)
* Updated rl and rl_replacements

* Revert "Updated rl and rl_replacements"

This reverts commit 077fd5996daa73c9c58c9f213657f33f47f5d73b.

---------

Co-authored-by: Sinoué GAD <85933501+GAD-cell@users.noreply.github.com>
2026-03-12 16:09:02 -07:00
Daniel Han
74c1497f2f
[Feature] Support Sequence Classification (#4264)
* initial commit for sequence classification implementation

* Revert "initial commit for sequence classification implementation"

This reverts commit 0f3200cdf2dfb8446e5d69dcbe40d6f70bc520e7.

---------

Co-authored-by: Rabin Tiwari <84705625+rabintiwari45@users.noreply.github.com>
2026-03-12 16:08:49 -07:00
Daniel Han
96ff5c5f61
Update CODEOWNERS for studio and cli (#4266)
* Update CODEOWNERS for studio and cli

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-03-12 15:16:38 -07:00
Daniel Han
c26aa1a1e8 Restore non-studio files from main after history recovery 2026-03-12 21:48:45 +00:00
Daniel Han
6f0bca70f8 Merge remote-tracking branch 'studio/feature/merge-build-main' into history-recovery-candidate 2026-03-12 21:48:30 +00:00
Daniel Han
17ae3d3cba Revert "Studio (#4237)"
This reverts commit f08aef1804.
2026-03-12 21:48:23 +00:00
Roland Tannous
2b04c0da40 add build.sh 2026-03-12 20:52:42 +00:00
Roland Tannous
47654cb91c Final cleanup 2026-03-12 18:28:04 +00:00
Roland Tannous
3613166b6d Delete studio/frontend/README.md 2026-03-12 22:20:34 +04:00
Roland Tannous
8002913b7c Delete studio/frontend/AGENTS.md 2026-03-12 22:20:23 +04:00
Roland Tannous
a2baf80511 Update license headers 2026-03-12 17:23:10 +00:00
Roland Tannous
7de1c18c14 Update llm_assist.py 2026-03-12 21:06:04 +04:00
Roland Tannous
063cdc6072 Update llm_assist.py 2026-03-12 20:32:04 +04:00
Roland Tannous
5798a34606 Update run.py 2026-03-12 19:28:48 +04:00
Roland Tannous
9bb64fbd96 Update run.py 2026-03-12 18:53:19 +04:00
Roland Tannous
10bee32f3d Update run.py 2026-03-12 18:30:00 +04:00
Roland Tannous
20aeb2ef19 Update studio.py 2026-03-12 18:13:56 +04:00
Roland Tannous
7881fc253f Update install_python_stack.py 2026-03-12 18:06:37 +04:00
Roland Tannous
542a25977a Update run.py 2026-03-12 18:01:14 +04:00