You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by shiwenloong via TVM Discuss <no...@discuss.tvm.ai> on 2020/06/21 14:40:41 UTC

[TVM Discuss] [Questions] Is there a way to serialize a tvm module into a string like the serialized engine in tensorrt?


In TensorRT a trt engine can be serialized and deserialized like this:
>     with open(“sample.engine”, “wb”) as f: 
>         f.write(engine.serialize())
>     with open(“sample.engine”, “rb”) as f, trt.Runtime(TRT_LOGGER) as runtime: 
>         engine = runtime.deserialize_cuda_engine(f.read())

In TVM a tvm module is alway saved as a shared library like this:
>     with relay.build_config(opt_level=3):
>         _, resnet18_lib, _ = relay.build_module.build(resnet18_mod, "cuda", params=resnet18_params)
>     resnet18_lib.export_library("deploy.so")

Is there a way to serialize a tvm module into a string like the serialized engine in tensorrt?





---
[Visit Topic](https://discuss.tvm.ai/t/is-there-a-way-to-serialize-a-tvm-module-into-a-string-like-the-serialized-engine-in-tensorrt/7042/1) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/cd163b969d3183a3bfa0d74ab18e64d1694b0e20b724bfebe2d93456d809552c).

[TVM Discuss] [Questions] Is there a way to serialize a tvm module into a string like the serialized engine in tensorrt?

Posted by shiwenloong via TVM Discuss <no...@discuss.tvm.ai>.

It may be not what I want. I want to find a way to implement these two paired functions for model serialization:
> std::string serialize(tvm::runtime::Module model);
> 
> tvm::runtime::Module deserialize(std::string serialized_model);





---
[Visit Topic](https://discuss.tvm.ai/t/is-there-a-way-to-serialize-a-tvm-module-into-a-string-like-the-serialized-engine-in-tensorrt/7042/3) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/b5f791f8a2b68583825db87896bf2473a0896e818dc34baf2f4709aa990eacc5).

[TVM Discuss] [Questions] Is there a way to serialize a tvm module into a string like the serialized engine in tensorrt?

Posted by "Cody H. Yu via TVM Discuss" <no...@discuss.tvm.ai>.

You can try lib.save?





---
[Visit Topic](https://discuss.tvm.ai/t/is-there-a-way-to-serialize-a-tvm-module-into-a-string-like-the-serialized-engine-in-tensorrt/7042/2) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/01bbcf5b90ce26763187b6461ae09c1e1c4fb64090f2c2042336617bbca657b1).