Stream: wasi-nn

Topic: wasi-nn + preview2


view this post on Zulip Andrew Brown (Aug 09 2023 at 17:15):

I have been working on adapting the Wasmtime implementation of wasi-nn to use WIT: https://github.com/bytecodealliance/wasmtime/pull/6821. That PR retains the original WITX glue code inpreview1.rs and adds new WIT glue code in preview2.rs. (Now, I understand that wasi-nn is not included in "preview1," etc., I'm just referring to the ABI that each part supports).

This change refactors the wasmtime-wasi-nn crate to allow access from both preview1 and preview2 ABIs. Though the wasi-nn specification has included a WIT description for some time, here we use som...

view this post on Zulip Andrew Brown (Aug 09 2023 at 17:18):

I would like the old "preview1-build" Wasm modules to still work for some intermediate time period but I am also wondering if I can get rid of preview1.rs and rely on some kind of adapter to use preview2.rs to service both "preview1-built" and "preview2-built" code (e.g., wasi-preview1-component-adapter?).

view this post on Zulip Andrew Brown (Aug 09 2023 at 17:19):

Is it better to just maintain implementations for both ABIs for now? cc: @Dan Gohman, @Pat Hickey

view this post on Zulip Pat Hickey (Aug 09 2023 at 17:29):

i prefer to call those abis witx and wit

view this post on Zulip Pat Hickey (Aug 09 2023 at 17:30):

its up to you if you want to keep support for the witx abi built on top of the wit-bindgen traits, like we do in wasmtime_wasi::preview2::preview1

view this post on Zulip Pat Hickey (Aug 09 2023 at 17:31):

the wasi-preview1-component-adapter is just for adapting stuff that is required by the toolchain. wasi-nn should not be part of that adapter.

view this post on Zulip Pat Hickey (Aug 09 2023 at 17:32):

if someone is trying to use wasi-nn from a component they should be recompiling their project to use wit-bindgen with the wasi-nn wits

view this post on Zulip Andrew Brown (Aug 09 2023 at 23:19):

Pat Hickey said:

i prefer to call those abis witx and wit

Ok, I changed https://github.com/bytecodealliance/wasmtime/pull/6821 to use those terms instead

This change refactors the wasmtime-wasi-nn crate to allow access from both preview1 and preview2 ABIs. Though the wasi-nn specification has included a WIT description for some time, here we use som...

view this post on Zulip Matthew Tamayo-Rios (Aug 11 2023 at 07:50):

@Pat Hickey Will this impact availability of wasi-nn once preview2 stuff merges into Viceroy? If it does then Andrew and I need to plan on our work colliding, in particular if I'm making changes to preview1 backend impl in wasmtime for Sept


Last updated: Nov 22 2024 at 16:03 UTC