Skip to content

cherry pick 3663: fix the int8 quantization error, remove duplicated lines #3665

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

Open
wants to merge 2 commits into
base: release/2.8
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions py/torch_tensorrt/dynamo/conversion/impl/quantize.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def quantize(
Adds quantize and dequantize ops (QDQ) which quantize to INT8 or FP8 based
on the output_type set and dequantizes them back.
"""

with unset_fake_temporarily():
if isinstance(input_tensor, (torch.Tensor, TRTTensor)):
if input_tensor.dtype not in (
Expand Down Expand Up @@ -118,8 +117,6 @@ def quantize(
if not isinstance(input_tensor, TRTTensor):
input_tensor = get_trt_tensor(ctx, input_tensor, name + "_quantize_input")

quantize_layer = ctx.net.add_quantize(input_tensor, scale, dtype)

# Add Q node
quantize_layer = ctx.net.add_quantize(input_tensor, scale, dtype)
if axis is not None:
Expand Down
Loading