Merge branch 'main' into nightly
This commit is contained in:
commit
64bd3e552f
2 changed files with 3 additions and 3 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue