mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Fixes `RuntimeError: self and mat2 must have the same dtype, but got BFloat16 and Float` With bf16 autocast, bias converted into BFloat16, but fp8_qlinear_onednn_ref not support bf16 bias. In this pr, convert bias into bf16 on fp8_qlinear_onednn_ref. Add this case into ut and reproduce: `python test/test_quantization.py -k test_qlinear_fp8` Pull Request resolved: https://github.com/pytorch/pytorch/pull/159125 Approved by: https://github.com/Xia-Weiwen, https://github.com/cyyever, https://github.com/CaoE