Skip to content

[fx] Move _Namespace to C++#170962

Open
jansel wants to merge 10 commits intogh/jansel/587/basefrom
gh/jansel/587/head
Open

[fx] Move _Namespace to C++#170962
jansel wants to merge 10 commits intogh/jansel/587/basefrom
gh/jansel/587/head

Conversation

@jansel
Copy link
Copy Markdown
Contributor

@jansel jansel commented Dec 20, 2025

[ghstack-poisoned]
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Dec 20, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/170962

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure, 1 Unrelated Failure

As of commit e639f5e with merge base e81980e (image):

NEW FAILURE - The following job has failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot Bot added the release notes: fx release notes category label Dec 20, 2025
jansel added a commit that referenced this pull request Dec 20, 2025
ghstack-source-id: 0ebeac4
Pull-Request: #170962
@jansel jansel marked this pull request as draft December 20, 2025 21:10
[ghstack-poisoned]
jansel added a commit that referenced this pull request Dec 20, 2025
ghstack-source-id: 5247aeb
Pull-Request: #170962
[ghstack-poisoned]
[ghstack-poisoned]
@jansel jansel marked this pull request as ready for review December 24, 2025 19:25
[ghstack-poisoned]
[ghstack-poisoned]
@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Rebased gh/jansel/588/orig onto refs/remotes/origin/viable/strict because #170973 was rebased, please pull locally before adding more changes (for example, via ghstack checkout https://github.com/pytorch/pytorch/pull/170962)

@jansel
Copy link
Copy Markdown
Contributor Author

jansel commented Dec 25, 2025

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Dec 25, 2025
@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

pytorchmergebot added a commit that referenced this pull request Dec 26, 2025
This reverts commit a50d65a.

Reverted #170962 on behalf of https://github.com/clee2000 due to sorry but I think this broke a test on inductor test/inductor/test_max_autotune.py::TestMaxAutotuneAsyncPipelined::test_empty_conv_input_search_space_EXHAUSTIVE_kernel_size_1 [GH job link](https://github.com/pytorch/pytorch/actions/runs/20510247600/job/58931365661) [HUD commit link](https://hud.pytorch.org/pytorch/pytorch/commit/a50d65ad2f8c39a19be6ee3d7e0b37b0f3f47189)? it might be a landrace since I see that it did succeed on this PR. Also its failing some tests internally D89800849 ([comment](#170946 (comment)))
SergeyTyshkevich pushed a commit to SergeyTyshkevich/chart2 that referenced this pull request Jan 19, 2026
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #170973

pytorchmergebot pushed a commit that referenced this pull request Feb 26, 2026
Cumulative Changes (PR 170946 → PR 170973)

  | Benchmark                             | PR 170946 | PR 170973 | Delta |
  |---------------------------------------|-----------|-----------|-------|
  | add_loop_eager                        | 3,308M    | 3,206M    | -3.1% |
  | aotdispatcher_partitioner_cpu2        | 1,944M    | 1,865M    | -4.1% |
  | aotdispatcher_partitioner_cpu         | 8,340M    | 8,062M    | -3.3% |
  | sum_floordiv_regression               | 3,700M    | 3,591M    | -3.0% |
  | aotdispatcher_training_nosubclass_cpu | 3,242M    | 3,168M    | -2.3% |
  | update_hint_regression                | 1,674M    | 1,641M    | -2.0% |
  | symint_sum_loop                       | 4,682M    | 4,590M    | -2.0% |
  | add_loop_inductor_gpu                 | 26,418M   | 26,031M   | -1.5% |
  | basic_NestedModule_eager              | 6,171M    | 6,084M    | -1.4% |
  | add_loop_inductor                     | 29,736M   | 29,342M   | -1.3% |

Pull Request resolved: #170973
Approved by: https://github.com/oulgen
ghstack dependencies: #170946, #170962
@jansel
Copy link
Copy Markdown
Contributor Author

jansel commented Mar 7, 2026

@pytorchbot revert -m "reverted in fbcode"

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Mar 7, 2026

❌ 🤖 pytorchbot command failed:

@pytorchbot revert: error: the following arguments are required: -c/--classification

usage: @pytorchbot revert -m MESSAGE -c
                          {nosignal,ignoredsignal,landrace,weird,ghfirst,autorevert}

Try @pytorchbot --help for more info.

@jansel
Copy link
Copy Markdown
Contributor Author

jansel commented Mar 7, 2026

@pytorchbot revert -m "reverted in fbcode" -c nosignal

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Reverting PR 170962 failed

Reason: Command git -C /home/runner/work/pytorch/pytorch revert --no-edit 5c68844a2a8d9eea64e58976dd6415fb60dca3ea returned non-zero exit code 1

