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

Is there any way to convert a qdqmodel to qlinearmodel use ort? #18511

Open
Rickustc opened this issue Nov 20, 2023 · 2 comments
Open

Is there any way to convert a qdqmodel to qlinearmodel use ort? #18511

Rickustc opened this issue Nov 20, 2023 · 2 comments

Comments

@Rickustc
Copy link

Describe the issue

I have a qdqmodel which weight in operator actually be int 8
qdq
is there any setting in ort.seesion that can make qdq into qlinear mode? like this:
image
v

To reproduce

btw it is a resnet50 :D

Urgency

No response

Platform

Linux

OS Version

latest

ONNX Runtime Installation

Built from Source

ONNX Runtime Version or Commit ID

latest

ONNX Runtime API

Python

Architecture

X64

Execution Provider

Default CPU

Execution Provider Library Version

No response

@yufenglee
Copy link
Member

You can try setting SessionOption's optimized_model_filepath to the destination path and graph_optimization_level to onnxruntime.GraphOptimizationLevel.ORT_ENABLE_EXTENDED and load the model, then the optimized model will be saved to destination path. However, it is possible that not all QDQ are fused into QLinear.

@Rickustc
Copy link
Author

@yufenglee thank you for reply! Is there any way to control single operator weather it is converted to QLinear op?

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

No branches or pull requests

2 participants