Skip to content

fix: Fix constant folding failure due to modelopt #3565

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

Merged
merged 2 commits into from
Jun 11, 2025
Merged
Changes from 1 commit
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
8 changes: 7 additions & 1 deletion py/torch_tensorrt/dynamo/lowering/passes/constant_folding.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:

# TODO: Update this function when quantization is added
def is_impure(self, node: torch.fx.node.Node) -> bool:
if node.target in (torch.ops.tensorrt.quantize_op.default,):
quantization_ops = {}
try:
assert torch.ops.tensorrt.quantize_op.default
quantization_ops.add(torch.ops.tensorrt.quantize_op.default)
except Exception as e:
pass
if quantization_ops and node.target in quantization_ops:
return True
return False
Loading