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

Rust binding for this proposal #16

Open
q82419 opened this issue May 13, 2024 · 3 comments
Open

Rust binding for this proposal #16

q82419 opened this issue May 13, 2024 · 3 comments

Comments

@q82419
Copy link

q82419 commented May 13, 2024

Hi there, here's from WasmEdge runtime.

Take the WASI-NN proposal for example, there's rust binding generated from the witx format.
Developers can use the witx-bindgen to generate the rust binding easily.
With this generated library, developers can call the WASI proposal APIs in rust and compile into WASM.

But currently the WASI proposals provides the wit format, which can be compiled into component model.
For the other WebAssembly runtimes, supporting the component model is not so easy and quickly due to its complexity.
To support this proposal, we should have:

  • The ABI documentation in WASM, especially the host function parameter and return types in WASM.
  • The rust binding to this proposal, in order to generate the test WASM invoking the host functions of this proposal.

Unfortunately, this WASI-WebGPU proposal doesn't provide the information for the API doc, which is the most important to implement this proposal.
Can you help to provide the rust binding and API doc so that developers can try to compile the WASM files without component?
Thanks!

@MendyBerger
Copy link
Collaborator

Hi, thanks for filing this issue!

Just trying to understand your exact needs, is this what you'd like us to replicate?
https://github.com/bytecodealliance/wasi-nn/blob/main/rust/src/generated.rs

@q82419
Copy link
Author

q82419 commented May 15, 2024

Hi, thanks for filing this issue!

Just trying to understand your exact needs, is this what you'd like us to replicate? https://github.com/bytecodealliance/wasi-nn/blob/main/rust/src/generated.rs

Hi,

Sure! With the generated Rust binding like that, developers can create their guest program in Rust and compile into core WebAssembly module without component model.
It'll be much more convenient to test and support this proposal.
As you see, almost no runtime except Wasmtime supports component model proposal.

Thanks!

@pchickey
Copy link
Contributor

The witx bindings provided by wasi-nn are for historical reasons because the proposal existed prior to wit. The wasi-nn team is coming up with their plan to retire those bindings, because maintaining a separate set is a considerable burden, and splits the ecosystem among two incompatible ABIs.

My understanding was that wasmedge has a component implementation in progress. I think our efforts, collectively, would be much better spent helping y’all get your component implementation completed rather than require proposals such as wasi-webgpu to come up with a representation and implementation of their spec in the legacy and incompatible witx ABI.

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

No branches or pull requests

3 participants