wasmtime icon indicating copy to clipboard operation
wasmtime copied to clipboard

Does wasmtime support AI model inference? I want to perform resnet50.pth inference in wasmtime, but there is no relevant tutorial content in the document.

Open lebron8dong opened this issue 10 months ago • 2 comments

Are there any related examples demo? Thank you so much.

lebron8dong avatar Apr 13 '24 14:04 lebron8dong

There is the wasi-nn specification implemented by wasmtime. https://github.com/bytecodealliance/wasmtime/tree/main/crates/wasi-nn/examples has a couple of examples.

bjorn3 avatar Apr 13 '24 16:04 bjorn3

It's also possible to compile many models to Wasm and run inference. For example, https://github.com/sonos/tract/ compiles to WebAssembly & WASI and can run any ONNX compatible model.

I have an example of running a BERT model here: https://github.com/rockwotj/ai-qa-wasi/tree/repl

rockwotj avatar Apr 16 '24 02:04 rockwotj