Skip to content

Commit 9f32b3d

Browse files
committed
chore: updates
1 parent 574b6bd commit 9f32b3d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

py/torch_tensorrt/dynamo/conversion/impl/quantize.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ def quantize(
4545
max_bound = 448
4646

4747
amax = to_torch(amax, None)
48+
print(f"=========== AMAX: {amax}")
4849
scale = torch.divide(amax, max_bound)
50+
print(f"=========== SCALE: {scale}")
4951
scale = get_trt_tensor(ctx, scale, name + "_scale")
5052
# Add Q node
5153
quantize_layer = ctx.net.add_quantize(input_tensor, scale)

tests/py/dynamo/models/test_modelopt_models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def calibrate_loop(model):
100100
# model has INT8 qdq nodes at this point
101101
output_pyt = model(input_tensor)
102102

103-
with torch.no_grad():
103+
with torchtrt.logging.debug(), torch.no_grad():
104104
with export_torch_mode():
105105
exp_program = torch.export.export(model, (input_tensor,))
106106
trt_model = torchtrt.dynamo.compile(
@@ -111,6 +111,7 @@ def calibrate_loop(model):
111111
cache_built_engines=False,
112112
reuse_cached_engines=False,
113113
truncate_double=True,
114+
debug=True,
114115
)
115116
outputs_trt = trt_model(input_tensor)
116117
assert torch.allclose(output_pyt, outputs_trt, rtol=5e-3, atol=1e-2)

0 commit comments

Comments
 (0)