Skip to content

Commit

Permalink
fix only for qdq quantizer
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed May 24, 2024
1 parent 8150a3d commit 6e86081
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions optimum/onnxruntime/quantization.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,14 @@ def quantize(
},
}

if parse(ort_version) >= Version("1.18.0"):
# The argument `static` has been removed from the quantizer factory from ORT 1.18
quantizer_kwargs.pop("static")
if use_qdq:
quantizer_kwargs.pop("mode")
if parse(ort_version) >= Version("1.18.0"):
# The argument `static` has been removed from the qdq quantizer factory in ORT 1.18
quantizer_kwargs.pop("static")

if parse(ort_version) >= Version("1.13.0"):
# The argument `input_qType` has been changed into `activation_qType` from ORT 1.13
# The argument `input_qType` has been changed into `activation_qType` in ORT 1.13
quantizer_kwargs["activation_qType"] = quantizer_kwargs.pop("input_qType")

quantizer = quantizer_factory(**quantizer_kwargs)
Expand Down

0 comments on commit 6e86081

Please sign in to comment.