#7268·trl

SFTTrainer's QLoRA fp16 downcast also hits QDoRA magnitude vector, causing silent no-op updates

Author: tardelrCreated Sep 18, 2026Updated Sep 18, 2026

Reproduction

The QDoRA magnitude vector is downcast from FP32 to BF16 during trainer setup, following the low-precision training path used for QLoRA.

When this downcast is applied to the DoRA lora_magnitude_vector, its optimizer updates can become smaller than the representable BF16 precision. In the reproduced case, this results in a silent no-op: the parameter remains trainable and receives updates, but its stored values do not change.

Restoring only the lora_magnitude_vector parameters to FP32 after trainer initialization restores the expected parameter updates.

Neither the original DoRA nor QDoRA repositories explicitly state that the magnitude vector must remain in FP32. However, their reference implementations use FP32 for this parameter.

To reproduce the issue, it is necessary to run training and compare the magnitude-vector values before and after optimizer steps. A minimal reproduction is available in this Colab notebook: https://colab.research.google.com/drive/13F6Ccx3jXLMSGIWlWJgJbPnL6OraDFa8?usp=sharing

The reproduction compares:

DoRA: magnitude vector remains FP32 and updates normally. QDoRA: magnitude vector changes from FP32 to BF16 during trainer setup and remains unchanged during training. QDoRA + FP32 magnitude: follows the same QDoRA setup, but the magnitude vector is cast back to FP32 after trainer initialization; updates then resume.

System Info

  • Platform: Linux-6.6.122+-x86_64-with-glibc2.39
  • Python version: 3.13.15
  • TRL version: 1.13.0
  • PyTorch version: 2.11.0+cu128
  • accelerator(s): NVIDIA L4
  • Transformers version: 5.16.1
  • Accelerate version: 1.14.0
  • Accelerate config: not found
  • Datasets version: 4.8.5
  • HF Hub version: 1.29.0
  • bitsandbytes version: 0.50.2
  • DeepSpeed version: not installed
  • Liger-Kernel version: not installed
  • PEFT version: 0.20.0
  • vLLM version: not installed

Checklist

  • I have checked that my issue isn't already filed (see open issues)
  • I have included my system information
  • Any code provided is minimal, complete, and reproducible (more on MREs)
  • Any code provided is properly formatted in code blocks, (no screenshot, more on code blocks)
  • Any traceback provided is complete