Stateful Classes

Below are variations of a singleton class in the sense that all instances share the same state, which is initialized on the first instantiation.

These classes are immutable and store information about certain configurations or states.

class accelerate.state.AcceleratorState

< >

( mixed_precision: str = None cpu: bool = False dynamo_backend = None deepspeed_plugin = None fsdp_plugin = None megatron_lm_plugin = None _from_accelerator: bool = False **kwargs )

Singleton class that has information about the current training environment.

Available attributes:

class accelerate.state.GradientState

< >

( )

Singleton class that has information related to gradient synchronization for gradient accumulation

Available attributes: