From 7201ba391951b2624e39aa1514a18681c459f0f8 Mon Sep 17 00:00:00 2001 From: Michael Han <107991372+shimmyshimmer@users.noreply.github.com> Date: Sat, 13 Dec 2025 16:44:44 -0800 Subject: [PATCH 1/6] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 803e5763f1..43c09381fc 100644 --- a/README.md +++ b/README.md @@ -51,8 +51,8 @@ Use our official [Unsloth Docker image](https://hub.docker.com/r/unsloth/unsloth For RTX 50x, B200, 6000 GPUs: `pip install unsloth`. Read our [Blackwell Guide](https://docs.unsloth.ai/basics/training-llms-with-blackwell-rtx-50-series-and-unsloth) and [DGX Spark Guide](https://docs.unsloth.ai/new/fine-tuning-llms-with-nvidia-dgx-spark-and-unsloth) for more details. ## 🦥 Unsloth News -- New RoPE & MLP **Triton Kernels** & **Auto Packing**: 3x faster training & 30% less VRAM. [Blog](https://docs.unsloth.ai/new/3x-faster-training-packing) -- **Ministral 3** by Mistral: Run Ministral 3 or fine-tune with our vision or RL sodoku notebook. [Guide](https://docs.unsloth.ai/new/ministral-3) • [Notebooks](https://docs.unsloth.ai/new/ministral-3#fine-tuningb) +- New RoPE & MLP **Triton Kernels** & **Padding Free + Packing**: 3x faster training & 30% less VRAM. [Blog](https://docs.unsloth.ai/new/3x-faster-training-packing) +- **Ministral 3** by Mistral: Run Ministral 3 or fine-tune with vision/RL sodoku notebooks. [Guide](https://docs.unsloth.ai/new/ministral-3) • [Notebooks](https://docs.unsloth.ai/new/ministral-3#fine-tuningb) - **500K Context**: Training a 20B model with >500K context is now possible on an 80GB GPU. [Blog](https://docs.unsloth.ai/new/500k-context-length-fine-tuning) - **FP8 Reinforcement Learning**: You can now do FP8 GRPO on consumer GPUs. [Blog](https://docs.unsloth.ai/new/fp8-reinforcement-learning) • [Notebook](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen3_8B_FP8_GRPO.ipynb) - **DeepSeek-OCR**: Fine-tune to improve language understanding by 89%. [Guide](https://docs.unsloth.ai/new/deepseek-ocr-run-and-fine-tune) • [Notebook](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Deepseek_OCR_(3B).ipynb) From 6aff56a61a91b677df53e2ea6cfc00df43dd08da Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 17:54:15 -0800 Subject: [PATCH 2/6] [pre-commit.ci] pre-commit autoupdate (#3731) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.14.8 → v0.14.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.14.8...v0.14.9) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 11114de4b4..9d70d22426 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.8 + rev: v0.14.9 hooks: - id: ruff args: From 4e04e56b8275632d24ca60db5e3e35b148bf9036 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Mon, 15 Dec 2025 22:43:16 -0800 Subject: [PATCH 3/6] Update rl.py --- unsloth/models/rl.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/unsloth/models/rl.py b/unsloth/models/rl.py index 604323ac8c..3fd180bb27 100644 --- a/unsloth/models/rl.py +++ b/unsloth/models/rl.py @@ -741,6 +741,7 @@ def _patch_trl_rl_trainers(trainer_file = "grpo_trainer"): "generation_kwargs": {}, "bf16": False, "fp16": False, + "report_to" : "none", "include_tokens_per_second": False, "include_num_input_tokens_seen": False, "auto_find_batch_size": False, # Auto /2 batch size - too many people complained so removing @@ -907,8 +908,6 @@ def _patch_trl_rl_trainers(trainer_file = "grpo_trainer"): for process_extra_arg in process_extra_args: extra_args += process_extra_arg(old_RLTrainer_source, old_RLConfig_source) - # Edit report_to and default it to nothing if max_steps is like 60 - # Create RLConfig args extra_args = extra_args.split("\n") extra_args = "\n".join(" " * 8 + x for x in extra_args) From 002f2a215742609500e4903ddacecdf3bade1dd7 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Tue, 16 Dec 2025 15:46:27 -0800 Subject: [PATCH 4/6] Update import_fixes.py --- unsloth/import_fixes.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/unsloth/import_fixes.py b/unsloth/import_fixes.py index a78b5451ea..f37d850ca9 100644 --- a/unsloth/import_fixes.py +++ b/unsloth/import_fixes.py @@ -19,8 +19,6 @@ from importlib.metadata import version as importlib_version from packaging.version import Version as TrueVersion import re import logging -# Cannot import logger here since it'll import transformers -# from unsloth_zoo.log import logger def Version(version): From 3600b5341defa223c25325908dfee14dc41992d3 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Tue, 16 Dec 2025 16:57:38 -0800 Subject: [PATCH 5/6] Update import_fixes.py --- unsloth/import_fixes.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/unsloth/import_fixes.py b/unsloth/import_fixes.py index f37d850ca9..8ae4c2d3f7 100644 --- a/unsloth/import_fixes.py +++ b/unsloth/import_fixes.py @@ -19,7 +19,16 @@ from importlib.metadata import version as importlib_version from packaging.version import Version as TrueVersion import re import logging - +# We cannot do from unsloth_zoo.log import logger since FBGEMM might cause seg faults. +UNSLOTH_ENABLE_LOGGING = os.environ.get("UNSLOTH_ENABLE_LOGGING", "0") in ("1", "True", "true",) +logger = logging.getLogger(__name__) +if UNSLOTH_ENABLE_LOGGING: + logging.basicConfig(level = logging.INFO, format = '[%(name)s|%(levelname)s]%(message)s') + logger.setLevel(logging.INFO) +else: + logging.basicConfig(level = logging.WARNING, format = '[%(name)s|%(levelname)s]%(message)s') + logger.setLevel(logging.WARNING) +pass def Version(version): try: @@ -68,8 +77,6 @@ def fix_message_factory_issue(): def GetPrototype(self, *args, **kwargs): return - from unsloth_zoo.log import logger - if not hasattr(google.protobuf.message_factory, "MessageFactory"): logger.info("Unsloth: Patching protobuf.MessageFactory as it doesn't exist") google.protobuf.message_factory.MessageFactory = MessageFactory @@ -107,8 +114,6 @@ def fix_xformers_performance_issue(): return xformers_version = importlib_version("xformers") if Version(xformers_version) < Version("0.0.29"): - from unsloth_zoo.log import logger - xformers_location = importlib.util.find_spec("xformers").origin xformers_location = os.path.split(xformers_location)[0] cutlass = Path(xformers_location) / "ops" / "fmha" / "cutlass.py" @@ -138,8 +143,6 @@ def fix_vllm_aimv2_issue(): return vllm_version = importlib_version("vllm") if Version(vllm_version) < Version("0.10.1"): - from unsloth_zoo.log import logger - vllm_version = importlib.util.find_spec("vllm").origin vllm_version = os.path.split(vllm_version)[0] ovis_config = Path(vllm_version) / "transformers_utils" / "configs" / "ovis.py" @@ -271,7 +274,6 @@ def check_fbgemm_gpu_version(): raise ImportError( f"Unsloth: fbgemm_gpu_genai=={fbgemm_gpu_version} detected. It might cause unexpected issues like segmentation faults. Please uninstall the current one by doing `pip uninstall fbgemm-gpu` && `pip install fbgemm-gpu` to install fbgemm-gpu 1.4.0 or newer!" ) - from unsloth_zoo.log import logger logger.info(f"Unsloth: fbgemm_gpu_genai=={fbgemm_gpu_version} detected.") @@ -334,7 +336,6 @@ def patch_enable_input_require_grads(): self._require_grads_hook = hooks[0] PreTrainedModel.enable_input_require_grads = _patched_enable_input_require_grads - from unsloth_zoo.log import logger logger.info( "Unsloth: Patched enable_input_require_grads for vision model compatibility" @@ -376,7 +377,6 @@ def torchvision_compatibility_check(): f"but found torchvision=={torchvision_version}. " f"Please refer to https://pytorch.org/get-started/previous-versions/ for more information." ) - from unsloth_zoo.log import logger logger.info( f"Unsloth: torch=={torch_version} and torchvision=={torchvision_version} are compatible." @@ -392,7 +392,6 @@ def fix_openenv_no_vllm(): openenv = Path(trl_location) / "experimental" / "openenv" / "utils.py" if not openenv.exists(): return - from unsloth_zoo.log import logger try: with open(openenv, "r+", encoding = "utf-8") as f: From 28f742ee19fbe68f8796e4246a6cae6ee13340eb Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Tue, 16 Dec 2025 16:58:03 -0800 Subject: [PATCH 6/6] Update import_fixes.py --- unsloth/import_fixes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unsloth/import_fixes.py b/unsloth/import_fixes.py index 8ae4c2d3f7..3da82c8eb6 100644 --- a/unsloth/import_fixes.py +++ b/unsloth/import_fixes.py @@ -19,6 +19,7 @@ from importlib.metadata import version as importlib_version from packaging.version import Version as TrueVersion import re import logging + # We cannot do from unsloth_zoo.log import logger since FBGEMM might cause seg faults. UNSLOTH_ENABLE_LOGGING = os.environ.get("UNSLOTH_ENABLE_LOGGING", "0") in ("1", "True", "true",) logger = logging.getLogger(__name__) @@ -28,7 +29,7 @@ if UNSLOTH_ENABLE_LOGGING: else: logging.basicConfig(level = logging.WARNING, format = '[%(name)s|%(levelname)s]%(message)s') logger.setLevel(logging.WARNING) -pass + def Version(version): try: