remove allow-untyped-defs from torch/_higher_order_ops/run_const_graph.py#157847
Closed
bobrenjc93 wants to merge 2 commits intogh/bobrenjc93/523/basefrom
Closed
remove allow-untyped-defs from torch/_higher_order_ops/run_const_graph.py#157847bobrenjc93 wants to merge 2 commits intogh/bobrenjc93/523/basefrom
bobrenjc93 wants to merge 2 commits intogh/bobrenjc93/523/basefrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/157847
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 8b998fd with merge base 8134684 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Jul 8, 2025
Closed
Closed
Skylion007
approved these changes
Jul 9, 2025
| @run_const_graph.py_impl(FakeTensorMode) | ||
| def run_const_graph_fake_tensor_mode(mode, graph, args): | ||
| def run_const_graph_fake_tensor_mode( | ||
| mode: FakeTensorMode, graph: torch.fx.GraphModule, args: tuple[object, ...] |
Collaborator
There was a problem hiding this comment.
Most of these tuple[object] should be a typing_extensions.TypeVarTuple
| def run_const_graph_functional(ctx, graph, args): | ||
| def run_const_graph_functional( | ||
| ctx: "BaseFunctionalizeAPI", graph: torch.fx.GraphModule, args: tuple[Any, ...] | ||
| ) -> Any: |
| super().__init__("run_const_graph") | ||
|
|
||
| def __call__(self, graph, args): | ||
| def __call__(self, graph: torch.fx.GraphModule, args: tuple[object, ...]) -> object: |
Collaborator
There was a problem hiding this comment.
I wish graph module had a ParamSpec Generic, is it possible to add one? Or would it violate serialization?
| ) -> object: | ||
| const_gm, weights = graph, args | ||
| p_args = pytree.tree_map(mode.tracer.unwrap_proxy, (graph, args)) | ||
| p_args = pytree.tree_map(mode.tracer.unwrap_proxy, (graph, args)) # type: ignore[union-attr] |
Collaborator
There was a problem hiding this comment.
Shoudl we use typing_utils not_none here?
Collaborator
|
Starting merge as part of PR stack under #157848 |
Contributor
Author
|
oops sorry i just saw comments, cancelling merge now |
zou3519
approved these changes
Jul 10, 2025
Collaborator
|
Starting merge as part of PR stack under #157848 |
pytorchmergebot
pushed a commit
that referenced
this pull request
Jul 12, 2025
…c/modules/linear_relu.py (#157848) Pull Request resolved: #157848 Approved by: https://github.com/Skylion007 ghstack dependencies: #157847
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.
Stack from ghstack (oldest at bottom):