Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wasi-nn: only support components #8530

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

abrown
Copy link
Collaborator

@abrown abrown commented May 2, 2024

This is a relatively drastic change to remove all the preview1, WITX-based support from Wasmtime's wasi-nn implementation. This has ramifications:

  • Wasmtime will not be able to run core modules that target wasi-nn, either through the CLI or the embedding API
  • Sightglass will not be able to benchmark wasi-nn-using code until the bench-api learns how to handle components
  • the wasi-nn bindings crate is no longer usable with Wasmtime (it only understands the preview1 ABI)
  • all wasi-nn testing in Wasmtime will now use components (the examples are left for a later refactor)

Why this change, then? The WebAssembly specification has pushed ahead, defining new functionality that depends on component model features (e.g., resources). So far, the wasmtime-wasi-nn has had its preview1- and preview2-ABI implementations coexisting side by side, wit.rs and witx.rs. This was only possible because the WIT and WITX definitions were roughly similar. But I plan to update the Wasmtime implementation to support the new spec changes, which means the older preview1-ABI WITX code would immediately be out of date. And the differences between the updated WIT code and the old WITX code would only grow over time.

@abrown abrown force-pushed the wasi-nn-only-wit branch 2 times, most recently from 51bc48a to bc567a5 Compare May 2, 2024 23:04
@alexcrichton
Copy link
Member

From a technical perspective this all looks fine to me, thanks! For a "is this the time to do this or not" I'd defer to the wasi-nn subgroup, which I know you're intimately tied into as well and likely have a consensus before making this PR

abrown added 3 commits May 3, 2024 15:00
The wasi-nn specification has moved forward, adopting component model
features such as resources. These cannot be specified and implemented
using WITX, so the WITX implementation is removed, leaving the WIT
implementation intact. In the future, preview1-ABI support could be
re-added with a component adapter, as other WASI proposals have done.
With WITX support removed, these files no longer are needed in-tree.
The `build.rs` script was only telling Wiggle where the WITX files
lived. We do need to retain it, though, for `env!("OUT_DIR")` to still
work.

prtest:full
abrown added a commit to abrown/bytecodealliance-meetings that referenced this pull request May 3, 2024
This PR removes preview1 support for wasi-nn in Wasmtime; let's discuss
the ramifications.

[#8530]: bytecodealliance/wasmtime#8530
abrown added a commit to bytecodealliance/meetings that referenced this pull request May 3, 2024
This PR removes preview1 support for wasi-nn in Wasmtime; let's discuss
the ramifications.

[#8530]: bytecodealliance/wasmtime#8530
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants