Skip to content

Qwen3_VL_(8B)-Vision-GRPO.ipynb notebook does not work: "_amp_foreach_non_finite_check_and_unscale_cuda" not implemented for 'BFloat16' #3992

Closed

Description

@bui-thanh-lam

I try running this notebook: https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen3_VL_(8B)-Vision-GRPO.ipynb
on Colab T4 GPU. In this cell:

trainer = GRPOTrainer(
    model = model,
    args = training_args,
    processing_class = processor,
    reward_funcs = [
        formatting_reward_func,
        correctness_reward_func,
    ],
    train_dataset = train_dataset,
)

trainer.train()

I've got this error:

The model is already on multiple devices. Skipping the move to device specified in `args`.
==((====))==  Unsloth - 2x faster free finetuning | Num GPUs used = 1
   \\   /|    Num examples = 566 | Num Epochs = 1 | Total steps = 283
O^O/ \_/ \    Batch size per device = 2 | Gradient accumulation steps = 1
\        /    Data Parallel GPUs = 1 | Total batch size (2 x 1 x 1) = 2
 "-____-"     Trainable parameters = 43,646,976 of 8,810,770,672 (0.50% trained)
-------------------- Question:
[{'content': [{'text': None, 'type': 'image', 'image': <PIL.PngImagePlugin.PngImageFile image mode=RGB size=512x512 at 0x7F124DAC8860>}, {'text': 'What is the highest value on the X axis? Also, first provide your reasoning or working out on how you would go about solving the question between <REASONING> and </REASONING> and then your final answer between <SOLUTION> and (put a single float here) </SOLUTION>', 'type': 'text'}], 'role': 'user'}] 
Answer:
30 
Response:<REASONING>
To determine the highest value on the X-axis of the graph, I examine the horizontal axis (X-axis) which is labeled "MICROGRAMS/ml-E-DNP-LYSINE-HCL". I observe the scale markings on this axis, which are marked at intervals of 5 units: 0, 5, 10, 15, 20, 25, and 30. The last marked value on the X-axis is 30. Since the axis extends to this point and there are no further labeled tick marks beyond 30, the highest value indicated on the X-axis is 30.

</REASONING>
<SOLUTION>30.0</SOLUTION>
Unsloth: Will smartly offload gradients to save VRAM!
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
/tmp/ipython-input-2014710370.py in <cell line: 0>()
     10 )
     11 
---> 12 trainer.train()

6 frames
/usr/local/lib/python3.12/dist-packages/torch/amp/grad_scaler.py in _unscale_grads_(self, optimizer, inv_scale, found_inf, allow_fp16)
    278             for device, per_dtype_grads in per_device_and_dtype_grads.items():
    279                 for grads in per_dtype_grads.values():
--> 280                     torch._amp_foreach_non_finite_check_and_unscale_(
    281                         grads,
    282                         per_device_found_inf.get(device),

NotImplementedError: "_amp_foreach_non_finite_check_and_unscale_cuda" not implemented for 'BFloat16'

I'm new to Unsloth. Could anybody tell me what's the problem and any workaround to it.

Activity

  1. Datta0 commented on Feb 9, 2026

    @Datta0
    Contributor

    Hey @bui-thanh-lam can you share which versions of trl, transformers, unsloth, unsloth-zoo and vllm are you running?

  2. pluesclues commented on Feb 11, 2026

    @pluesclues
    Contributor

    @bui-thanh-lam I ran the notebook that you linked, maybe re run it now, it works fine for me. But I wanted to ask if you also potentially changed anything? Possibly could be dependency issues as well.

  3. added
    unsure bug?
    insufficient information
    and removed on Feb 12, 2026
  4. danielhanchen commented on Jun 18, 2026

    @danielhanchen
    Member

    This should be fixed now - sorry on the delay - please update with uv pip install --upgrade unsloth unsloth_zoo --force-reinstall --no-cache-dir - if it's not fixed yet, it'll be in the next pip / PyPI release - if it's still not working after that, please open another issue - appreciate it again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    insufficient informationunsure bug?

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions