Commit graph

3,301 commits

Author SHA1 Message Date
pluesclues
2164423ea6 Merge pull request #3628 from pluesclues/alternative_compute_chunked_loss
Chunk Across Batch and Context length for logprob calculations for grpo
2026-01-15 05:01:19 -08:00
Daniel Han
832fffa40a Merge pull request #3895 from Datta0/rl_ref_trl
[trl] use non lora model as base for RL
2026-01-15 03:33:09 -08:00
pre-commit-ci[bot]
f5dde984a1 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-01-15 11:25:11 +00:00
Datta Nimmaturi
7f6dc63dc8 use non lora model as base for RL 2026-01-15 11:23:21 +00:00
Daniel Han
b55a2e30eb Merge pull request #3879 from ducviet00/fix-gc
Disable gradient checkpointing when explicitly off for vision
2026-01-14 04:32:02 -08:00
Michael Han
45eeae95c5 Update template.md 2026-01-14 03:45:35 -08:00
Daniel Han
9adebb0dcf Merge pull request #3880 from f14-bertolotti/f14-wrong-ndim
wrong number of dimensions
2026-01-12 21:32:48 -08:00
Daniel Han
0f0b870781 Apply suggestion from @danielhanchen 2026-01-12 21:32:20 -08:00
Daniel Han
22ff11315e Merge pull request #3881 from unslothai/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2026-01-12 21:29:58 -08:00
pre-commit-ci[bot]
2f8c4d962b [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.14.10 → v0.14.11](https://github.com/astral-sh/ruff-pre-commit/compare/v0.14.10...v0.14.11)
2026-01-12 19:08:13 +00:00
Francesco Bertolotti
eaf3f932e0 wrong number of dimensions 2026-01-12 16:19:43 +01:00
Duc-Viet Hoang
5b422f7a06 Complete disable gradient_checkpointing for vision when use_gradient_checkpointing=False 2026-01-12 10:03:54 +07:00
Daniel Han
bf7b5b06a1 Merge pull request #3865 from ykaitao/ktyang_configure_embedding_for_training
reduce code duplication by _offload_frozen_module_for_training
2026-01-09 21:02:55 -08:00
danielhanchen
6465496ab2 fix: use peft.utils.other for ModulesToSaveWrapper import
ModulesToSaveWrapper was removed from peft.tuners.tuners_utils in PEFT
0.16.0. The class has been available in peft.utils.other since at least
PEFT 0.7.1, which is the minimum version Unsloth requires.

This fixes the ImportError when using PEFT >= 0.16.0.
2026-01-09 23:24:39 +00:00
Kaitao Yang
0bff0ffbe5 reduce code duplication by _offload_frozen_module_for_training 2026-01-09 06:07:38 -08:00
Daniel Han
0e54b817af Merge pull request #3869 from hnxnq7/fix-kaggle-telemetry-detection
Fix Kaggle telemetry misclassification when COLAB_ keys exist
2026-01-08 17:29:23 -08:00
pre-commit-ci[bot]
3ce1060dd1 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-01-09 00:33:01 +00:00
Rachel Li
1193c9f526 Fix Kaggle telemetry detection & address review feedback
- Fix Kaggle misclassification by prioritizing filesystem markers over env vars
- Preserve telemetry pings when statistics is explicitly provided
- Replace bare except with except Exception
- Minor cleanup based on automated review feedback
2026-01-08 19:32:33 -05:00
Rachel Li
84701c55ff Fix telemetry ping regression for explicit statistics
Fixed Codex regression: keep snapshot_download pings for explicit statistics values; detection only runs when statistics is None. Also replaced bare except.
2026-01-08 19:20:24 -05:00
pre-commit-ci[bot]
e7d68f3e57 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-01-09 00:04:59 +00:00
Rachel Li
e13160ddc8 Update _utils.py
fixed indentation
2026-01-08 19:04:30 -05:00
pre-commit-ci[bot]
67bef80b1f [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-01-08 23:49:55 +00:00
Rachel Li
1cdf751f8e Fix Kaggle telemetry misclassification when COLAB_ keys exist
Problem: Kaggle notebook environments can expose both KAGGLE_* and COLAB_* environment keys. _get_statistics currently checks COLAB_ before KAGGLE_, causing Kaggle sessions to be labeled colab/colabpro.

Prefer filesystem markers (e.g. /kaggle/working, /content + /opt/colab) before env-key heuristics, then fall back to the existing env-key checks. This avoids misclassification when providers leak overlapping env vars.

Kaggle test notebook: https://www.kaggle.com/code/hnxnq07/kaggle-stats-gathering-test
2026-01-08 18:44:22 -05:00
Daniel Han
ff8f5cd328 Merge pull request #3612 from Vangmay/feature/raw-text-dataprep
Feature/raw text dataprep
2026-01-08 03:38:15 -08:00
pre-commit-ci[bot]
3ac4f3c213 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-01-08 11:35:21 +00:00
Daniel Han
24bbe8a97a Fix bugs and add improvements to RawTextDataLoader
- Fix test file: use return_tokenized instead of return_tensors
- Fix test file: use text_dataset instead of undefined dataset variable
- Move parameter validation to constructor (fail fast on invalid params)
- Add labels field in tokenized output for causal LM training
- Add empty file handling with clear error message
- Add tests for constructor validation and labels field
2026-01-08 11:35:00 +00:00
Daniel Han
84ae73789c Merge pull request #3863 from unslothai/fix/fbgemm-cutlass-errors-sm100
Fix FBGEMM/CUTLASS errors on SM100 (Blackwell) GPUs
2026-01-08 03:19:53 -08:00
pre-commit-ci[bot]
41b7fe0c67 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-01-08 04:15:17 +00:00
danielhanchen
1f85f39e0a Fix FBGEMM/CUTLASS errors on SM100 (Blackwell) GPUs
This PR fixes the "Arch conditional MMA instruction used without targeting
appropriate compute capability. Aborting." errors that occur when using
FBGEMM on Blackwell GPUs (B200/B100, SM100).

Changes:
- Add stderr filters in import_fixes.py for CUTLASS/FBGEMM MMA errors
- Add warning filters for various deprecation messages
- Update check_fbgemm_gpu_version() to disable FBGEMM instead of raising
  an error when old versions are detected
- Update test_has_fbgemm() in fp8.py to catch broader CUTLASS/CUDA errors
  and gracefully fall back to Triton kernels
- Update loader_utils.py to disable FBGEMM instead of raising ValueError
  for old fbgemm_gpu versions

The key behavior change is that FBGEMM errors no longer crash the script.
Instead, FBGEMM is disabled and Triton kernels are used automatically.
This allows Unsloth to work on SM100 GPUs where CUTLASS SM90 kernels fail,
and also gracefully handles old FBGEMM versions.
2026-01-08 04:14:53 +00:00
Daniel Han
6b04af4f49 Merge pull request #3857 from Datta0/modelscope_stats
[ModelScope] Disable stats when modelscope is being used
2026-01-06 02:56:55 -08:00
pre-commit-ci[bot]
46d212c480 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-01-06 10:00:17 +00:00
Datta Nimmaturi
1d84ba5287 Check env var explicitly
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-01-06 15:30:06 +05:30
Datta Nimmaturi
9a5b824903 Disable stats when modelscope is being used 2026-01-06 09:53:20 +00:00
Daniel Han
e7fe25ee43 Versioning 2026-01-05 07:37:08 -08:00
Daniel Han
a50f0e1a75 Merge pull request #3843 from unslothai/fix-grpo-version-compat
Unify Version usage and fix TRL version handling
2026-01-05 06:07:41 -08:00
Daniel Han
5f1a62bc0b Merge pull request #3851 from unslothai/grpo-fix-on-pr3754
GRPO: restore model mode after generate (stacked on #3754)
2026-01-05 06:05:24 -08:00
danielhanchen
4a45983bf6 Merge main into grpo-fix-on-pr3754 2026-01-05 14:02:18 +00:00
danielhanchen
77e7f73641 Revert rl_replacements GRPO edits 2026-01-05 13:55:08 +00:00
danielhanchen
506bcc48e5 Fix GRPO training state restoration 2026-01-05 13:50:48 +00:00
pre-commit-ci[bot]
27e9a672a2 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-01-05 13:39:16 +00:00
danielhanchen
7fd3a6c177 Restore TRL version fallback in rl.py 2026-01-05 13:39:03 +00:00
Daniel Han
02ef2c25ca Merge branch 'main' into fix-grpo-version-compat 2026-01-05 05:31:42 -08:00
danielhanchen
dc986cd7e2 Drop rl.py GRPO changes from this branch 2026-01-05 13:29:58 +00:00
Daniel Han
0812d6c1e4 Merge pull request #3849 from unslothai/fix-pdl-use-vllm-version-check
Replace GitHub API check with vLLM version check for PDL fix
2026-01-05 05:22:16 -08:00
pre-commit-ci[bot]
c612bfe3a3 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-01-05 13:19:44 +00:00
Daniel Han
cb42ce8dae Address review feedback: add constant and debug logging 2026-01-05 13:19:37 +00:00
Daniel Han
9ced3523aa Replace GitHub API check with vLLM version check for PDL fix
The GitHub issue check had issues:
1. Network latency on import
2. Issue being closed does not mean the fix is in the installed vLLM version

Now skip the PDL workaround if vLLM version > 0.13.2, which is when
the upstream fix is expected to be included.
2026-01-05 13:15:17 +00:00
Daniel Han
2de0915e6f Merge pull request #3836 from ykaitao/remove_unused_variable_BlockDiagonalCausalMask
remove unused variable BlockDiagonalCausalMask
2026-01-05 04:42:25 -08:00
Daniel Han
a68cd336b6 Merge pull request #3842 from unslothai/fix-vllm-chat-template-sync
Sync chat_template from tokenizer to vLLM
2026-01-05 04:38:39 -08:00
Daniel Han
d9d26699b5 Merge pull request #3841 from unslothai/fix-vllm-pdl-blackwell
Fix vLLM PDL bug on Blackwell GPUs (B200/B100)
2026-01-05 04:37:58 -08:00