Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

VTrngNghia
Copy link

@VTrngNghia VTrngNghia commented Jul 16, 2024

What does this PR do?

Adds a keyword argument to allow passing extra_options to ORTQuantizer.quantize()

To fix RuntimeError:

Unable to find data type for weight_name='/encoder/layer.0/attention/output/dense/MatMul_output_0'. shape_inference failed to return a type probably this node is from a different domain or using an input produced by such an operator. This may happen if you quantize a model already quantized. You may use extra_options DefaultTensorType to indicate the default weight type, usually onnx.TensorProto.FLOAT.

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.

@VTrngNghia VTrngNghia changed the title feat(quantization): add extra_options fix Unable to find data type for weight_name='/encoder/layer.0/attention/output/dense/MatMul_output_0' Jul 16, 2024
@severinsimmler
Copy link

+1

Thanks for fixing this @VTrngNghia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants