This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Fix for duplicate subgraph inputs/outputs #16131
Merged
+81
−18
Merged
Changes from 30 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
b010ffa
fix for duplicate inputs
a6ad15a
fixed error
00499c9
fixed whitespace
87b665e
Remove duplicate outputs from subgraphs
8045bab
changed subgraph to create map of outputs
82df19d
added static_cast
77f3f31
changed map<int,v> to vector
a4b42db
sanity fix
c6077dd
sanity2
3631bc7
updated backends with new connectSubgraphOutputs API
fdd477b
fixed map creation logic
7a210d6
added updates for reattach function
samskalicky a610f1c
creating node only if it is not an input to subgraph
4db8eec
creating object based on var_name only
be9c885
updating ConnectSubgraphOutputs for mkldnn_elemwisemul_post_quantize_…
41c5e4c
add debug prints to debug error in CI
samskalicky fde8a05
remove prints
samskalicky acc1e73
added prints to debug in the CI
samskalicky 10652c8
Merge branch 'subgraph_fix' of https://github.com/samskalicky/incubat…
samskalicky b49b431
Merge branch 'master' into subgraph_fix
mseth10 cd4f4d7
Merge branch 'master' of https://github.com/apache/incubator-mxnet in…
6a20b0e
Merge branch 'master' of https://github.com/apache/incubator-mxnet in…
324f29b
revert changes
e0abc55
reverted changes
93a8f35
deduplicaated inputs to subgraph
d155801
deduplicated subgraph inputs
6deea77
simplified inputs
270a8fc
cleaned up
165bbd1
deduplicate outputs
5572d4c
cleand up
7672a5f
added deduplication to subgraph node outputs
e249d71
fixed prev compare
4a49810
fixed issue with inputs and added test
af9f177
fixd whitespace, removed prints
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
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.
There is an alternative implementation that does not need t track the actual unique inputs separately.
A counter would allow us to correctly modify orig_entries into unique_entries.
This keeps the function signature unchanged and minimizes changes elsewhere.
It is already working in a private build. I add it here for consideration if desired
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.
Thanks for the suggestion @HahTK, but we cant modify
orig_entries
since we need it unmodified for ReattachGraphInputs:https://github.com/apache/incubator-mxnet/blob/e249d71ad4621afcba7f0f3af77095a3f9a4bc83/src/operator/subgraph/build_subgraph.cc#L578
this is used to reject a subgraph from the reviewSubgraph API:
https://github.com/apache/incubator-mxnet/blob/e249d71ad4621afcba7f0f3af77095a3f9a4bc83/src/operator/subgraph/build_subgraph.cc#L657
the example you provided doesnt work in the latest version of MXNet where you can reject a subgraph by returning nullptr from CreateSubgraphNode here: https://github.com/apache/incubator-mxnet/blob/e249d71ad4621afcba7f0f3af77095a3f9a4bc83/src/operator/subgraph/build_subgraph.cc#L630-L633
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.
The proposed change was tested on 1.5.1 and it seems like newer versions of MXNet have new features that needs orig_entries to be preserved. So acknowledged !