-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Expose ExecutionPlan in prep for function calls #21273
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
Summary: This reorganizes GraphExecutor into a stage that looks up the execution plan getPlanFor, and a stage that runs the plan. This separation is necessary for first-class functions since the interpreter will call getPlanFor to look up the Code for the function it will be calling rather than recursively calling run on the graph executor. Test Plan: test_jit.py
Expose ExecutionPlan in prep for function calls Summary: This reorganizes GraphExecutor into a stage that looks up the execution plan getPlanFor, and a stage that runs the plan. This separation is necessary for first-class functions since the interpreter will call getPlanFor to look up the Code for the function it will be calling rather than recursively calling run on the graph executor. Test Plan: test_jit.py gh-metadata: pytorch pytorch 21273 gh/zdevito/47/head
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.
![]()
|
|
||
| // entry point where execution begins | ||
| virtual void run(Stack& stack) = 0; | ||
| void run(Stack& stack); |
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.
i think we might need virtual GraphExecutorImpl::run eventually, but I guess, we can make it virtual when we need it
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.
It would be possible. Keep in mind that run will only get called on entry from C++ into TorchScript. Function calls go directly through the getPlan pathway. So anything that has to happen for every function call will need to be expressed as part of getPlan.
Expose ExecutionPlan in prep for function calls Summary: This reorganizes GraphExecutor into a stage that looks up the execution plan getPlanFor, and a stage that runs the plan. This separation is necessary for first-class functions since the interpreter will call getPlanFor to look up the Code for the function it will be calling rather than recursively calling run on the graph executor. Test Plan: test_jit.py gh-metadata: pytorch pytorch 21273 gh/zdevito/47/head
Expose ExecutionPlan in prep for function calls Summary: This reorganizes GraphExecutor into a stage that looks up the execution plan getPlanFor, and a stage that runs the plan. This separation is necessary for first-class functions since the interpreter will call getPlanFor to look up the Code for the function it will be calling rather than recursively calling run on the graph executor. Test Plan: test_jit.py gh-metadata: pytorch pytorch 21273 gh/zdevito/47/head
Expose ExecutionPlan in prep for function calls Summary: This reorganizes GraphExecutor into a stage that looks up the execution plan getPlanFor, and a stage that runs the plan. This separation is necessary for first-class functions since the interpreter will call getPlanFor to look up the Code for the function it will be calling rather than recursively calling run on the graph executor. Test Plan: test_jit.py gh-metadata: pytorch pytorch 21273 gh/zdevito/47/head
Expose ExecutionPlan in prep for function calls Summary: This reorganizes GraphExecutor into a stage that looks up the execution plan getPlanFor, and a stage that runs the plan. This separation is necessary for first-class functions since the interpreter will call getPlanFor to look up the Code for the function it will be calling rather than recursively calling run on the graph executor. Test Plan: test_jit.py gh-metadata: pytorch pytorch 21273 gh/zdevito/47/head
Stack from ghstack:
Summary: This reorganizes GraphExecutor into a stage that looks up
the execution plan getPlanFor, and a stage that runs the plan. This
separation is necessary for first-class functions since the interpreter
will call getPlanFor to look up the Code for the function it will be
calling rather than recursively calling run on the graph executor.
Test Plan: test_jit.py
Differential Revision: D15600067