-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix Unable to find data type for weight_name='/encoder/layer.0/attention/output/dense/MatMul_output_0' #1959
base: main
Are you sure you want to change the base?
Conversation
+1 Thanks for fixing this @VTrngNghia |
Is there any harm in just hard-coding |
Do you mean hard-coding in your package code? Then no "harm" except every time you setup your environment (say, in Docker container), you'll have to apply that change again. |
I meant to change the code in this PR to "extra_options": {
"WeightSymmetric": quantization_config.weights_symmetric,
"ActivationSymmetric": quantization_config.activations_symmetric,
"EnableSubgraph": has_subgraphs,
"ForceSymmetric": quantization_config.activations_symmetric and quantization_config.weights_symmetric,
"AddQDQPairToWeight": quantization_config.qdq_add_pair_to_weight,
"DedicatedQDQPair": quantization_config.qdq_dedicated_pair,
"QDQOpTypePerChannelSupportToAxis": quantization_config.qdq_op_type_per_channel_support_to_axis,
"DefaultTensorType": onnx.TensorProto.FLOAT
},
and not pipe through the extra_options keyword argument |
@@ -286,6 +287,7 @@ def quantize( | |||
calibration_tensors_range: Optional[Dict[str, Tuple[float, float]]] = None, | |||
use_external_data_format: bool = False, | |||
preprocessor: Optional[QuantizationPreprocessor] = None, | |||
extra_options: Optional[Dict[str, Any]] = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you set the default to None
and then create an empty dict in the method please?
Dict as default value is not good because they are mutable.
cc @echarlaix |
What does this PR do?
Adds a keyword argument to allow passing extra_options to ORTQuantizer.quantize()
To fix RuntimeError:
Maybe it can be added to
AutoQuantizationConfig
, but there any many@staticmethod
for that, so maybe this quick fix is simpler.Who can review?
It's very simple. Anyone can review.