Stream: git-wasmtime

Topic: wasmtime / Issue #2208 Add an initial wasi-nn implementat...


view this post on Zulip Wasmtime GitHub notifications bot (Sep 19 2020 at 03:38):

leonwanghui commented on Issue #2208:

Hi @abrown, I think it's a great idea to add neural network module in WASI and Wasmtime, and I'm also interested in expanding other inference frameworks into wasi-nn backend plugin. Could u give some guidelines to develop a new backend plugin? Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Sep 21 2020 at 17:21):

abrown commented on Issue #2208:

Could u give some guidelines to develop a new backend plugin? Thanks!

I think the process currently looks like this (at a very high level):

  1. create a specification (e.g. [wasi-nn]) and present it to the the WASI subgroup (see their [meetings]); you might even want to discuss the idea in the subgroup before creating the specification in case others have had similar ideas
  2. use the specification to generate a Rust trait using wiggle as in [witx.rs], implement the generated trait as in [impl.rs], and then create a way to link in the module [lib.rs]. You will need a way to contain the module state as well: [ctx.rs].
  3. The next part is still TBD since wasi-nn is the first attempt to add a WASI module that is not wasi-common: you probably need a way to conditionally compile the module if it is something like wasi-nn that users will want to opt in to and, once this is figured out, the Wasmtime linker should be modified in several places to include the new functionality (see an example [here]).

[wasi-nn]: https://github.com/WebAssembly/wasi-nn/blob/master/phases/ephemeral/witx/wasi_ephemeral_nn.witx
[meetings]: https://github.com/WebAssembly/WASI/tree/master/meetings
[witx.rs]: https://github.com/bytecodealliance/wasmtime/pull/2208/files#diff-7abb5603a8f446a51587db17dac65700R6-R10
[impl.rs]: https://github.com/bytecodealliance/wasmtime/pull/2208/files#diff-fd07edcd1266d1aaf710f2a69417536dR1
[lib.rs]: https://github.com/bytecodealliance/wasmtime/pull/2208/files#diff-47c18b15fc3a3e243ac2c78b6015c1adR9
[ctx.rs]: https://github.com/bytecodealliance/wasmtime/pull/2208/files#diff-c6a6bf4e536c9922b150db4d6591dc23R108
[here]: https://github.com/bytecodealliance/wasmtime/pull/2208/files#diff-8b7c97769c6a414d67e8b9a22992a91bR28-R29

Hopefully that covers the basics but as you might guess there are details that could bear more documentation.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 01 2020 at 17:56):

abrown commented on Issue #2208:

Tagging a few people as reviewers to solicit some early feedback on this approach to adding optional WASI modules to Wasmtime.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2020 at 21:59):

alexcrichton commented on Issue #2208:

That way, wasi-nn would be in control of when it sees Wasmtime API changes. That would also avoid the 95 MB file in the Wasmtime repo. Thoughts?

Belatedly, but this sounds good to me!

view this post on Zulip Wasmtime GitHub notifications bot (Oct 23 2020 at 17:18):

github-actions[bot] commented on Issue #2208:

Subscribe to Label Action

cc @kubkon

<details>
This issue or pull request has been labeled: "cranelift", "wasi"

Thus the following users have been cc'd because of the following labels:

To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.

Learn more.
</details>

view this post on Zulip Wasmtime GitHub notifications bot (Oct 24 2020 at 00:29):

abrown commented on Issue #2208:

@pchickey, @sunfishcode, @alexcrichton: I think this is ready for an official review (pending any crazy CI failures... I think I've seen the majority of them already). What you will see with the current state of this PR is two commits:

view this post on Zulip Wasmtime GitHub notifications bot (Oct 26 2020 at 16:33):

alexcrichton commented on Issue #2208:

Seems reasonable to me, but are you thinking we should land all the support in this repository? I may have misunderstood but it sounded like we were shooting instead for landing this as a separate repository with integration hooks provided here.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 27 2020 at 20:01):

alexcrichton commented on Issue #2208:

@sunfishcode and @abrown what do y'all think of making a wasmtime-nn (or similar) repository in the bytecodealliance org to house this integration?


Last updated: Dec 23 2024 at 12:05 UTC