Module: tide.storage
Snapshot storage helpers for backward propagation.
Functions
Section titled “Functions”- storage_mode_to_int
Storage Modes
Section titled “Storage Modes”- device: snapshots stay on compute device, fastest and most memory-heavy
- cpu: host-backed storage, lower device memory use
- disk: file-backed storage, smallest memory footprint and highest latency
- none: disable snapshot storage
The user-facing APIs also accept auto, which chooses mode based on configured byte limits.
storage_mode_to_int
Section titled “storage_mode_to_int”Maps mode strings to backend integer constants used by native kernels.
Compression
Section titled “Compression”- storage_compression supports none and bf16 on default compute path
- bf16 storage is valid for float32 workflows
See Also
Section titled “See Also”- Configuration explains memory limits and chunking.
- Limitations lists backend-specific constraints.
Structured storage policy
Section titled “Structured storage policy”Application code should construct StorageOptions rather than call backend
integer helpers:
storage = tide.StorageOptions( mode=tide.StorageMode.CPU, compression=False, bytes_limit_device=None, bytes_limit_host=None, chunk_steps=0,)Internally, resolve_snapshot_storage converts this policy into an immutable
SnapshotStorageSpec containing normalized mode, representation, sample count,
and shot shape. SnapshotAllocator then owns the concrete device, host, or disk
buffers.
Disk allocations use tempfile.TemporaryDirectory; the allocator retains its
lifetime and cleanup responsibility.
Capacity planning
Section titled “Capacity planning”auto placement considers configured byte limits, not every allocation in the
process. Reserve headroom for live fields, model gradients, optimizer state,
receiver tensors, and runtime libraries. Validate the resolved mode during a
small run before scaling the shot batch.