Skip to content

Conversation

@lanluo-nvidia
Copy link
Collaborator

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant and/or add your own.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project (You can use the linters)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas and hacks
  • I have made corresponding changes to the documentation
  • I have added tests to verify my fix or my feature
  • New and existing unit tests pass locally with my changes
  • I have added the relevant labels to my PR in so that relevant reviewers are notified

@lanluo-nvidia lanluo-nvidia requested a review from cehongwang June 28, 2025 23:49
@lanluo-nvidia lanluo-nvidia self-assigned this Jun 28, 2025
@github-actions github-actions bot added component: api [Python] Issues re: Python API component: runtime component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths labels Jun 28, 2025
@github-actions github-actions bot requested a review from gs-olive June 28, 2025 23:49
@lanluo-nvidia lanluo-nvidia requested review from narendasan and removed request for gs-olive June 29, 2025 16:47
@cehongwang
Copy link
Collaborator

LGTM after Naren's comments

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some changes that do not conform to Python style guidelines:

--- /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/runtime/_MutableTorchTensorRTModule.py	2025-06-30 20:42:14.145185+00:00
+++ /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/runtime/_MutableTorchTensorRTModule.py	2025-06-30 20:42:41.576462+00:00
@@ -475,11 +475,13 @@
            f"Invalid input type {type(inputs)} encountered in the input. "
            + "Allowed input types: {torch_tensorrt.Input, torch.Tensor, list, tuple, dict}"
        )

    def forward(self, *args: Any, **kwargs: Any) -> Any:
-        warnings.warn("Direct calls to {self.__class__}.forward() are currently broken by due to https://github.com/pytorch/pytorch/issues/157183. Either call {self.__class__}(...) directly or use {self.__class__}._forward as a work around")
+        warnings.warn(
+            "Direct calls to {self.__class__}.forward() are currently broken by due to https://github.com/pytorch/pytorch/issues/157183. Either call {self.__class__}(...) directly or use {self.__class__}._forward as a work around"
+        )
        return self._forward(*args, **kwargs)

    def _forward(self, *args: Any, **kwargs: Any) -> Any:
        # Step 1: Check whether the input shape has changed
        kwargs = MutableTorchTensorRTModule._process_kwarg_inputs(kwargs)

@lanluo-nvidia lanluo-nvidia merged commit 21cfb78 into main Jun 30, 2025
70 of 85 checks passed
@lanluo-nvidia lanluo-nvidia deleted the lluo/fix_mutable_forward branch January 10, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed component: api [Python] Issues re: Python API component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants