You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/06/17 06:08:06 UTC

[GitHub] [incubator-tvm] FrozenGene commented on pull request #5770: [BYOC][runtime] Separate code and metadata for CSourceModule

FrozenGene commented on pull request #5770:
URL: https://github.com/apache/incubator-tvm/pull/5770#issuecomment-645171944


   Maybe I miss something. so maybe this is considered. That is I don't see `unwrap_modules`. I ask this because I think it is related with our next module based interface runtime. The usage like [this](https://github.com/apache/incubator-tvm/pull/5753/files#diff-82bcc5ddf3cb06075848655807dfcbd5R136-R157):
   ```python
   with relay.build_config(opt_level=3):
       complied_graph_lib = relay.build_module.build(
           mod, "llvm", params=params)
   
   from tvm.contrib import util
   temp = util.tempdir()
   file_name = "deploy_lib.so"
   path_lib = temp.relpath(file_name)
   complied_graph_lib.export_library(path_lib)
   loaded_lib = tvm.runtime.load_module(path_lib)
   ctx = tvm.cpu(0)
   gmod = loaded_lib['default'](ctx)
   set_input = gmod["set_input"]
   run = gmod["run"]
   get_output = gmod["get_output"]
   data = np.random.uniform(-1, 1, size=(1, 3, 224, 224)).astype("float32")
   set_input("data", tvm.nd.array(data))
   run()
   out = get_output(0).asnumpy()
   ```
   As you could see we will wrap `params` / `lib` / `json` into one lib. So I want to see the logic of `unwrap_modules` and to see how to connect with it. 
   
   THANKS!


----------------------------------------------------------------
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