Skip to content

Module: tide.storage

Snapshot storage helpers for backward propagation.

  • storage_mode_to_int
  • device: snapshots stay on the compute device
  • none: disable snapshot storage
  • auto: use device storage subject to bytes_limit_device

Maps mode strings to backend integer constants used by native kernels.

  • bf16 storage is valid for float32 workflows and reduces snapshot capacity

Application code should construct StorageOptions rather than call backend integer helpers:

storage = tide.StorageOptions(
mode=tide.StorageMode.AUTO,
compression="bf16",
bytes_limit_device=6 * 1024**3,
)

Internally, resolve_snapshot_storage converts this policy into an immutable SnapshotStorageSpec containing normalized mode, representation, sample count, and shot shape. SnapshotAllocator owns the concrete device buffers for one forward/backward lifetime.

auto compares the required snapshot capacity with bytes_limit_device. Exceeding that limit raises MemoryError; it does not spill snapshots to host memory or disk. Reserve headroom for live fields, model gradients, optimizer state, receiver tensors, and runtime libraries.