-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
QDQ tool modification part2 #9720
Changes from 4 commits
c859447
3b92da7
ac5405b
b30daea
0ba3c58
5f04fbe
fa51f26
ca35bf1
87ca68c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -194,6 +194,11 @@ def quantize_static(model_input, | |
inserts both QuantizeLinear/DeQuantizeLinear nodes to weight. | ||
OpTypesToExcludeOutputQuantizatioin = list of op type : Default is []. If any op type is specified, it won't quantize | ||
the output of ops with this specific op types. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as TRT has so many , i'm thinking we may need a config file for different execution provider |
||
DedicatedQDQPair = True/False : Default is False. When inserting QDQ pair, multiple nodes can share a single QDQ pair as their inputs. | ||
If True, it will create identical and dedicated QDQ pair for each node. | ||
AddQDQToAddNodeFollowedByReduceMeanNode = True/False : Default is False. It adds QDQ pairs to every Add node if Add op type is in op_types_to_quantize. | ||
If True, only Add node followed by ReduceMean node is going to be added QDQ pair. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is too specific. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we have a general way nodes_to_exclude. why not use it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I'm using nodes_to_exclude in qdq_quantizer.py#128. |
||
QDQChannelAxis = Integer : Default is 0. Channel axis for QDQ pair when per_channel is True. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. which operators in TRT supports per-channel? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In TRT pretty much we only use per-channel for weights. All activations are using per-tensor. |
||
''' | ||
|
||
mode = QuantizationMode.QLinearOps | ||
|
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.
what if the operator doesn't support per-channel
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.
cpu ep only per-channel for Conv and Matmul now
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.
Added a new extra options OpTypesSupportPerChannelQuantization