bytecodealliance / wasm-micro-runtime

WebAssembly Micro Runtime (WAMR)
Apache License 2.0
5k stars 628 forks source link

[wasi-nn] requirement of `load_by_name` implementation #3103

Open lum1n0us opened 10 months ago

lum1n0us commented 10 months ago

There is a recently added function, load-by-name, in wasi-nn.

    /// Load a `graph` by name.
    ///
    /// How the host expects the names to be passed and how it stores the graphs for retrieval via
    /// this function is **implementation-specific**. This allows hosts to choose name schemes that
    /// range from simple to complex (e.g., URLs?) and caching mechanisms of various kinds.
    load-by-name: func(name: string) -> result<graph, error>;

Plus, the import name of wasi-nn now is wasi_ephemeral_nn

lum1n0us commented 10 months ago

@tonibofarull

tonibofarull commented 10 months ago

I'll start working on it as soon as I have some time. I'll post a message here to let you know when I start, in case anyone else wants to pick it up first.

ayakoakasaka commented 10 months ago

@lum1n0us This interface is already WIT compliant and uses resources. Are there any guidelines or directions for that part as WAMR?

lum1n0us commented 10 months ago

NO. we don't have such guidelines yet. Or, following witx is another choice.

lum1n0us commented 6 months ago

@ayakoakasaka I am about to synchronize wamr wasi-nn backends(@ core/iwasm/libraries/wasi-nn) to commit(https://github.com/WebAssembly/wasi-nn/commit/c0840c26066fa4dbef12d6b0f3d4762f9d6d43c7). It may need to modify several definitions in wasi_nn.h and wasi_nn_types.h. Please let me know if there is any concern.

https://github.com/bytecodealliance/wasi-nn/blob/main/rust/src/generated.rs will be my reference.