-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[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:
return is 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change the example code to relay
@weberlo some final comments |
This PR addresses #2413 by porting the
nnvm.compiler.save_param_dict
andnnvm.compiler.load_param_dict
functions to Relay astvm.relay.save_param_dict
andtvm.relay.load_param_dict
, respectively.To serialize
NDArray
s, we wrap them inTensorValue
s, which have serialization functions defined on them. Let me know of any concerns about this approach.While porting, I found that
ClosureNode
,TupleValueNode
, andTensorValueNode
were not registered withTVM_REGISTER_NODE_TYPE
. This PR also addresses this issue.The
test_bigendian_rpc_param
test 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 @.