Skip to main content

Crate tensor_wasm_snapshot

Crate tensor_wasm_snapshot 

Source
Expand description

Wasm + GPU memory snapshot and restore for fast cold-start.

Craton TensorWasm captures combined Wasm linear memory, GPU device-side memory, and register-file state into a single zstd-compressed bincode blob that can be persisted, shipped between nodes, and reloaded on demand. The writer module produces blobs from a live writer::InstanceState, while the reader module restores them with strict magic + version checking so malformed inputs are surfaced as errors rather than panics.

See FORMAT.md in the crate root for the on-disk wire layout, version history, and the size caps that bound restore-time memory pressure.

Re-exports§

pub use crate::format::SignatureKind;
pub use crate::format::ED25519_SIG_LEN;
pub use crate::format::ED25519_TRAILER_LEN;
pub use crate::format::HMAC_SHA256_SIG_LEN;
pub use crate::format::SIGNATURE_KIND_ED25519;
pub use crate::format::SIGNATURE_KIND_HMAC_SHA256;
pub use crate::format::SIGNATURE_TRAILER_LEN;
pub use crate::format::SNAPSHOT_VERSION_V2;
pub use crate::format::SNAPSHOT_VERSION_V3;
pub use crate::format::V3_TRAILER_MAGIC;
pub use crate::format::V3_TRAILER_MAGIC_LEN;
pub use crate::writer::limits;
pub use crate::writer::payload_crc32;
pub use crate::writer::Snapshot;
pub use crate::writer::SnapshotMetadata;

Modules§

aeadaead-at-rest
AEAD encryption-at-rest envelope for snapshot blobs (non-default aead-at-rest feature).
format
Wire-format version tags and signature-kind discriminants.
reader
SnapshotReader: restore a Snapshot from a compressed byte blob.
writer
SnapshotWriter: capture instance state into a self-describing byte blob.