From 5d0523c1caff477db614a13e38e1bfdb08d98d1c Mon Sep 17 00:00:00 2001 From: VED <146507396+ved1beta@users.noreply.github.com> Date: Mon, 1 Dec 2025 06:30:31 +0530 Subject: [PATCH 1/2] set defualt [128, 128] insted of none (#3658) Co-authored-by: Ved --- unsloth/kernels/fp8.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsloth/kernels/fp8.py b/unsloth/kernels/fp8.py index 435a6e83d2..3093bf61b1 100644 --- a/unsloth/kernels/fp8.py +++ b/unsloth/kernels/fp8.py @@ -346,7 +346,7 @@ class FP8BlockQuantLinear(torch.autograd.Function): m, n = weight.shape p, q = weight_scale.shape block_size = getattr(weight, "block_size", None) or getattr( - weight_scale, "block_size", None + weight_scale, "block_size", [128, 128] ) assert block_size is not None, "block_size is not set" if triton.cdiv(m, block_size[0]) != p or triton.cdiv(n, block_size[1]) != q: From 6abd9afe99c30122c3417e1828a3897ea1016c51 Mon Sep 17 00:00:00 2001 From: Santosh Bhavani Date: Mon, 1 Dec 2025 04:18:41 -0800 Subject: [PATCH 2/2] Fix: Pass gradient_checkpointing parameter to model.for_training() calls (#3659) --- unsloth/models/rl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unsloth/models/rl.py b/unsloth/models/rl.py index 1a06277d85..dd411ff00b 100644 --- a/unsloth/models/rl.py +++ b/unsloth/models/rl.py @@ -312,7 +312,7 @@ class Unsloth{RLTrainer_name}(_Unsloth{RLTrainer_name}): if getattr(args, "_n_gpu", 1) != 1: args._n_gpu = 1 if "model" in locals() and hasattr(model, "for_training"): - model.for_training() + model.for_training(use_gradient_checkpointing=getattr(args, 'gradient_checkpointing', True)) super().__init__({RLTrainer_call_args}{RLTrainer_kwargs}) if "model" in locals() and hasattr(model, "for_inference"): model.for_inference() @@ -565,7 +565,7 @@ def _patch_trl_rl_trainers(trainer_file = "grpo_trainer"): if "model" in call_args: training_check = ( "if model is not None and hasattr(model, 'for_training'):\n" - " model.for_training()\n" + " model.for_training(use_gradient_checkpointing=getattr(args, 'gradient_checkpointing', True))\n" "if 'tokenizer' in locals() and hasattr(tokenizer, 'padding_side'): tokenizer.padding_side = 'right'\n" "if 'processing_class' in locals():\n" " if hasattr(processing_class, 'padding_side'): processing_class.padding_side = 'right'\n"