parse_deepspeed_config#

composer.distributed.parse_deepspeed_config(config, state)[source]#

Parses the provided DeepSpeed config for compatibility with the Mosaic trainer.

Broadly speaking, this function does three things.

  1. Check for settings that are unsupported, like DeepSpeed optimizers.

  2. Check for inconsistencies between Mosaic trainer config and DeepSpeed config.

  3. Use Mosaic trainer config to fill in some defaults for DeepSpeed config.

Parameters
Returns

dict[str, Any] โ€“ The DeepSpeed config updated with values from the arguments passed to the Trainer.

Raises
  • ValueError โ€“ If any of the values in the DeepSpeed config conflict with arguments passed to the trainer.

  • RuntimeError โ€“ If the batch size of the train dataloader in the provided state is not set.