Auto-merging build_variables.bzl
Auto-merging torch/_C/__init__.pyi.in
Auto-merging torch/csrc/Module.cpp
CONFLICT (modify/delete): torch/csrc/fx/graph.cpp deleted in parent of 5c68844a2a8 ([fx] Move _Namespace to C++ (#170962)) and modified in HEAD.  Version HEAD of torch/csrc/fx/graph.cpp left in tree.
Auto-merging torch/fx/graph.py
error: could not revert 5c68844a2a8... [fx] Move _Namespace to C++ (#170962)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git revert --continue".
hint: You can instead skip this commit with "git revert --skip".
hint: To abort and get back to the state before "git revert",
hint: run "git revert --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Details for Dev Infra team Raised by workflow job

pytorchmergebot pushed a commit that referenced this pull request Mar 9, 2026
…ame (#176515)" (#176948)

## Summary
Reverts #176515.

This is a prerequisite for reverting the full `[fx] Move _Namespace to C++` series (#170962), which was reverted internally due to S627920 but the revert was never exported to GitHub.

The quadratic fix patches `torch/csrc/fx/graph.cpp` which was introduced by #170962. This revert must land first so that #170962 can be cleanly reverted afterwards.

## Test plan
CI — this revert removes a bugfix from C++ code that will itself be reverted in a follow-up PR.
Pull Request resolved: #176948
Approved by: https://github.com/izaitsevfb, https://github.com/huydhn
@wdvr
Copy link
Copy Markdown
Contributor

wdvr commented Mar 9, 2026

@pytorchbot revert -m "reverted in fbcode" -c nosignal

retrying revert after #176948 landed

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

pytorchmergebot added a commit that referenced this pull request Mar 10, 2026
This reverts commit 5c68844.

Reverted #170962 on behalf of https://github.com/wdvr due to reverted in fbcode ([comment](#170962 (comment)))
@pytorchmergebot
Copy link
Copy Markdown
Collaborator

@jansel your PR has been successfully reverted.

pytorchmergebot pushed a commit that referenced this pull request Mar 11, 2026
## Summary

Reverts #170946

This reverts commit fa27d4f.

The two stacked PRs (#170962 and #170973) have already been reverted on main:
- `0a06050b` Revert "[fx] Move _FindNodesLookupTable and _node_list to C++ (#170973)"
- `2ee3377b` Revert "[fx] Move _Namespace to C++ (#170962)"
- `fb60dd58` Revert "[fx] Fix quadratic name generation in _NamespaceBase.create_name (#176515)"

The only merge conflict was in `torch/fx/node.py` due 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

Pull Request resolved: #177047
Approved by: https://github.com/huydhn
sandy-gags pushed a commit to sandy-gags/pytorch that referenced this pull request Mar 12, 2026
EmanueleCoradin pushed a commit to EmanueleCoradin/pytorch that referenced this pull request Mar 30, 2026
EmanueleCoradin pushed a commit to EmanueleCoradin/pytorch that referenced this pull request Mar 30, 2026
Cumulative Changes (PR 170946 → PR 170973)

  | Benchmark                             | PR 170946 | PR 170973 | Delta |
  |---------------------------------------|-----------|-----------|-------|
  | add_loop_eager                        | 3,308M    | 3,206M    | -3.1% |
  | aotdispatcher_partitioner_cpu2        | 1,944M    | 1,865M    | -4.1% |
  | aotdispatcher_partitioner_cpu         | 8,340M    | 8,062M    | -3.3% |
  | sum_floordiv_regression               | 3,700M    | 3,591M    | -3.0% |
  | aotdispatcher_training_nosubclass_cpu | 3,242M    | 3,168M    | -2.3% |
  | update_hint_regression                | 1,674M    | 1,641M    | -2.0% |
  | symint_sum_loop                       | 4,682M    | 4,590M    | -2.0% |
  | add_loop_inductor_gpu                 | 26,418M   | 26,031M   | -1.5% |
  | basic_NestedModule_eager              | 6,171M    | 6,084M    | -1.4% |
  | add_loop_inductor                     | 29,736M   | 29,342M   | -1.3% |

Pull Request resolved: pytorch#170973
Approved by: https://github.com/oulgen
ghstack dependencies: pytorch#170946, pytorch#170962
EmanueleCoradin pushed a commit to EmanueleCoradin/pytorch that referenced this pull request Mar 30, 2026
…ame (pytorch#176515)" (pytorch#176948)

## Summary
Reverts pytorch#176515.

This is a prerequisite for reverting the full `[fx] Move _Namespace to C++` series (pytorch#170962), which was reverted internally due to S627920 but the revert was never exported to GitHub.

The quadratic fix patches `torch/csrc/fx/graph.cpp` which was introduced by pytorch#170962. This revert must land first so that pytorch#170962 can be cleanly reverted afterwards.

## Test plan
CI — this revert removes a bugfix from C++ code that will itself be reverted in a follow-up PR.
Pull Request resolved: pytorch#176948
Approved by: https://github.com/izaitsevfb, https://github.com/huydhn
EmanueleCoradin pushed a commit to EmanueleCoradin/pytorch that referenced this pull request Mar 30, 2026
This reverts commit 5c68844.

Reverted pytorch#170962 on behalf of https://github.com/wdvr due to reverted in fbcode ([comment](pytorch#170962 (comment)))
EmanueleCoradin pushed a commit to EmanueleCoradin/pytorch that referenced this pull request Mar 30, 2026
…ytorch#177047)

## Summary

Reverts pytorch#170946

This reverts commit fa27d4f.

The two stacked PRs (pytorch#170962 and pytorch#170973) have already been reverted on main:
- `0a06050b` Revert "[fx] Move _FindNodesLookupTable and _node_list to C++ (pytorch#170973)"
- `2ee3377b` Revert "[fx] Move _Namespace to C++ (pytorch#170962)"
- `fb60dd58` Revert "[fx] Fix quadratic name generation in _NamespaceBase.create_name (pytorch#176515)"

The only merge conflict was in `torch/fx/node.py` due to a type annotation modernization PR (pytorch#176308, `Optional[X]` → `X | None`). The conflict was resolved by keeping the modern annotation style while restoring the original Python implementation.

## Test plan
CI

Pull Request resolved: pytorch#177047
Approved by: https://github.com/huydhn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-td Do not run TD on this PR ciflow/trunk Trigger trunk jobs on your pull request fx Merged release notes: fx release notes category Reverted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants