Skip to content

nomnigraph - Improvements to subgraph matching APIs#11418

Closed
duc0 wants to merge 1 commit intopytorch:masterfrom
duc0:export-D9732565
Closed

nomnigraph - Improvements to subgraph matching APIs#11418
duc0 wants to merge 1 commit intopytorch:masterfrom
duc0:export-D9732565

Conversation

@duc0
Copy link
Contributor

@duc0 duc0 commented Sep 8, 2018

Summary:
Several improvements that aim to make the APIs more straightforward to use

  • Get rid of helper methods subgraph and nonTerminal . Users now should create a NNMatchGraph directly via graph's createNode and createEdge API

  • Get rid of operatorSubgraph helper method

  • invertGraphTraversal flag applies to both the match graph and the scanned graph. This allows user to create match graph in the same direction as the scanned graph, thus reduce confusion.

  • additional parameters of matchNode (count, includeInSubgraph, nonTerminal) are removed from the constructors and moved into setter methods. (We no longer enforce that MatchNode is immutable but this helps improve code clarity).

  • Tests are updated to reflect the changes

Follow up changes:

  • Possibly clean up the tests further. This change aims to minimally modify the unit tests.
  • Help a validity check that enforce the current limitation of the match graph (single source node), and throws if the match graph does not satisfy the criteria.
  • Have the single source node be detected automatically and callers just need to pass in the matchGraph instead of the source node reference.

Differential Revision: D9732565

Summary:
Pull Request resolved: pytorch#11418

Several improvements that aim to make the APIs more straightforward to use

- Get rid of helper methods subgraph and nonTerminal . Users now should create a NNMatchGraph directly via graph's createNode and createEdge API

- Get rid of operatorSubgraph helper method

- invertGraphTraversal flag applies to both the match graph and the scanned graph. This allows user to create match graph in the same direction as the scanned graph, thus reduce confusion.

- additional parameters of matchNode (count, includeInSubgraph, nonTerminal) are removed from the constructors and moved into setter methods. (We no longer enforce that MatchNode is immutable but this helps improve code clarity).

- Tests are updated to reflect the changes

Follow up changes:
- Possibly clean up the tests further. This change aims to minimally modify the unit tests.
- Help a validity check that enforce the current limitation of the match graph (single source node), and throws if the match graph does not satisfy the criteria.
- Have the single source node be detected automatically and callers just need to pass in the matchGraph instead of the source node reference.

Differential Revision: D9732565

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants