Open abrown opened 2 years ago
cc: @brianjjones
i happened to search examples yesterday. what i've found are: https://github.com/fermyon/wasi-experimental-toolkit/tree/main/tests/modules/nn-demo (wit) https://github.com/bytecodealliance/wasmtime/tree/main/crates/wasi-nn/examples/classification-example (witx)
That first one only does a load
and we need to walk through the entire API. Would you like to take a stab at adapting the second one to WIT?
That first one only does a
load
and we need to walk through the entire API. Would you like to take a stab at adapting the second one to WIT?
i agree it's better to migrate the latter one to wit. my understanding is it's mainly about migrating wasi-nn, which is https://github.com/bytecodealliance/wasi-nn/tree/main/rust. is it right?
Optionally, this could leverage some of the wit-bindgen tooling since the specification is not WIT-based.
do you mean s/not/now/ ?
That first one only does a
load
and we need to walk through the entire API. Would you like to take a stab at adapting the second one to WIT?
my attempt https://github.com/bytecodealliance/wasmtime/pull/4451
i agree it's better to migrate the latter one to wit. my understanding is it's mainly about migrating wasi-nn, which is https://github.com/bytecodealliance/wasi-nn/tree/main/rust. is it right?
Well, there's work to be done in Wasmtime as you saw in that PR but there is also work to be done in the bindings (e.g., Rust, as you point out). I think @bjorn3's suggestion to use the wit-bindgen macros is reasonable (for reference, see https://github.com/bytecodealliance/wasi-nn/issues/64).
The README includes a placeholder for an example walking through the API. Ideally, the example would include all of the calls in some language (e.g., Rust) to demonstrate how to perform something like image classification using the wasi-nn API. Optionally, this could leverage some of the
wit-bindgen
tooling since the specification is now WIT-based.