File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -462,8 +462,20 @@ def save_sd_for_aiu(
462462 logger .info (
463463 "Attention: saving state dictionary without specifying a quantization "
464464 "configuration (qcfg) performs no recomputation for narrow weight "
465- "distributions and assumes the weight quantizer used was per-tensor."
465+ "distributions and assumes the weight quantizer used was 8-bit per-tensor."
466466 )
467+ else :
468+ nbits_w = qcfg .get ("nbits_w" , None )
469+ if nbits_w is None :
470+ logger .info (
471+ "Number of bits for weight quantization is not set in qcfg. "
472+ "Assuming default (nbits_w=8)."
473+ )
474+ elif nbits_w != 8 :
475+ raise ValueError (
476+ "Saving checkpoint in AIU-compliant format only supports INT8 "
477+ f"quantization for now, but found { nbits_w = } in qcfg."
478+ )
467479
468480 converted_sd = convert_sd_for_aiu (
469481 model = model ,
You can’t perform that action at this time.
0 commit comments