Accelerate v1.10.0

v1.10.0

v1.10.0: N-D Parallelism

Added 3
  • Introduce ParallelismConfig to allow applying any combination of parallelism strategies (TP, CP, DP) directly in training scripts
  • Add Parallelism getter property to Accelerator class
  • Allow FSDP ignored modules to be specified as regex patterns
Changed 5
  • Update context parallel to v2.0
  • Set parallelism_config in Accelerator constructor to prevent reset of State by Trainer
  • Optimize CpuOffload pre_forward to skip moving tensors if already on device
  • Make environment variable values case-insensitive in Accelerate
  • Remove use_ipex
Fixed 4
  • Set default submesh_tp_size to prevent unset local variable error
  • Fix prepare method to work when only tensor parallelism is specified
  • Fix tensor parallelism size to be read from environment variables
  • Fix FSDP ignored modules attribute to enable training PEFT models with MoE layers containing q_proj and v_proj parameters

N-D Parallelism

Training large models across multiple GPUs can be complex, especially when combining different parallelism strategies (e.g TP, CP, DP). To simplify this process, we've collaborated with Axolotl to introduce an easy-to-use integration that allows you to apply any combination of parallelism strategies directly in your training script. Just pass a ParallelismConfig specifying the size of each parallelism type—it's that simple. Learn more about how it works in our latest blogpost.

parallelism_config = ParallelismConfig(
    dp_shard_size=2,
    dp_replicate_size=2,
    cp_size=2,
    tp_size=2,
)
accelerator = Accelerator(
    parallelism_config=parallelism_config,
   ...
)
model = AutoModelForCausalLM.from_pretrained("your-model-name", device_mesh=accelerator.torch_device_mesh)
model = accelerator.prepare(model)

FSDP improvements

We've fixed ignored modules attribute. With this, it is now possible to train PEFT model that moe layers that contrains q_proj and v_proj parameters. This is especially important for fine-tuning gpt-oss model.

Minor improvements

New Contributors

Full Changelog: https://github.com/huggingface/accelerate/compare/v1.9.0...v1.10.0

View original

Upgraded? How did it go?

Discussion