Expand description
wasi-cuda host bridge — the explicit GPU kernel-launch API exposed to
Wasm modules.
Wasm code imports the functions defined in abi::MODULE and uses them
to upload PTX modules (abi::FN_LOAD_PTX) and launch kernels
(abi::FN_LAUNCH). On hosts without CUDA the host functions return
abi::AbiError::NotAvailable; on CUDA hosts they call into the
cust crate via the cuda feature.
See wit/wasi-cuda.wit at the workspace root for the Component-Model
interface definition (wasi:cuda/host@0.2.0) — the WIT and the
constants in abi are kept in lockstep.
The scheduler module exposes a separate wasi:scheduler/host@0.1.0
interface for cooperative deadlines (roadmap feature #4) — guests
offer suspend points via yield() and the host returns a non-zero
code when the per-instance deadline is approaching. See
docs/COOPERATIVE-YIELD.md.
Re-exports§
pub use host::InstanceMetricsSnapshot;pub use streaming::add_input_to_linker;pub use streaming::add_streaming_to_linker;pub use streaming::HasInput;pub use streaming::HasStreaming;pub use streaming::InputContext;pub use streaming::StreamingContext;pub use streaming::FN_EMIT_CHUNK;pub use streaming::FN_FLUSH;pub use streaming::FN_INPUT_LEN;pub use streaming::FN_READ_INPUT;pub use streaming::MAX_CHUNK_BYTES;pub use streaming::MAX_TOTAL_STREAM_BYTES;pub use streaming::STREAMING_MODULE;
Modules§
- abi
- ABI for the
wasi-cudaextension exposed to Wasm modules. - async_
dispatch - Async GPU dispatch & back-pressure.
- device_
mem DeviceMemRegistry— instance-scoped store of explicit device-memory allocations.- host
- Host-side implementations of the
wasi:cudafunctions registered withwasmtime::Linker. - kernel_
args - Typed argv lowering for the
wasi:cudalaunchhost function. - registry
KernelRegistry— instance-scoped store of compiled PTX kernels.- scheduler
wasi:scheduler/hostcooperative-deadline interface (roadmap feature #4).- streaming
wasi:tensor/hoststreaming surface (roadmap feature #2).