Skip to content

[NNC] Remove VarBinding and go back to Let stmts#42634

Closed
nickgg wants to merge 1 commit intopytorch:masterfrom
nickgg:letStmtAgain
Closed

[NNC] Remove VarBinding and go back to Let stmts#42634
nickgg wants to merge 1 commit intopytorch:masterfrom
nickgg:letStmtAgain

Conversation

@nickgg
Copy link
Copy Markdown
Contributor

@nickgg nickgg commented Aug 5, 2020

Awhile back when commonizing the Let and LetStmt nodes, I ended up removing both and adding a separate VarBinding section the Block. At the time I couldn't find a counter example, but I found it today: Local Vars and Allocations dependencies may go in either direction and so we need to support interleaving of those statements.

So, I've removed all the VarBinding logic and reimplemented Let statements. @ZolotukhinM I think you get to say "I told you so". No new tests, existing tests should cover this.

@nickgg nickgg requested a review from apaszke as a code owner August 5, 2020 21:29
@nickgg nickgg requested review from ZolotukhinM and zheng-xq August 5, 2020 21:29
@nickgg nickgg requested a review from bertmaher August 5, 2020 21:35
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Aug 5, 2020
Copy link
Copy Markdown

@ZolotukhinM ZolotukhinM left a comment

Choose a reason for hiding this comment

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

Looks good to me! Might be worth checking if others are ok with that change too though.

Comment thread torch/csrc/jit/tensorexpr/eval.h Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should we var_by_scope_.erase(scope_) as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Probably, for correctness. Doesn't really matter since we will never recur back here in the same invocation, but why not.

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@nickgg has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@dr-ci
Copy link
Copy Markdown

dr-ci Bot commented Aug 6, 2020

💊 CI failures summary and remediations

As of commit 8f10233 (more details on the Dr. CI page):


  • 1/1 failures possibly* introduced in this PR
    • 1/1 non-CircleCI failure(s)

ci.pytorch.org: 1 failed


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 8 times.

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@nickgg has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@nickgg merged this pull request in 944ac13.

laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
Awhile back when commonizing the Let and LetStmt nodes, I ended up removing both and adding a separate VarBinding section the Block. At the time I couldn't find a counter example, but I found it today: Local Vars and Allocations dependencies may go in either direction and so we need to support interleaving of those statements.

So, I've removed all the VarBinding logic and reimplemented Let statements. ZolotukhinM I think you get to say "I told you so". No new tests, existing tests should cover this.

Pull Request resolved: pytorch#42634

Reviewed By: mruberry

Differential Revision: D22969771

Pulled By: nickgg

fbshipit-source-id: a46c5193357902d0f59bf30ab103fe123b1503f1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants