- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi. I'm seeing exceptions thrown when using the subgraph replacement.
In "repalcement.py" you have a function
def find_and_replace_pattern(self, graph: nx.MultiDiGraph): for match in find_pattern_matches(graph, **self.pattern()): match = {v: k for k, v in match.items()} for k in match: match= Node(graph, match self.replace_sub_graph(graph, match))
If this finds a subgraph to match and replace, then the "replace_sub_graph(...)" method in my extension derived from FrontReplacementSubgraph is called.
If this calls "replace_node(..)" in graph.py, then that removes a node from the graph. This is modifying the graph while the "find_and_replace_pattern()" is iterating over it - and causes an exception when the iterator tries to find the node that has already been removed in the graph.
I have worked around this with changes to replace_node(...) in graph.py - not calling graph.remove_node() but simply removing the outgoing edges from the node that is being replaced. I suspect this is not how you intend the code to work, but it is letting me proceed.
I will attempt to create a customer agnostic example that I can share. Note that the behaviour of the script is non-deterministic since find_pattern_matches() will search the graph in different orders on different runs, so sometimes the pattern of execution is ok for a given graph, sometimes it throws the exception.
If you have a better arena for me to raise issues with model_optimiser as an Intel employee then I'd be happy to follow your advice on how to register and track issues.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Attached a zip file with a trivial test.
Test input in "input"
XML Results with no subgraph replacement in Results/ncr_mult_no_subgraph_replacement.xml
The results I need are Results/ncr_mult_required.xml
My extensions are ncr_graph.py - copy to extensions/front - and neg_concat_relu.py - copy to extensions/ops
I changed caffe.py to call .. (See another forum post)
FrontReplacementSubgraph.find_and_replace_all_patterns(graph) # rik
Without the change to graph.py I get ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Rik!
Thank you for reporting this issue!
I have checked model conversion on R2 release version with model you attached and everything works fine, and I see the same IR you sent.
Could you please check this issue on you side with R2 MO version? and could you please provide your MO version ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for checking. we are hoping to catch up to version 2 in the next sprint and will confirm the fix. It is good that it implies you are now supporting subgraph replacement in caffe - I did see substantial changes in that area.
Rik
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page