Skip to content

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

License

Notifications You must be signed in to change notification settings

yanghaku/tvm-rt-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages