Let's combine wasi-nn and witx-bindgen and see how it goes!

Overview

WASI-NN Experiment

Continuous integration

(API Docs)

Experiments with wasmtime, the wasi-nn proposal, and tract.

Getting Started

To use this experiment, you will first need to compile the guest code to WebAssembly.

$ cargo build --target wasm32-unknown-unknown --package guest

We can then use the host application to load the WebAssembly module and run the model it contains.

$ cargo  --package host -- target/wasm32-unknown-unknown/debug/guest.wasm

During development, I use cargo watch and this one-liner to automatically recompile and re-run the guest after every change:

$ cargo watch --clear \
    -x "check --workspace" \
    -x "test --workspace" \
    -x "doc --workspace --document-private-items" \
    -x "build --package guest --target wasm32-unknown-unknown" \
    -x "run --package host -- target/wasm32-unknown-unknown/debug/guest.wasm"

License

This project is licensed under either of

at your option.

It is recommended to always use cargo-crev to verify the trustworthiness of each of your dependencies, including this one.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

The intent of this crate is to be free of soundness bugs. The developers will do their best to avoid them, and welcome help in analysing and fixing them.

You might also like...
A handy calculator, based on Rust and WebAssembly.
A handy calculator, based on Rust and WebAssembly.

qubit 💥 Visit Website To Use Calculator Example 💥 Visit Website To Use Calculator 2 + 2

Rust WebGL2 wrapper with a focus on making high-performance WebAssembly graphics code easier to write and maintain
Rust WebGL2 wrapper with a focus on making high-performance WebAssembly graphics code easier to write and maintain

Limelight Limelight is a WebGL2 wrapper with a focus on making high-performance WebAssembly graphics code easier to write and maintain. demo.mov live

Compiler infrastructure and toolchain library for WebAssembly

Binaryen Binaryen is a compiler and toolchain infrastructure library for WebAssembly, written in C++. It aims to make compiling to WebAssembly easy, f

Zaplib is an open-source library for speeding up web applications using Rust and WebAssembly.

âš¡ Zaplib Zaplib is an open-source library for speeding up web applications using Rust and WebAssembly. It lets you write high-performance code in Rust

A template for kick starting a Rust and WebAssembly project using wasm-pack.

A template for kick starting a Rust and WebAssembly project using wasm-pack.

{Wasm+Rust} Build and animate Conway's Game of Life
{Wasm+Rust} Build and animate Conway's Game of Life

A self-guided learning project that includes Rust + Wasm together. Who knows, maybe Typescript and React joins too..

Rust-based WebAssembly bindings to read and write Apache Parquet files

parquet-wasm WebAssembly bindings to read and write the Parquet format to Apache Arrow. This is designed to be used alongside a JavaScript Arrow imple

Dister builds and bundles your wasm web app.

dister Dister builds and bundles your wasm web app. Installation cargo install dister Requirements wasm32-unknown-unknown target: rustup target add wa

Mini operating system with a graphical interface, for x64 platforms, in Rust and Assembly

osmini Mini operating system with a graphical interface, for x64 platforms, in Rust and Assembly Build Don't forget to install the dependencies. This

Comments
  • Collaborating on a general-purpose Tract implementation for WASI NN

    Collaborating on a general-purpose Tract implementation for WASI NN

    Hi, great to see more WASI NN implementations!

    I've been using the ONNX implementation of Tract, you can find a first iteration of this with WASI NN here -- https://github.com/deislabs/wasi-nn-onnx

    I'd be happy to collaborate on a general-purpose implementation for Tract, let me know if you're interested.

    opened by radu-matei 3
Owner
Hammer of the Gods
Hammer of the Gods
Todo application on Atmos (WebAssembly with WASI)

Get starting Install subo CLI at https://github.com/suborbital/subo Build todo app > cd todos > subo build . Run docker compose > docker compose up Pl

Thang Chung 2 Dec 9, 2021
simple operating system written in Rust with wasi support.

Agave OS Agave OS is a simple operating system written in Rust with wasi support. It is designed to be lightweight and easy to use. It is also designe

Dean Srebnik 5 Jun 12, 2023
Client for integrating private analytics in fast and reliable libraries and apps using Rust and WebAssembly

TelemetryDeck Client Client for integrating private analytics in fast and reliable libraries and apps using Rust and WebAssembly The library provides

Konstantin 2 Apr 20, 2022
A console and web-based Gomoku written in Rust and WebAssembly

?? rust-gomoku A console and web-based Gomoku written in Rust and WebAssembly Getting started with cargo & npm Install required program, run # install

namkyu1999 2 Jan 4, 2022
darkforest is a console and web-based Roguelike written in Rust and WebAssembly.

darkforest darkforest is a console and web-based Roguelike written in Rust and WebAssembly. Key Features TBA Quick Start TBA How To Contribute Contrib

Chris Ohk 5 Oct 5, 2021
Lumen - A new compiler and runtime for BEAM languages

An alternative BEAM implementation, designed for WebAssembly

Lumen 3.1k Dec 26, 2022
🚀Wasmer is a fast and secure WebAssembly runtime that enables super lightweight containers to run anywhere

Wasmer is a fast and secure WebAssembly runtime that enables super lightweight containers to run anywhere: from Desktop to the Cloud, Edge and IoT devices.

Wasmer 14.1k Jan 8, 2023
Autogenerated async RPC bindings that instantly connect a JS frontend to a Rust backend service via WebSockets and WASM.

Turbocharger Autogenerated async RPC bindings that instantly connect a JS frontend to a Rust backend service via WebSockets and WASM. See https://gith

null 28 Jan 2, 2023
A high-performance, secure, extensible, and OCI-complaint JavaScript runtime for WasmEdge.

Run JavaScript in WebAssembly Now supporting wasmedge socket for HTTP requests and Tensorflow in JavaScript programs! Prerequisites Install Rust and w

Second State 219 Jan 3, 2023
Simple file sharing with client-side encryption, powered by Rust and WebAssembly

Hako Simple file sharing with client-side encryption, powered by Rust and WebAssembly Not feature-packed, but basic functionalities are just working.

Jaehyeon Park 30 Nov 25, 2022