OneTrainer
OneTrainer copied to clipboard
[Bug]: Prior Prediction does not work with NF4 Model Weights
What happened?
When trying to use prior prediction with nf4 model weights, the following error occurs.
Traceback (most recent call last):
File "D:\AI\OTTest\OneTrainer\modules\ui\TrainUI.py", line 604, in __training_thread_function
trainer.train()
File "D:\AI\OTTest\OneTrainer\modules\trainer\GenericTrainer.py", line 681, in train
model_output_data['target'][prior_pred_indices] = prior_model_output_data['predicted'][prior_pred_indices]
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
RuntimeError: Index put requires the source and destination dtypes match, got BFloat16 for the destination and Float for the source.
This is valid for the HiDream branch, but this is a reminder for @dxqbYD to check for other large models (Flux, Hunyuan) in the main branch code.
What did you expect would happen?
No error. Able to use prior prediction with nf4 model weights.
Relevant log output
Generate and upload debug_report.log
No response