We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
update_g_idx
1 parent ae65c0d commit c4a8c77Copy full SHA for c4a8c77
neural_compressor/transformers/quantization/utils.py
@@ -238,9 +238,16 @@ def _replace_linear(
238
dtype=torch.int32,
239
device=torch.device(device),
240
)
241
+
242
+ # Note: update_g_idx is only applicable for ipex versions >=2.7
243
model._modules[name].set_weights_bias(
244
module.qweight.data if hasattr(module, "qweight") else weight,
245
None if module.bias is None else module.bias.data,
246
+ **(
247
+ {"update_g_idx": not empty_weights}
248
+ if "update_g_idx" in model._modules[name].set_weights_bias.__code__.co_varnames
249
+ else {}
250
+ ),
251
252
else:
253
raise Exception("{} device Unsupported weight only quantization!".format(device))
0 commit comments