Skip to content

Conversation

@zdevito
Copy link
Contributor

@zdevito zdevito commented Jun 4, 2019

Stack from ghstack:

Summary: Adds CALL instruction, and function_table to interpreter state.
Interpreter state now has a list of Frame objects to keep track of
active call frames.

Nodes:

  • Re-did how exception wrapping works so that call stacks can be printed
    by the interpreter.
  • Change the order of error reporting so that it is more clear what
    part of a printout is attributable to the interpreter or shape prop
    adding additional context to an error.
  • The first-class functions are only enabled under a guard because
    serialization does not work and more tests need to be added for
    the funnctionality.

Differential Revision: D15618275

Summary: Adds CALL instruction, and function_table to interpreter state.
Interpreter state now has a list of Frame objects to keep track of
active call frames.

Nodes:
* Re-did how exception wrapping works so that call stacks can be printed
  by the interpreter.
* Change the order of error reporting so that it is more clear what
  part of a printout is attributable to the interpreter or shape prop
  adding additional context to an error.
* The first-class functions are only enabled under a guard because
  serialization does not work and more tests need to be added for
  the funnctionality.
@pytorchbot pytorchbot added oncall: jit Add this issue/PR to JIT oncall triage queue module: pybind Related to our Python bindings / interactions with other Python libraries labels Jun 4, 2019
ActiveFrame af(frames.back());
try {
return runInterpreterLoop(stack);
while (true) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just moving the interpreter loop inline here because the exception handling stuff needs to see af.pc. The ops themselves, except for CALL have not meaningfully changed.

Interpreter support for CallFunction/CallMethod

Summary: Adds CALL instruction, and function_table to interpreter state.
Interpreter state now has a list of Frame objects to keep track of
active call frames.

Nodes:
* Re-did how exception wrapping works so that call stacks can be printed
  by the interpreter.
* Change the order of error reporting so that it is more clear what
  part of a printout is attributable to the interpreter or shape prop
  adding additional context to an error.
* The first-class functions are only enabled under a guard because
  serialization does not work and more tests need to be added for
  the funnctionality.

gh-metadata: pytorch pytorch 21325 gh/zdevito/48/head
@ezyang ezyang added facebook and removed facebook labels Jun 5, 2019
@zdevito zdevito requested a review from suo June 6, 2019 19:18
const Code& code =
af.functions[inst.X]->get_executor().getPlanFor(stack).code;
frames.back().pc = af.pc + 1;
enterFrame(code);
Copy link
Member

Choose a reason for hiding this comment

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

I think enterFrame and leaveFrame should set the active frame. That would require af to be a member of the interpreter state though.

namespace torch {
namespace jit {

struct ExceptionMessage {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a comment explaining what purpose this serves? Why cut out the c10 backtarce is not obvious I think.

Interpreter support for CallFunction/CallMethod

Summary: Adds CALL instruction, and function_table to interpreter state.
Interpreter state now has a list of Frame objects to keep track of
active call frames.

Nodes:
* Re-did how exception wrapping works so that call stacks can be printed
  by the interpreter.
* Change the order of error reporting so that it is more clear what
  part of a printout is attributable to the interpreter or shape prop
  adding additional context to an error.
* The first-class functions are only enabled under a guard because
  serialization does not work and more tests need to be added for
  the funnctionality.

gh-metadata: pytorch pytorch 21325 gh/zdevito/48/head
Zachary DeVito and others added 3 commits June 7, 2019 10:28
Interpreter support for CallFunction/CallMethod

Summary: Adds CALL instruction, and function_table to interpreter state.
Interpreter state now has a list of Frame objects to keep track of
active call frames.

Nodes:
* Re-did how exception wrapping works so that call stacks can be printed
  by the interpreter.
* Change the order of error reporting so that it is more clear what
  part of a printout is attributable to the interpreter or shape prop
  adding additional context to an error.
* The first-class functions are only enabled under a guard because
  serialization does not work and more tests need to be added for
  the funnctionality.

gh-metadata: pytorch pytorch 21325 gh/zdevito/48/head
Interpreter support for CallFunction/CallMethod

Summary: Adds CALL instruction, and function_table to interpreter state.
Interpreter state now has a list of Frame objects to keep track of
active call frames.

Nodes:
* Re-did how exception wrapping works so that call stacks can be printed
  by the interpreter.
* Change the order of error reporting so that it is more clear what
  part of a printout is attributable to the interpreter or shape prop
  adding additional context to an error.
* The first-class functions are only enabled under a guard because
  serialization does not work and more tests need to be added for
  the funnctionality.

gh-metadata: pytorch pytorch 21325 gh/zdevito/48/head
Interpreter support for CallFunction/CallMethod

Summary: Adds CALL instruction, and function_table to interpreter state.
Interpreter state now has a list of Frame objects to keep track of
active call frames.

Nodes:
* Re-did how exception wrapping works so that call stacks can be printed
  by the interpreter.
* Change the order of error reporting so that it is more clear what
  part of a printout is attributable to the interpreter or shape prop
  adding additional context to an error.
* The first-class functions are only enabled under a guard because
  serialization does not work and more tests need to be added for
  the funnctionality.

gh-metadata: pytorch pytorch 21325 gh/zdevito/48/head
@zou3519 zou3519 deleted the gh/zdevito/48/head branch June 8, 2019 03:59
@facebook-github-bot
Copy link
Contributor

@zdevito merged this pull request in 5f6afaf.

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

Labels

Merged module: pybind Related to our Python bindings / interactions with other Python libraries oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants