Revert "[fx] Move the rest of torch.fx.Node to C++ (#170946)"#177047
Revert "[fx] Move the rest of torch.fx.Node to C++ (#170946)"#177047wdvr wants to merge 1 commit intopytorch:mainfrom
Conversation
This reverts commit fa27d4f.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/177047
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Unrelated FailureAs of commit 7dc74f6 with merge base 52dd8fe ( NEW FAILURE - The following job has failed:
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot merge -f 'This is a revert' |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
|
@pytorchbot revert -m "Reverted automatically by pytorch's autorevert, to avoid this behaviour add the tag autorevert: disable" -c autorevert This PR is attributed to have caused regression in: Please investigate and fix the issues. |
|
Claude finished @pytorch-auto-revert[bot]'s task in 1m 24s —— View job Diagnosis of Revert Cause
Root CauseThe revert was caused by RUFF UP045 lint violations in When this revert PR (#177047) restored the original Python implementation of The PR description noted the merge conflict was resolved keeping the modern style, but a few
Is this a legitimate revert?Yes, the revert is legitimate. Lint failures on trunk block the CI pipeline for all contributors. The fix is trivial, but since this was already merged, a revert is the standard procedure. How to fixThe fix is straightforward — replace the remaining # Line 597-598: format_node params
- placeholder_names: Optional[list[str]] = None,
- maybe_return_typename: Optional[list[str]] = None,
+ placeholder_names: list[str] | None = None,
+ maybe_return_typename: list[str] | None = None,
# Line 601: format_node return type
- ) -> Optional[str]:
+ ) -> str | None:
# Line 695: replace_all_uses_with param
- delete_user_cb: Optional[Callable[["Node"], bool]] = None,
+ delete_user_cb: Callable[["Node"], bool] | None = None,
# Line 789-790: normalized_arguments params
- arg_types: Optional[tuple[Any]] = None,
- kwarg_types: Optional[dict[str, Any]] = None,
+ arg_types: tuple[Any] | None = None,
+ kwarg_types: dict[str, Any] | None = None,
# Line 792: normalized_arguments return type
- ) -> Optional[ArgsKwargsPair]:
+ ) -> ArgsKwargsPair | None:The author should apply these annotation fixes and re-land the revert. Running |
|
@pytorchbot successfully started a revert job. Check the current status here. |
This reverts commit 68bcdcb. Reverted #177047 on behalf of https://github.com/pytorch-auto-revert due to Reverted automatically by pytorch's autorevert, to avoid this behaviour add the tag autorevert: disable ([comment](#177047 (comment)))
|
@wdvr your PR has been successfully reverted. |
|
@pytorchmergebot rebase -b main |
|
@pytorchbot started a rebase job onto refs/remotes/origin/main. Check the current status here |
|
Rebase failed due to Raised by https://github.com/pytorch/pytorch/actions/runs/22968090201 |
…170946)" (pytorch#177047)" This reverts commit 4bc9d7f.
Summary
Reverts #170946
This reverts commit fa27d4f.
The two stacked PRs (#170962 and #170973) have already been reverted on main:
0a06050bRevert "[fx] Move _FindNodesLookupTable and _node_list to C++ ([fx] Move _FindNodesLookupTable and _node_list to C++ #170973)"2ee3377bRevert "[fx] Move _Namespace to C++ ([fx] Move _Namespace to C++ #170962)"fb60dd58Revert "[fx] Fix quadratic name generation in _NamespaceBase.create_name ([fx] Fix quadratic name generation in _NamespaceBase.create_name #176515)"The only merge conflict was in
torch/fx/node.pydue to a type annotation modernization PR (#176308,Optional[X]→X | None). The conflict was resolved by keeping the modern annotation style while restoring the original Python implementation.Test plan
CI
cc @albanD @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo