coffeine16 commited on
Commit
418c2af
·
verified ·
1 Parent(s): cca78ec

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. train_grpo.py +5 -4
train_grpo.py CHANGED
@@ -221,10 +221,11 @@ print(f"GPU: {torch.cuda.get_device_name(0)}")
221
  model, tokenizer = FastLanguageModel.from_pretrained(
222
  model_name=MODEL_NAME,
223
  max_seq_length=MAX_SEQ_LENGTH,
224
- # FIX: do NOT set dtype manually when using 4bit let Unsloth decide.
225
- # Mixing bfloat16 + 4bit quant caused the Half/Float matmul crash.
226
- dtype=None,
227
- load_in_4bit=True,
 
228
  )
229
 
230
  model = FastLanguageModel.get_peft_model(
 
221
  model, tokenizer = FastLanguageModel.from_pretrained(
222
  model_name=MODEL_NAME,
223
  max_seq_length=MAX_SEQ_LENGTH,
224
+ # Use bfloat16 without 4bit quantization to avoid Unsloth 2026.4.8
225
+ # bug where quantized LoRA kernel hits Half/Float dtype mismatch.
226
+ # L40S has 44GB VRAM so Qwen2.5-1.5B fits easily in bf16.
227
+ dtype=torch.bfloat16,
228
+ load_in_4bit=False,
229
  )
230
 
231
  model = FastLanguageModel.get_peft_model(