Note: Please do not remove the questions. Answer beside them.
unsloth 2026.4.4
unsloth-zoo 2026.4.3
trl 1.0.0
transformers 5.5.0
torch 2.10.0
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/root/foo-llm-finetune/src/foo_rl/train/src/phase1/unsloth_train.py", line 152, in <module>
main()
File "/root/foo-llm-finetune/src/foo_rl/train/src/phase1/unsloth_train.py", line 146, in main
trainer.train()
File "/root/foo-llm-finetune/unsloth_compiled_cache/UnslothGRPOTrainer.py", line 84, in wrapper
output = f(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/foo-llm-finetune/.venv/lib/python3.12/site-packages/unsloth/models/rl.py", line 142, in _unsloth_train_with_resume_guard
return original_train(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/foo-llm-finetune/.venv/lib/python3.12/site-packages/transformers/trainer.py", line 1424, in train
return inner_training_loop(
^^^^^^^^^^^^^^^^^^^^
File "<string>", line 81, in _fast_inner_training_loop
File "/root/foo-llm-finetune/.venv/lib/python3.12/site-packages/transformers/trainer.py", line 1734, in _run_epoch
tr_loss_step = self.training_step(model, inputs, num_items_in_batch)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/foo-llm-finetune/unsloth_compiled_cache/UnslothGRPOTrainer.py", line 3039, in training_step
output = super().training_step(model, inputs, num_items_in_batch)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<string>", line 34, in _unsloth_training_step
File "/root/foo-llm-finetune/.venv/lib/python3.12/site-packages/trl/extras/profiling.py", line 202, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/foo-llm-finetune/unsloth_compiled_cache/UnslothGRPOTrainer.py", line 3068, in _prepare_inputs
generation_batch = self._generate_and_score_completions(generation_batch)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/foo-llm-finetune/.venv/lib/python3.12/site-packages/unsloth/models/rl.py", line 524, in wrapped
return original(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/foo-llm-finetune/unsloth_compiled_cache/UnslothGRPOTrainer.py", line 3844, in _generate_and_score_completions
with torch.no_grad(), disable_gradient_checkpointing(self.model, self.args.gradient_checkpointing_kwargs):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/share/uv/python/cpython-3.12.13-linux-x86_64-gnu/lib/python3.12/contextlib.py", line 144, in __exit__
next(self.gen)
File "/root/foo-llm-finetune/.venv/lib/python3.12/site-packages/trl/models/utils.py", line 382, in disable_gradient_checkpointing
model.gradient_checkpointing_enable(gradient_checkpointing_kwargs)
TypeError: FastBaseModel.post_patch_model.<locals>._gc_enable_reentrant() takes 0 positional arguments but 1 was given
Note: Please do not remove the questions. Answer beside them.
pip install --upgrade unsloth unsloth_zoo. yesColaborKaggleor local / cloud. cloudnvidia-smi. 1SFTTrainer,GRPOTraineretc. GRPOTrainerWith
use_gradient_checkpointing="unsloth",in my peft_kwargs. when you replacegradient_checkpoint_enablewith_gc_enable_reentrant, there is an arg mismatch.i added a workaround like
🦥 You can also ask via our Reddit page: https://reddit.com/r/unsloth/