Git Product home page Git Product logo

tvm-rt-wasm's Introduction

TVM Runtime for WebAssembly

License


A High performance and tiny TVM graph executor library written in C which can compile to WebAssembly and use CUDA/WebGPU as the accelerator.

Support Matrix

Toolchain Target Backend Runtime
wasi-sdk WebAssembly CPU wasmer, WasmEdge, wasmtime, etc.
wasi-sdk WebAssembly CUDA wasmer-gpu (not open-sourced now)
emscripten WebAssembly CPU browser, nodejs
emscripten WebAssembly WebGPU browser, nodejs (need dawn.node)
clang/gcc native(x86_64,aarch64,etc.) CPU /
clang/gcc native(x86_64,aarch64,etc.) CUDA /
clang/gcc native(x86_64,aarch64,etc.) WebGPU link with use dawn or webgpu-native

Build from source.

Requirements:

  1. cmake
  2. C compiler (clang/gcc/msvc for native target, wasi-sdk/emscripten for WebAssembly target)

WebAssembly target toolchain download: wasi-sdk github repo, emsdk github repo

Available Options in cmake

Project options:

  • USE_WASI_SDK: If use the wasi-sdk, set /path/to/wasi-sdk or set ON/AUTO/TRUE to use default /opt/wasi-sdk.
  • USE_EMSDK: If use the emscripten, set /path/to/emsdk or set ON/AUTOTRUEto use default/opt/emsdk`.

Do build

Sample: build the wasm32-wasi target with CUDA support, the target can run with wasmer-gpu.

mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_WASI_SDK=ON
ninja

Use the library in C

See the examples

tvm-rt-wasm's People

Contributors

yanghaku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.