samskalicky commented on a change in pull request #17034: Dynamic subgraph
property
URL: https://github.com/apache/incubator-mxnet/pull/17034#discussion_r363562382
##########
File path: src/c_api/c_api.cc
##########
@@ -705,6 +719,57 @@ int MXLoadLib(const char *path) {
}
regOp.add_argument("data", "NDArray[]", "Source inputs");
}
+
+ // get number of partitioners registered in the library
+ partRegSize_t partRegSize = get_func<partRegSize_t>(lib,
+
const_cast<char*>(MXLIB_PARTREGSIZE_STR));
+ int numParts = partRegSize();
+ LOG(INFO) << "Found " << numParts << " partitioners in library";
+
+ /*
+ * Get all custom partitioners implementation from custom library
+ * loop and register each partitioner in the library to NNVM
+ */
+ partRegGetCount_t partRegGetCount = get_func<partRegGetCount_t>(lib,
+
const_cast<char*>(MXLIB_PARTREGGETCOUNT_STR));
+ partRegGet_t partRegGet = get_func<partRegGet_t>(lib,
const_cast<char*>(MXLIB_PARTREGGET_STR));
+ for (int i = 0; i < numParts; i++) {
+ const char* name;
+ // get custom partitioner strategy count from the dynamic library
+ int count = partRegGetCount(i, &name);
+ CHECK(count > 0) << "Error loading '" << name
+ << "' custom partitioner, no strategies defined";
+ std::string name_str(name);
+ LOG(INFO) << "\tPartitioner[" << i << "] " << name;
+ // MXNET_REGISTER_SUBGRAPH_BACKEND(customBackend);
Review comment:
done
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services