onnxruntime-tvm/golang
Tianqi Chen cffb4fba03
[HEADER] Add Header to Comply with ASF Release Policy (#2982)
* [HEADER] ASF header dir=include

* [HEADER] ASF Header dir=src

* [HEADER] ASF Header -dir=python

* [HEADER] ASF header dir=topi

* [HEADER] ASF Header dir=nnvm

* [HEADER] ASF Header -dir=tutorials

* [HEADER] ASF Header dir=tests

* [HEADER] ASF Header -dir=docker

* fix whitespace

* [HEADER] ASF Header -dir=jvm

* [HEADER] ASF Header -dir=web

* [HEADER] ASF Header --dir=apps

* [HEADER] ASF Header --dir=vta

* [HEADER] ASF Header -dir=go

* temp

* [HEADER] ASF Header --dir=rust

* [HEADER] Add ASF Header --dir=cmake

* [HEADER] ASF Header --dir=docs

* [HEADER] Header for Jenkinsfile

* [HEADER] ASF Header to toml and md

* [HEADER] ASF Header to gradle

* Finalize rat cleanup

* Fix permission

* Fix java test

* temporary remove nnvm onnx test
2019-04-07 21:14:02 -07:00
..
sample [HEADER] Add Header to Comply with ASF Release Policy (#2982) 2019-04-07 21:14:02 -07:00
src [HEADER] Add Header to Comply with ASF Release Policy (#2982) 2019-04-07 21:14:02 -07:00
Makefile [HEADER] Add Header to Comply with ASF Release Policy (#2982) 2019-04-07 21:14:02 -07:00
README.md [HEADER] Add Header to Comply with ASF Release Policy (#2982) 2019-04-07 21:14:02 -07:00

README.md

gotvm - Golang Frontend for TVM Runtime

This folder contain golang interface for TVM runtime. It brings TVM runtime to Golang.

  • It enable c runtime api of tvm exposed to golang.
  • It enables module loading (lib, graph and params) and inference operations.

Installation

Requirements

Modules

  • src Module that generates golang package corresponding to the c runtime api exposed from tvm source tree. This process build golang package gotvm.a

  • samples Sample golang reference application to inference through gotvm package.

Build

Once the Requirements are installed

To build gotvm package

make

To build and run internal tests

make tests

To build sample apps.

make samples

Run

To Demonstrates sample TVM module compilation using python and deploy via golang.

./simple

To deploy a realtime module with lib, graph and param.

./complex

To demonstrate go function closure conversion to packed function handle.

./pack_func_convert

To demonstrate a packed function handle given as an argument.

pack_func_handle_arg

To register go function with runtime as a global function.

pack_func_register

To demonstrate function closure passed as argument to a function call.

./pack_func_closure_arg

To demonstrate function closure returned from a packed function.

./pack_func_closure_return

Documentation

gotvm.go is documented with sufficient information about gotvm package. A html version documentation can be accessed by running below command after building runtime.

godoc -http=:6060  -goroot=./gopath

After above command try http://127.0.0.1:6060 from any browser.

Also please refer to the sample applications under sample folder.

Docker

Docker setup may need below additions for dependencies and environment preparation.

Please refer docker/install/ubuntu_install_golang.sh for the packages dependencies.

go compiler 1.10 on ubuntu doesn't install on standard path, hence an explicit export may be needed as shown below.

export PATH="/usr/lib/go-1.10/bin:$PATH"```