nomnigraph - Improvements to subgraph matching APIs#11418
Closed
duc0 wants to merge 1 commit intopytorch:masterfrom
Closed
nomnigraph - Improvements to subgraph matching APIs#11418duc0 wants to merge 1 commit intopytorch:masterfrom
duc0 wants to merge 1 commit intopytorch:masterfrom
Conversation
6cf9697 to
993b541
Compare
993b541 to
171ac69
Compare
171ac69 to
c0e35f9
Compare
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
c0e35f9 to
7b49c51
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Differential Revision: D9732565