You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the WASI specification with the component model / interface types specification as written today does not support a shared memory type. Mutable shared memory is an important capability for many kinds of software that have tight bounds on latency and/or would benefit from zero-copy IO, ranging from:
Virtual machines and emulators
High performance computing, especially networking and message passing interfaces
Databases software, especially with mmap backed buffers from the host
Video and audio streaming, as zero copy IO reduces latency and jitter, memory subsystem overhead
In fact, the current design of the WASI specification makes it more difficult to share memory between host and guest as compared to pre-component model specification, by constraining input & output codegen to specific named types.
There are many ways to address this gap, e.g.:
If certain types, like list<T> supported being declared as a borrow<list<T>>. In Rust, this would be received as a &mut [T], in JavaScript a TypedArray, and so on.
For a concrete use case, the Microsoft AI Controller Interface project uses shared memory to reduce latency on mutating moderately large arrays of floating point numbers representing the logits of a large language model.
It looks like the WASI specification with the component model / interface types specification as written today does not support a shared memory type. Mutable shared memory is an important capability for many kinds of software that have tight bounds on latency and/or would benefit from zero-copy IO, ranging from:
mmapbacked buffers from the hostIn fact, the current design of the WASI specification makes it more difficult to share memory between host and guest as compared to pre-component model specification, by constraining input & output codegen to specific named types.
There are many ways to address this gap, e.g.:
list<T>supported being declared as aborrow<list<T>>. In Rust, this would be received as a&mut [T], in JavaScript aTypedArray, and so on.For a concrete use case, the Microsoft AI Controller Interface project uses shared memory to reduce latency on mutating moderately large arrays of floating point numbers representing the logits of a large language model.