Skip to content

Commit

Permalink
[DOCS] Neural network Deployment Guide with System Module Mode apache…
Browse files Browse the repository at this point in the history
  • Loading branch information
srkreddy1238 committed Aug 2, 2018
1 parent 7bc96e0 commit 97ffc97
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/deploy/nnvm.md
Expand Up @@ -116,3 +116,22 @@ int main()
return 0;
}
```

# Deploy as System Module
C++ additionally support deployment as system module.
This process need few additional options as given below to NNVM build.

For target llvm append --system-lib as ```target=llvm --system-lib```
For a GPU build (or non llvm) the additional option should be given to targat_host as ```target=llvm --system-lib```

Saving the module also differs as ```lib.save``` instead of ```lib.export_library```

The output of lib.save is an object file which should be added to other object files while building c++ application.
Please refer to [Makefile](https://github.com/dmlc/tvm/blob/54ca1493bd9808a481ca0e7ed32897c12f36796e/apps/howto_deploy/Makefile#L32) for a reference.

The c++ code to load this system module require the below change.

```cpp
// tvm module for compiled functions
tvm::runtime::Module mod_syslib = (*tvm::runtime::Registry::Get("module._GetSystemLib"))();
```

0 comments on commit 97ffc97

Please sign in to comment.