onnxruntime-tvm/nnvm
Yizhi Liu 73775f4532 AlterOpLayout with tvm.target (#463)
* AlterOpLayout with tvm.target

* fix test
2018-05-29 08:47:00 -07:00
..
amalgamation Fix lint, temporary add amaga back (#170) 2018-05-29 08:47:00 -07:00
cmake add cmake with windows (#40) 2018-05-29 08:47:00 -07:00
docs [DOCS] improve document of symbol; (#456) 2018-05-29 08:47:00 -07:00
examples Add end-to-end SGX ResNet inference example (#388) 2018-05-29 08:47:00 -07:00
include/nnvm Rename FInferLayout -> FCorrectLayout (#453) 2018-05-29 08:47:00 -07:00
make Make choice of archiver configurable (#288) 2018-05-29 08:47:00 -07:00
python AlterOpLayout with tvm.target (#463) 2018-05-29 08:47:00 -07:00
src fix restore layout in AlterOpLayout (#460) 2018-05-29 08:47:00 -07:00
tests fix restore layout in AlterOpLayout (#460) 2018-05-29 08:47:00 -07:00
tutorials Some minor documentation issues rectified (#450) 2018-05-29 08:47:00 -07:00
.gitkeep ok 2018-05-29 08:47:00 -07:00
CMakeLists.txt Change TOPI ops to use C++ implementation where applicable (#357) 2018-05-29 08:47:00 -07:00
Jenkinsfile [DOCS] Add install docs, fix Jenkins (#57) 2018-05-29 08:47:00 -07:00
LICENSE Change license file to be detectable by github (#72) 2018-05-29 08:47:00 -07:00
Makefile [FRONTEND] DarkNet Yolo2 Frontend Support (#377) 2018-05-29 08:47:00 -07:00
NEWS.md [DOCS] Add install docs, fix Jenkins (#57) 2018-05-29 08:47:00 -07:00
README.md Fix license URL (#451) 2018-05-29 08:47:00 -07:00

README.md

NNVM: Open Compiler for AI Frameworks

Build Status GitHub license

Installation | Documentation | Tutorials | Release Notes

NNVM compiler offers reusable computation graph optimization and compilation for deep learning systems. It is backed by the TVM stack and provides modules to:

  • Represent deep learning workloads from front-end frameworks via a graph IR.
  • Optimize computation graphs to improve performance.
  • Compile into executable modules and deploy to different hardware backends with minimum dependency.

NNVM is designed to add new frontend, operators and graph optimizations in a decentralized fashion without changing the core interface. The compiled module can be deployed to server, mobile, embedded devices and browsers with minimum dependency, in languages including c++, python, javascript, java, objective-c. Checkout our release announcement

The following code snippet demonstrates the general workflow of nnvm compiler.

import tvm
from tvm.contrib import graph_runtime, rpc
import nnvm.frontend
import nnvm.compiler

# GET model from frameworks
# change xyz to supported framework name.
graph, params = nnvm.frontend.from_xyz(...)

# OPTIMIZE and COMPILE the graph to get a deployable module
# target can be "opencl", "llvm", "metal" or any target supported by tvm
target = "cuda"
graph, lib, params = nnvm.compiler.build(graph, target, {"data", data_shape}, params=params)

# DEPLOY and run on gpu(0)
module = graph_runtime.create(graph, lib, tvm.gpu(0))
module.set_input(**params)
module.run(data=data_array)
output = tvm.nd.empty(out_shape, ctx=tvm.gpu(0))
module.get_output(0, output)

# DEPLOY to REMOTE mobile/rasp/browser with minimum tvm rpc runtime
# useful for quick experiments on mobile devices
remote = rpc.connect(remote_host, remote_port)
lib.export_library("mylib.so")
remote.upload("mylib.so")
rlib = rpc.load_module("mylib.so")
# run on remote device
rmodule = graph_runtime.create(graph, rlib, remote.gpu(0))
rmodule.set_input(**params)
rmodule.run()

License

Licensed under an Apache-2.0 license.

  • TinyFlow on how you can use NNVM to build a TensorFlow like API.
  • Apache MXNet uses NNVM as a backend.