wonnx

Wonnx aimed at being an ONNX Runtime for every GPU on all platform written in 100% Rust.

Supported Platforms (enabled by wgpu)

API | Windows | Linux & Android | macOS & iOS | ----- | ----------------------------- | ------------------ | ------------------ | Vulkan | :whitecheckmark: | :whitecheckmark: | | Metal | | | :whitecheckmark: | DX12 | :whitecheckmark: (W10 only) | | | DX11 | :construction: | | | GLES3 | | :ok: | |

:whitecheckmark: = First Class Support — :ok: = Best Effort Support — :construction: = Unsupported, but support in progress

Getting Started

To use

```rust async fn execute_gpu() -> Option> { // USER INPUT

let n: usize = 512 * 512 * 128;
let mut input_data = HashMap::new();
let data = vec![-1.0f32; n];
let dims = vec![n as i64];
input_data.insert("x", (data.as_slice(), dims.as_slice()));

let session = wonnx::Session::from_path("tests/single_relu.onnx")
    .await
    .unwrap();

session.run(input_data).await

} ```

Test

bash cargo test

Test WASM (not yet implemented)

bash export RUSTFLAGS=--cfg=web_sys_unstable_apis wasm-pack test --node

Examples are available in the tests folder