composer.utils#

Modules

composer.utils.batch_helpers

Helpers to get items and set items in a batch.

composer.utils.checkpoint

Utilities for working with training checkpoints.

composer.utils.collect_env

Helpers to gather system information for debugging and bug reporting.

composer.utils.dist

Helper methods for torch.distributed.

composer.utils.file_helpers

Helpers for working with files.

composer.utils.fx_utils

FX-based model transformation and optimization.

composer.utils.import_helpers

Dynamically import a Python object (e.g.

composer.utils.iter_helpers

Utilities for iterating over collections.

composer.utils.module_surgery

Modify model architectures.

composer.utils.object_store

Object store base class and implementations.

composer.utils.reproducibility

Helper utilities for configuring deterministic training to ensure reproducibility.

composer.utils.retrying

Retry helper.

composer.utils.string_enum

Base class for Enums containing string values.

Helper utilities.

Functions

batch_get

Indexes into the batch given the key.

batch_set

Indexes into the batch given the key and sets the element at that index to value.

configure_excepthook

Collect and print system information when sys.excepthook() is called.

create_symlink_file

Create a symlink file, which can be followed by get_file().

disable_env_report

Disable environment report generation on exception.

enable_env_report

Enable environment report generation on exception.

ensure_folder_has_no_conflicting_files

Ensure that the given folder does not have any files conflicting with the filename format string.

ensure_folder_is_empty

Ensure that the given folder is empty.

ensure_tuple

Converts x into a tuple.

format_name_with_dist

Format format_str with the run_name, distributed variables, and extra_format_kwargs.

format_name_with_dist_and_time

Format format_str with the run_name, distributed variables, timestamp, and extra_format_kwargs.

get_file

Get a file from a local folder, URL, or object store.

import_object

Dynamically import a Python object (e.g.

is_tar

Returns whether name has a tar-like extension.

load_checkpoint

Load a checkpoint from a local file, URI, or cloud object store into state.

map_collection

Applies map_fn on each element in collection.

print_env

Generate system information report.

retry

Decorator to retry a function with backoff and jitter.

save_checkpoint

Checkpoint the training state.

Classes

IteratorFileStream

Class used to convert iterator of bytes into a file-like binary stream object.

LibcloudObjectStore

Utility for uploading to and downloading from object (blob) stores, such as Amazon S3.

ObjectStore

Abstract class for implementing object stores, such as LibcloudObjectStore and S3ObjectStore.

StringEnum

Base class for Enums containing string values.

Exceptions

MissingConditionalImportError

Handles errors for external packages that might not be installed.

ObjectStoreTransientError

Custom exception class to signify transient errors.