API reference
latest (dev)
Copy
Latest development documentation · Updated 2026-10-08
tensorplay.distributed.checkpoint API
Functions 12
async_save
functionFull reference ↗- tensorplay.distributed.checkpoint.async_save(state_dict, *, checkpoint_id=None, storage_writer=None, planner=None, process_group=None, async_checkpointer_type: AsyncCheckpointerType = AsyncCheckpointerType.THREAD, async_stager: AsyncStager | None = None, no_dist=False, use_collectives=True) Future[Any] | AsyncSaveResponse[source]
Stage the input and execute the checkpoint write asynchronously.
get_model_state_dict
functionFull reference ↗get_optimizer_state_dict
functionFull reference ↗get_state_dict
functionFull reference ↗load_sharded_optimizer_state_dict
functionFull reference ↗load_state_dict
functionFull reference ↗load
functionFull reference ↗save_state_dict
functionFull reference ↗save
functionFull reference ↗set_model_state_dict
functionFull reference ↗set_optimizer_state_dict
functionFull reference ↗set_state_dict
functionFull reference ↗Classes 36
AsyncCheckpointerType
classFull reference ↗- class tensorplay.distributed.checkpoint.AsyncCheckpointerType(*values)[source]
AsyncSaveResponse
classFull reference ↗- class tensorplay.distributed.checkpoint.AsyncSaveResponse(staging_completion: 'Future[None]', upload_completion: 'Future[Any]')[source]
BytesIOWriteData
classFull reference ↗- class tensorplay.distributed.checkpoint.BytesIOWriteData(nbytes: 'int')[source]
BytesStorageMetadata
classFull reference ↗- class tensorplay.distributed.checkpoint.BytesStorageMetadata[source]
CheckpointableTensor
classFull reference ↗- class tensorplay.distributed.checkpoint.CheckpointableTensor(*args, **kwargs)[source]
ChunkStorageMetadata
classFull reference ↗- class tensorplay.distributed.checkpoint.ChunkStorageMetadata(offsets: 'tuple[int, ...]', sizes: 'tuple[int, ...]')[source]
DefaultLoadPlanner
classFull reference ↗DefaultSavePlanner
classFull reference ↗FileSystem
classFull reference ↗- class tensorplay.distributed.checkpoint.FileSystem[source]
FileSystemBase
classFull reference ↗- class tensorplay.distributed.checkpoint.FileSystemBase[source]
FileSystemReader
classFull reference ↗FileSystemWriter
classFull reference ↗- class tensorplay.distributed.checkpoint.FileSystemWriter(path: str | PathLike[str], single_file_per_rank: bool = True, sync_files: bool = True, thread_count: int = 1, per_thread_copy_ahead: int = 10000000, cache_staged_state_dict: bool = False, overwrite: bool = True, _extensions: Sequence[StreamTransformExtension] | None = None, serialization_format: SerializationFormat = SerializationFormat.TORCH_SAVE)[source]
HuggingFaceStorageReader
classFull reference ↗HuggingFaceStorageWriter
classFull reference ↗LoadItemType
classFull reference ↗- class tensorplay.distributed.checkpoint.LoadItemType(*values)[source]
LoadPlan
classFull reference ↗- class tensorplay.distributed.checkpoint.LoadPlan(items: 'list[ReadItem]', storage_data: 'Any' = None, planner_data: 'Any' = None)[source]
LoadPlanner
classFull reference ↗- class tensorplay.distributed.checkpoint.LoadPlanner[source]
MegaStorageReader
classFull reference ↗- class tensorplay.distributed.checkpoint.MegaStorageReader(path: str | PathLike)[source]
Reads MEGA checkpoints produced by
MegaStorageWriter(.megashards described bymodel.mega.index.json).
MegaStorageWriter
classFull reference ↗Metadata
classFull reference ↗- class tensorplay.distributed.checkpoint.Metadata(state_dict_metadata: 'dict[str, TensorStorageMetadata | BytesStorageMetadata]', planner_data: 'Any' = None, storage_data: 'Any' = None, storage_meta: 'StorageMeta | None' = None, version: 'str | None' = None)[source]
MetadataIndex
classFull reference ↗- class tensorplay.distributed.checkpoint.MetadataIndex(fqn: 'str', offset: 'Sequence[int] | None' = None, index: 'int | None' = None) 'None'[source]
QuantizedHuggingFaceStorageReader
classFull reference ↗ReadItem
classFull reference ↗- class tensorplay.distributed.checkpoint.ReadItem(type: 'LoadItemType', dest_index: 'MetadataIndex', dest_offsets: 'tuple[int, ...]', storage_index: 'MetadataIndex', storage_offsets: 'tuple[int, ...]', lengths: 'tuple[int, ...]')[source]
SavePlan
classFull reference ↗- class tensorplay.distributed.checkpoint.SavePlan(items: 'list[WriteItem]', storage_data: 'Any' = None, planner_data: 'Any' = None, usable: 'bool' = True)[source]
SavePlanner
classFull reference ↗- class tensorplay.distributed.checkpoint.SavePlanner[source]
SerializationFormat
classFull reference ↗- class tensorplay.distributed.checkpoint.SerializationFormat(*values)[source]
StateDictOptions
classFull reference ↗- class tensorplay.distributed.checkpoint.StateDictOptions(full_state_dict: 'bool' = False, cpu_offload: 'bool' = False, ignore_frozen_params: 'bool' = False, keep_submodule_prefixes: 'bool' = True, strict: 'bool' = True, broadcast_from_rank0: 'bool' = False, flatten_optimizer_state_dict: 'bool' = False, dsd_fqn_modifiers: 'str' = '_fqn_modifiers')[source]
Stateful
classFull reference ↗- class tensorplay.distributed.checkpoint.Stateful(*args, **kwargs)[source]
StorageMeta
classFull reference ↗- class tensorplay.distributed.checkpoint.StorageMeta(checkpoint_id: 'str | os.PathLike[str] | None' = None, save_id: 'str | None' = None, load_id: 'str | None' = None, modules: 'list[str]' = <factory>)[source]
StorageReader
classFull reference ↗- class tensorplay.distributed.checkpoint.StorageReader[source]
StorageWriter
classFull reference ↗- class tensorplay.distributed.checkpoint.StorageWriter[source]
TensorProperties
classFull reference ↗- class tensorplay.distributed.checkpoint.TensorProperties(dtype: 'Any' = <factory>, layout: 'Any' = <factory>, requires_grad: 'bool' = False, memory_format: 'Any' = <factory>, pin_memory: 'bool' = False)[source]
TensorStorageMetadata
classFull reference ↗- class tensorplay.distributed.checkpoint.TensorStorageMetadata(properties: 'TensorProperties', size: 'tuple[int, ...]', chunks: 'list[ChunkStorageMetadata]')[source]
TensorWriteData
classFull reference ↗- class tensorplay.distributed.checkpoint.TensorWriteData(chunk: 'ChunkStorageMetadata', properties: 'TensorProperties', size: 'tuple[int, ...]')[source]
WriteItem
classFull reference ↗- class tensorplay.distributed.checkpoint.WriteItem(index: 'MetadataIndex', type: 'WriteItemType', bytes_io_data: 'BytesIOWriteData | None' = None, tensor_data: 'TensorWriteData | None' = None)[source]
WriteItemType
classFull reference ↗- class tensorplay.distributed.checkpoint.WriteItemType(*values)[source]
Exceptions 1
CheckpointException
exceptionFull reference ↗- exception tensorplay.distributed.checkpoint.CheckpointException(msg: str, failures: dict[int, tuple[BaseException, StackSummary]])[source]
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?
tensorplay.distributed.autograd API
Complete API reference for tensorplay.distributed.autograd, including signatures, parameters, examples and members.
tensorplay.distributed.device_mesh API
Complete API reference for tensorplay.distributed.device_mesh, including signatures, parameters, examples and members.

