WebAssembly / wasi-nn

Neural Network proposal for WASI
429 stars 34 forks source link

Questions about WIT transition #24

Open yamt opened 2 years ago

yamt commented 2 years ago

my understanding is

am i right?

abrown commented 2 years ago

No, I don't think so. When I switched this repository over to WIT in #17, I kept the API the same, so unless I unwittingly made a mistake, there should be no change for users.

With #17 now complete, it seems like a good time to migrate existing implementations to the WIT-based tooling (e.g., in Wasmtime, in the wasi-nn bindings repository). Are you interested in helping out with that?

(@radu-matei, we had talked previously about migrating the tract implementation into Wasmtime--what do you think about that now?)

radu-matei commented 2 years ago

Moving the Tract implementation into Wasmtime is still a really good idea! (particularly because Tract has no additional hardware or software prerequisites)

yamt commented 2 years ago

No, I don't think so. When I switched this repository over to WIT in #17, I kept the API the same, so unless I unwittingly made a mistake, there should be no change for users.

wit version of get-output returns the tensor record while witx version of it only returns tensor-data.

With #17 now complete, it seems like a good time to migrate existing implementations to the WIT-based tooling (e.g., in Wasmtime, in the wasi-nn bindings repository). Are you interested in helping out with that?

yes. i'm more interested in C implementation than rust though.

(@radu-matei, we had talked previously about migrating the tract implementation into Wasmtime--what do you think about that now?)

abrown commented 1 year ago

wit version of get-output returns the tensor record while witx version of it only returns tensor-data

Oh, sorry, I will fix that.

i'm more interested in C implementation than rust though.

You mean using wasi-nn from C code that you compile to wasm32-wasi? If so, does wit-bindgen do enough here or is more needed?

yamt commented 1 year ago

i'm more interested in C implementation than rust though.

You mean using wasi-nn from C code that you compile to wasm32-wasi? If so, does wit-bindgen do enough here or is more needed?

i meant to implement wasi-nn api for C-based engines. (eg WAMR) my understanding is that wit-bindgen's C support today is only for wasm modules. is it right?

yamt commented 1 year ago

https://github.com/bytecodealliance/wit-bindgen/issues/285

yamt commented 1 year ago

No, I don't think so. When I switched this repository over to WIT in https://github.com/WebAssembly/wasi-nn/pull/17, I kept the API the same, so unless I unwittingly made a mistake, there should be no change for users.

when you say the API is kept, which level are you referring? the generated rust definitions like mod wasi_nn? or wasm import/export? or something else?

tonibofarull commented 1 year ago

any update regarding this?

abrown commented 1 year ago

Looking up at the previous comments, I don't think I knew how to respond to this (and still am not clear). Let me take a stab at explaining how I see the wasi-nn world right now:

Hope that helps!