---
title: "Accelerate ND-Parallel: A guide to Efficient Multi-GPU Training"
description: "Accelerate's ParallelismConfig, also exposed through Axolotl config fields, lets you compose data parallelism, FSDP, tensor parallelism and context parallelism in one training setup."
url: "https://swe.quest/articles/accelerate-nd-parallel-a-guide-to-efficient-multi-gpu-training-b84f16c2d8888d39"
canonical: "https://huggingface.co/blog/accelerate-nd-parallel"
source: "Hugging Face"
published: "2025-08-08"
difficulty: "hard"
kind: "Deep dive"
reading_minutes: 18
tags: ["model-training","distributed-systems","python"]
---

# Accelerate ND-Parallel: A guide to Efficient Multi-GPU Training

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2025-08-08, 18 min read, Deep dive. Original: [https://huggingface.co/blog/accelerate-nd-parallel](https://huggingface.co/blog/accelerate-nd-parallel)

## Summary

Accelerate's ParallelismConfig, also exposed through Axolotl config fields, lets you compose data parallelism, FSDP, tensor parallelism and context parallelism in one training setup. The guide explains how each strategy trades memory for communication. FSDP shards weights, gradients and optimizer states and gathers each layer when needed. Tensor parallelism splits linear layers column-wise then row-wise so only one all-reduce is required, which makes it best kept within a single NVLink node. Context parallelism shards the sequence and uses RingAttention so very long contexts fit in memory. It then covers hybrid combinations such as HSDP, FSDP+TP and FSDP+CP, with guidance on matching each parallelism degree to intra-node versus inter-node bandwidth.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [Distributed systems](https://swe.quest/tags/distributed-systems.md) (Distributed systems)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- PyTorch distributed training ([easy posts on Model training](https://swe.quest/tags/model-training.md?difficulty=easy))
- transformer architecture ([easy posts on System design](https://swe.quest/tags/system-design.md?difficulty=easy))
- collective communication ops

## Keywords

Hugging Face Accelerate, Axolotl, FSDP, Tensor Parallelism, Context Parallelism, RingAttention, ZeRO-3, HSDP

## Related posts

- [Fully Sharded Data Parallel: faster AI training with fewer GPUs](https://swe.quest/articles/fully-sharded-data-parallel-faster-ai-training-with-fewer-gpus-9a4d28846db69a7b.md): Meta Engineering · 2021-07-15 · Hard · 8 min read · Model training, Python
  Fully Sharded Data Parallel (FSDP) shards model parameters, gradients and optimizer states across data-parallel GPU workers.
- [Accelerate Large Model Training using PyTorch Fully Sharded Data Parallel](https://swe.quest/articles/accelerate-large-model-training-using-pytorch-fully-sharded-data-parallel-513a65557fbde722.md): Hugging Face · 2022-05-02 · Hard · 12 min read · Model training, Machine learning, Python, Performance engineering
  Hugging Face Accelerate exposes PyTorch FullyShardedDataParallel (FSDP), which shards parameters, gradients and optimizer states across GPUs (ZeRO stage 2/3) with optional CPU offload, and does so without changes to training code.
- [Ulysses Sequence Parallelism: Training with Million-Token Contexts](https://swe.quest/articles/ulysses-sequence-parallelism-training-with-million-token-contexts-a21775c0b516e85a.md): Hugging Face · 2026-03-09 · Hard · 13 min read · Model training, LLMs, Distributed systems, Hardware
  Ulysses Sequence Parallelism, part of Snowflake's Arctic Long Sequence Training protocol, enables training on contexts of hundreds of thousands to millions of tokens.
- [Accelerate Large Model Training using DeepSpeed](https://swe.quest/articles/accelerate-large-model-training-using-deepspeed-d18dbe7623c821c0.md): Hugging Face · 2022-06-28 · Medium · 8 min read · Model training, Python, Performance engineering
  Hugging Face Accelerate can enable DeepSpeed ZeRO data parallelism, which shards optimizer states, gradients and parameters across GPUs and optionally offloads them to CPU, with no or minimal code changes.
- [From DeepSpeed to FSDP and Back Again with Hugging Face Accelerate](https://swe.quest/articles/from-deepspeed-to-fsdp-and-back-again-with-hugging-face-accelerate-15016dbd4b4a46b2.md): Hugging Face · 2024-06-13 · Hard · 6 min read · Model training, Machine learning, Python
  DeepSpeed ZeRO-3 and PyTorch FSDP gave different training results on Mistral-7B loaded in bfloat16 because DeepSpeed silently upcasts flattened parameters and optimizer state to fp32, while FSDP keeps them in the loaded dtype.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
