-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[JIT] Add Exit Transform / Convert To SSA to docs #24114
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for writing it up! It's really important to have such documents, it greatly helps to understand how stuff works.
Please find some comments inline and please fix failing tests before landing!
torch/csrc/jit/docs/OVERVIEW.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is graph loops? :)
torch/csrc/jit/docs/OVERVIEW.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: considered
torch/csrc/jit/docs/OVERVIEW.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a high level overview of why we're doing this (in contrast to "what")? It might be not obvious why this all is necessary and how it relates to classic SSA. For instance, in the conventional definition of SSA the central part is phi-nodes. We don't have them because we work only with structured control flow, but we never mentioned that here. But that's what explains all of what's happening here: we're trying to represent constructs with breaks/continues/returns in a form of well-structured CFG that only have loops with no early exits and ifs.
Another thing that might be confusing is the load/store part - we're not loading or storing anything there, it's just a trick we use to figure out input/output values of a block, and I think it's also worth mentioning somewhere.
torch/csrc/jit/docs/OVERVIEW.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: "Once we hit an Exit Node" sounds a bit strange to me as we don't execute anything here. Maybe rephrase it a bit (like "if a block has an exit node, further instructions will never be executed").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for writing this up! It looks great! I added a few comments
torch/csrc/jit/docs/OVERVIEW.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems to be a little bit too dry. How are we tracking in-scope values? Are we doing something similar to what we used to do in compiler.cpp before? Ideally, we could use a simple example that shows a graph with loads and stores and then the one w/o them right before we remove prim::LoopContinuations.
torch/csrc/jit/docs/OVERVIEW.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
continue_loop is inserted at the end of every inner block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eellison has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: Pull Request resolved: pytorch#24114 Differential Revision: D19780828 Pulled By: eellison fbshipit-source-id: d481ad886b2ad6349a1646672e507336d45759fb
No description provided.