feat: support in-place plugins - #4279
Open
bowang007 wants to merge 3 commits into
Open
Conversation
narendasan
reviewed
May 20, 2026
bowang007
force-pushed
the
inplace_plugin
branch
from
July 14, 2026 09:12
526e555 to
9f05cee
Compare
Convert in-place QDP plugins by registering a converter on the auto_functionalized(_v2) higher-order wrapper (gated by a capability_validator to the ops that have a plugin) instead of reversing functionalization in a lowering pass. The graph stays functional and scoping is per-node. - Add _auto_functionalized_converter: wrapper converter that reconstructs the inner op's args, delegates to the inner op's converter, and returns the [*returns, *bases] tuple with a faithful base->return alias map; plus a scoped no-op converter for the aliased write-back copy_. - Add qdp_inplace_metadata pass: metadata-only (no graph reversal) so pre-conversion symbolic-shape extraction handles the direct-return case. - Remove unfunctionalize_qdp_inplace: its global copy_ deletion corrupted mixed graphs (a non-plugin in-place op's write-back was dropped). All in-place tests pass (5/5); full plugin+kernels suite green (57 passed).
bowang007
force-pushed
the
inplace_plugin
branch
from
July 16, 2026 14:10
2241ebf to
0d2429e
Compare
narendasan
reviewed
Jul 16, 2026
narendasan
reviewed
Jul 20, 2026
| try: | ||
| from torch._subclasses.fake_tensor import FakeTensorMode | ||
|
|
||
| with FakeTensorMode(): |
Collaborator
There was a problem hiding this comment.
Do you know if FakeTensorUpdator would work here?
Collaborator
Author
There was a problem hiding this comment.
@narendasan To be honest, FakeTensorUpdater is used to propagate and update the meta values but here we want to find the aliased map, we could use it but we still need to find the aliasing here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
End-to-end support for in-place QDP plugins in torch-tensorrt
Fixes #4240
Type of change
Please delete options that are not relevant and/or add your own.
Checklist: