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

Named models for wasi-nn #6134

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

geekbeast
Copy link
Contributor

This PR implements named models for wasi-nn as discussed here WebAssembly/wasi-nn#36.

This PR adds a registry that tracks the byte level form of the models that can be populated from either the host or guest side. This will allow WASM host instances to reuse the same model multiple times without having to fully reload it. It currently imposes a hard-coded 10MB limit on the size of models that can be registered from a guest and extends the Backend wasi-nn API so that it can work directly with byte arrays, instead of passing through GuestPtr instances.

This implementation only caches the compiled graph for CPU execution targets as other targets may consume resources on GPU or TPU hardware, which is not possible to track in a straightforward fashion. In the future, it may become desirable to have visibility over resource usage so that hosts may make more sophisticated decisions about what models are fully cached for execution.

This PR also updates the WITX to the latest version of the spec as it was previously pointing to a much older commit.

This also updates wasmtime to use the latest version of the wasi-nn spec
instead of older commit.
@geekbeast geekbeast requested a review from a team as a code owner April 3, 2023 03:17
@geekbeast geekbeast requested review from pchickey and removed request for a team April 3, 2023 03:17
@geekbeast geekbeast requested a review from a team as a code owner April 3, 2023 03:19
@elliottt elliottt removed the request for review from a team April 18, 2023 23:13
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.

1 participant