Skip to content

Conversation

@eellison
Copy link
Contributor

  • remove loop node that is guaranteed not to execute

  • remove extra loop outputs that are no longer needed

  • if we are inlining an if node, only run constant propagation on the block that will execute

  • remove the recurse argument since we only expose the Graph Constant Propagation and it's not used

This also includes a few extra hooks to python_ir that I think make it a little be easier to test graph conditions from python.

@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Jan 22, 2019
// remove extra outputs from the node
void removeExtraLoopOutputs(Node* node) {
auto loop_body = node->blocks().at(0);
auto loop_input_offset = 2; // offset of loop carried deps in input list
Copy link
Contributor

Choose a reason for hiding this comment

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

pool this and the other one into a static const

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can change it - fwiw I was following the style of similar code that exists in dead_code_elimination & uses auto

}
}

std::vector<Node*> findAllNodes(Block* block, Symbol kind) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think these are really necessary to add if it's just for the test, this functionality can be done per-case via the Python bindings for Graph and Node

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean per-case via the bindings for Graph and Node?

These will also be used in other tests, and have been a common pattern I've needed & couldn't easily express so I used expect files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I don't add it as a method to Graph / Node then you can't chain method calls, so something like the following becomes difficult to write:
self.assertTrue(graph.findNode("prim::Loop").outputsSize() == 2)

Copy link
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.

@eellison is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
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.

@eellison is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

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

Labels

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