[Relay] Port param dict save/load from NNVM#2620
Conversation
|
I think this path host = os.environ.get("TVM_POWERPC_TEST_HOST", None)
port = os.environ.get("TVM_POWERPC_TEST_PORT", 9090)
if host is None:
returnis still being taken. |
|
@weberlo we should use the original function that actually saves the ndarray dict(as in NNVMv1), otherwise the binary format won't be readable by graph_runtime.load_params |
|
Yes, I do mean these functions. A more general test is to use these save_dict function and then call graphruntime.load_params to load them in. |
|
@weberlo please update the PR |
|
@tqchen I'm having some weird problems with includes. Maybe my approach is wrong, but I'm trying to take the functions from /*!
* \brief wrapper node container for exchange.
*/
struct NDArrayWrapperNode : public ::tvm::Node {
std::string name;
tvm::runtime::NDArray array;
void VisitAttrs(tvm::AttrVisitor* v) final {
v->Visit("name", &name);
v->Visit("array", &array);
}
static constexpr const char* _type_key = "NDArrayWrapper";
TVM_DECLARE_NODE_TYPE_INFO(NDArrayWrapperNode, Node);
};
TVM_DEFINE_NODE_REF(NDArrayWrapper, NDArrayWrapperNode);. But when I try to put Is there a different header I should be including, or is this struct definition using outdated types? |
|
that works you can move the nnvm impl there, and use the new exposed packfubc |
python/tvm/relay/param_dict.py
Outdated
| .. code-block:: python | ||
|
|
||
| # compile and save the modules to file. | ||
| graph, lib, params = nnvm.compiler.build( |
There was a problem hiding this comment.
change the example code to relay
|
@weberlo some final comments |
This PR addresses #2413 by porting the
nnvm.compiler.save_param_dictandnnvm.compiler.load_param_dictfunctions to Relay astvm.relay.save_param_dictandtvm.relay.load_param_dict, respectively.To serialize
NDArrays, we wrap them inTensorValues, which have serialization functions defined on them. Let me know of any concerns about this approach.While porting, I found that
ClosureNode,TupleValueNode, andTensorValueNodewere not registered withTVM_REGISTER_NODE_TYPE. This PR also addresses this issue.The
test_bigendian_rpc_paramtest has not yet been confirmed to pass, so I still need to wait for the results from CI.@jroesch @tqchen @srkreddy1238
Apologies for being late on this one. Let me know of anyone else I should @.