8000 [FX] Fix PyTree unpacking carrying forward type annotations by jamesr66a · Pull Request #81906 · pytorch/pytorch · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[FX] Fix PyTree unpacking carrying forward type annotations #81906

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

jamesr66a
Copy link
Collaborator
@jamesr66a jamesr66a commented Jul 21, 2022

@facebook-github-bot
Copy link
Contributor
facebook-github-bot commented Jul 21, 2022

🔗 Helpful links

❌ 1 New Failures

As of commit 634af35 (more details on the Dr. CI page):

Expand to see more
  • 1/1 failures introduced in this PR

🕵️ 1 new failure recognized by patterns

The following CI failures do not appear to be due to upstream breakages

See GitHub Actions build pull / linux-bionic-py3.7-clang9 / test (dynamo, 2, 2, linux.2xlarge) (1/1)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

2022-07-21T21:43:39.5162842Z RuntimeError: test_nn failed!
2022-07-21T21:43:36.9434048Z Generated XML report: test-reports/python-unittest/test_nn/TEST-TestModuleGlobalHooks-20220721213552.xml
2022-07-21T21:43:37.5399857Z Generated XML report: test-reports/python-unittest/test_nn/TEST-TestNN-20220721213552.xml
2022-07-21T21:43:37.6114516Z Generated XML report: test-reports/python-unittest/test_nn/TEST-TestNNDeviceTypeCPU-20220721213552.xml
2022-07-21T21:43:37.6136728Z Generated XML report: test-reports/python-unittest/test_nn/TEST-TestNNInit-20220721213552.xml
2022-07-21T21:43:37.6142636Z Generated XML report: test-reports/python-unittest/test_nn/TEST-TestStateDictHooks-20220721213552.xml
2022-07-21T21:43:39.5158412Z Traceback (most recent call last):
2022-07-21T21:43:39.5158835Z   File "test/run_test.py", line 940, in <module>
2022-07-21T21:43:39.5160843Z     main()
2022-07-21T21:43:39.5161182Z   File "test/run_test.py", line 918, in main
2022-07-21T21:43:39.5162450Z     raise RuntimeError(err_message)
2022-07-21T21:43:39.5162842Z RuntimeError: test_nn failed!
2022-07-21T21:43:39.7555904Z 
2022-07-21T21:43:39.7556248Z real	43m37.030s
2022-07-21T21:43:39.7556514Z user	207m31.202s
2022-07-21T21:43:39.7556684Z sys	12m10.391s
2022-07-21T21:43:39.7591445Z ##[error]Process completed with exit code 1.
2022-07-21T21:43:39.7653621Z Prepare all required actions
2022-07-21T21:43:39.7653918Z Getting action download info
2022-07-21T21:43:39.9182542Z ##[group]Run ./.github/actions/get-workflow-job-id
2022-07-21T21:43:39.9182761Z with:
2022-07-21T21:43:39.9183090Z   github-token: ***

This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

jamesr66a pushed a commit that referenced this pull request Jul 21, 2022
@jamesr66a jamesr66a requested a review from Chillee July 21, 2022 20:20
Copy link
Collaborator
@Chillee Chillee left a comment

Choose a reason for hiding this comment

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

LGTM.

But I wonder whether we should rethink our pytree integration with FX. Like, our original integration had (essentially) 2 requirements.

  1. The FX module was still runnable as-is with the same inputs as before.
  2. The FX module is retraceable with fx.symbolic_trace.

From my understanding, most of the users of pytrees are now going through make_fx - can we drop some of the previous requirements and simplify this code?

function_definition = super().gen_fn_def(function_args[:], maybe_return_annotation)
if len(free_vars) > 0: # pytree has placeholders in it
function_definition += f"""
{', '.join(free_vars)}, = fx_pytree.tree_flatten_spec([{', '.join(function_args)}], self._in_spec)"""
{', '.join(var.name for var in free_vars)}, = fx_pytree.tree_flatten_spec\
Copy link
Collaborator
8000

Choose a reason for hiding this comment

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

why trailing comma before = ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That forces it to always be a tuple even if there's 1 element

@jamesr66a
Copy link
Collaborator Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a merge job. Check the current status here

@pytorchmergebot
Copy link
Collaborator

Merge failed due to Refusing to merge as mandatory check(s) pull failed for rule superuser
Raised by https://github.com/pytorch/pytorch/actions/runs/2716282268

@jamesr66a
Copy link
Collaborator Author

@pytorchbot merge -f

@pytorch pytorch deleted a comment from pytorch-bot bot Jul 22, 2022
@pytorch pytorch deleted a comment from pytorch-bot bot Jul 22, 2022
@jamesr66a
Copy link
Collaborator Author

@pytorchbot merge -f "flaky test"

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a merge job. Check the current status here

@github-actions
Copy link
Contributor

Hey @jamesr66a.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

@jeanschmidt
Copy link
Contributor

@pytorchbot revert -m "breaking internal builds" -c "ghfirst"

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a revert job. Check the current status here

@pytorchmergebot
Copy link
Collaborator

@jamesr66a your PR has been successfully reverted.

pytorchmergebot added a commit that referenced this pull request Jul 22, 2022
@facebook-github-bot facebook-github-bot deleted the gh/jamesr66a/430/head branch July 25, 2022 14:18
@voznesenskym
Copy link
Collaborator

@jamesr66a I saw this got reverted, but we still need this fix. @jeanschmidt how is it breaking internal builds?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0