You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2021/02/01 23:32:06 UTC

[GitHub] [incubator-mxnet] samskalicky commented on pull request #19812: [2.0.alpha] fixed backend_opts to be empty dictionary instead of None

samskalicky commented on pull request #19812:
URL: https://github.com/apache/incubator-mxnet/pull/19812#issuecomment-771234624


   > Thank you! Could you please add a test? It looks like this was completely untested?
   
   Looking at the flow, it seems to only happen when calling `optimize_for` twice. After each call the `backend` and `backend_opts` are cleared:
   https://github.com/apache/incubator-mxnet/blob/49edbfc82cb0ce3b823051e1acc26388bc79686c/python/mxnet/gluon/block.py#L1398-L1401
   
   And then the "clearing" sets the `backend_opts` to None. So on the 2nd call, if the user does not provide any options it would run into this scenario. In the lib_subgraph extensions example we call optimize_for once to partition, and then a 2nd time to run a graph pass:
   https://github.com/apache/incubator-mxnet/blob/49edbfc82cb0ce3b823051e1acc26388bc79686c/example/extensions/lib_subgraph/test_subgraph.py#L65-L78
   
   But in the unittests, we only use the `default` subgraph backends:
   https://github.com/apache/incubator-mxnet/blob/49edbfc82cb0ce3b823051e1acc26388bc79686c/tests/python/unittest/test_subgraph_op.py#L267
   
   So theres no way to duplicate exactly what is being done in the example. But, we do build the `lib_subgraph` library in the CMakeLists.txt:
   https://github.com/apache/incubator-mxnet/blob/49edbfc82cb0ce3b823051e1acc26388bc79686c/CMakeLists.txt#L814
   
   So we could add a test in unittests to use this library. But I think we decided not to do this in the past since people were running the unittests on pip wheels that didnt have the libraries packaged into the wheel. Thoughts?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org