bytecodealliance / wasm-micro-runtime

WebAssembly Micro Runtime (WAMR)
Apache License 2.0
4.97k stars 626 forks source link

wasi-nn + threads #2430

Open yamt opened 1 year ago

yamt commented 1 year ago

wasm_deinstantiate and aot_deinstantiate call wasi_nn_destroy only for !is_sub_inst.

on the other hand, wasm_runtime_get_wasi_nn_ctx seems to allocate the context for each instances.

probaby it just means that (this implementation of?) wasi-nn is not compatible with threads.

tonibofarull commented 1 year ago

wasi-nn context is managed within the library. The motivations are the following:

  1. Allowing the user to build it as a native library.
  2. Avoid coupling with WAMR as much as possible.

What would be required to support it with threads? Reduce the granularity of the context from wasm instance to thread?

yamt commented 1 year ago

What would be required to support it with threads?

i don't know. probably