tqchen / tvm-webgpu-example

Compiling machine learning to wasm and WebGPU

Home Page:https://tqchen.com/tvm-webgpu-example/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TVM WebGPU Example

NOTE: This example is out dated, checkout https://github.com/mlc-ai/web-stable-diffusion instead

This is an example project for building a tvm webgpu-backed module and deploy it to the web.

Try it out

Build from Source

You will need the latest version of TVM on the master. Please install the TVM via source build(by setting the PYTHONPATH). Checkout the steps under tvm/web to enable webgpu support.

Build the dependent files in the tvm/web

cd /path/to/tvm/web
make
npm run bundle

Then run the build script to build the model specific data.

cd /path/to/tvm-webgpu-examples
python3 build.py

You can now serve the content under dist

cd /path/to/tvm-webgpu-examples/dist
python3 http.server

You can also publish to github using the publish_gh_pages script.

About

Compiling machine learning to wasm and WebGPU

https://tqchen.com/tvm-webgpu-example/


Languages

Language:HTML 66.1%Language:Python 30.3%Language:Shell 3.6%