Skip to main content
XenonStack

Enterprise AI

XenonStack Blog Distributed Machine Learning: Frameworks and Parallelism

| Published | Updated

Distributed Machine Learning: Frameworks and Parallelism
20:24

Key takeaway

  • Distributed machine learning in 2027: data, FSDP, tensor and pipeline parallelism, PyTorch, DeepSpeed, Ray and Spark compared, plus what is now archived.

Distributed machine learning spreads the work of training a model across many GPUs or machines so that models and datasets too large for one device can still be trained in reasonable time. In 2026 the practical choice is less about which framework and more about which parallelism: data parallelism for most jobs, sharded data parallelism (PyTorch FSDP or DeepSpeed ZeRO) when the model no longer fits, and tensor or pipeline parallelism only at very large scale.

The framework landscape has also changed. Horovod and Microsoft CNTK are now archived, PyTorch has deprecated its original FSDP API in favour of FSDP2, and Spark MLlib remains the choice for classical machine learning on tabular data rather than deep learning. This guide sets out what each option does, when it fits and its current status.

What is distributed machine learning?

Distributed machine learning, often called distributed training, splits the workload of training a model across several worker processes, usually one per GPU, that run in parallel and stay in sync. Microsoft's Azure Machine Learning documentation describes the two main types as data parallelism and model parallelism, and notes that the approach suits compute-intensive deep learning better than traditional machine learning models.

For enterprise teams the question is practical: how to train or fine-tune a model faster, or at all, without rewriting code for every new cluster. The answer depends on whether the bottleneck is the size of the data, the size of the model, or both. Teams training classical models on large tables have different needs from teams fine-tuning neural network models with billions of parameters. For LLM fine-tuning in particular, AgentInstruct provides instruction data for LLM tuning.

What are the four types of parallelism, and when does each fit?

Most modern frameworks combine four building blocks. The table below summarises them for decision makers.

Two-column diagram: four training bottlenecks mapped to data parallelism, sharded data parallelism (FSDP2, ZeRO), offload, and 2D or 3D parallelism
Parallelism What is split When it fits Main cost
Data parallelism (for example PyTorch DDP) The data. Every worker holds a full copy of the model and processes a different batch. The model fits on one GPU and you want to train faster on more data. Gradient synchronisation (all-reduce) after each step.
Sharded data parallelism (PyTorch FSDP2, DeepSpeed ZeRO) The data, plus parameters, gradients and optimiser states, which are sharded across workers. The model, its gradients and optimiser state no longer fit on one GPU. More communication (all-gather and reduce-scatter).
Tensor parallelism Individual layers. Weight matrices are split column-wise or row-wise across devices. Very large Transformer models, usually inside a single server with fast GPU links. Blocking communication inside every layer.
Pipeline parallelism The model's layers, grouped into stages on different devices, with each batch split into micro-batches. Deep models that must span many servers. Idle time ("bubbles") while stages wait for each other.

Data parallelism vs model parallelism

In data parallelism each worker keeps a full model replica. The PyTorch DDP tutorial explains that DistributedDataParallel runs one process per model replica and uses collective communication to synchronise gradients and buffers across all processes during the backward pass. It is multi-process and works on one or many machines, unlike the older single-machine DataParallel, which the tutorial says is usually slower even on one machine.

Model parallelism, by contrast, splits the model itself, either layer by layer (pipeline) or within layers (tensor). Microsoft's distributed GPU training guide advises that more than 90% of the time you should use distributed data parallelism. That is a sensible default: reach for model parallelism only when memory forces you to.

Sharded data parallelism: FSDP and ZeRO

Sharding sits between the two. According to the PyTorch FSDP2 tutorial, FSDP reduces GPU memory by sharding model parameters, gradients and optimiser states, gathering parameters just before forward and backward computation, and can be seen as a decomposition of DDP's all-reduce into reduce-scatter and all-gather operations. The same page states that FSDP1 is deprecated and recommends the newer fully_shard API (FSDP2), which represents shards as DTensors and aims for lower, more deterministic memory use.

DeepSpeed's ZeRO follows the same idea in stages. The DeepSpeed ZeRO tutorial describes Stage 1 as partitioning optimiser states, Stage 2 as also partitioning gradients, and Stage 3 as also partitioning the model parameters. ZeRO-Offload moves optimiser and gradient state to CPU memory, and ZeRO-Infinity can offload to both CPU and NVMe storage.

Tensor and pipeline parallelism

The PyTorch tensor parallel tutorial describes tensor parallelism as an efficient model parallelism technique for large Transformer models, usually paired with sequence parallelism to cut activation memory. It recommends applying tensor parallelism within each host and FSDP across hosts, and notes that FSDP alone starts to slow down when collectives exceed roughly 128 to 256 GPUs. Pipeline parallelism, covered in the PyTorch pipelining tutorial, splits a model into stages and feeds micro-batches through schedules such as GPipe, 1F1B and Interleaved1F1B.

Which distributed machine learning frameworks matter going into 2027?

The table below lists the main options, what each is for and its current status, checked against each project's own pages in November 2026.

Framework What it does When it fits Status (Nov 2026)
PyTorch DDP Multi-process data parallelism with gradient all-reduce. Default for PyTorch models that fit on one GPU. Active, part of PyTorch.
PyTorch FSDP2 (fully_shard) Shards parameters, gradients and optimiser states; combines with tensor parallelism on a device mesh. Large-model training and fine-tuning in native PyTorch. Active. FSDP1 (FullyShardedDataParallel) is deprecated.
DeepSpeed ZeRO stages 1 to 3, CPU and NVMe offload, 3D parallelism and mixture-of-experts support. Very large models, memory-constrained clusters, offload to CPU or NVMe. Active; news items dated May 2026 on the project site.
Ray Train Orchestrates distributed training on a Ray cluster for PyTorch, Lightning, Hugging Face, DeepSpeed, TensorFlow, XGBoost and LightGBM. Teams that want one layer for scaling training from a laptop to a cluster. Active.
TensorFlow tf.distribute MirroredStrategy, MultiWorkerMirroredStrategy, TPUStrategy, with ParameterServerStrategy and CentralStorageStrategy still experimental. Existing TensorFlow and Keras estates, TPU training. Active. Estimators are not recommended for new code.
JAX Compiler-driven sharding over a named device Mesh, with automatic, explicit and manual (shard_map) modes. Research teams and TPU-heavy workloads. Active.
Apache Spark MLlib Distributed classical ML (classification, regression, clustering, collaborative filtering) on DataFrames. Large tabular data already in Spark or a lakehouse. Active (Spark 4.3.0 docs). RDD-based API in maintenance mode.
Horovod All-reduce data parallelism for TensorFlow, Keras and PyTorch. Legacy jobs only. Archived on GitHub, 17 September 2026, due to inactivity.
Microsoft CNTK Deep learning toolkit with distributed training. None for new work. Archived on GitHub, 17 February 2026. Last release 2.7 (2019).
Apache Mahout (Classic) MapReduce and Samsara-era scalable ML algorithms. None for new work. Maintenance mode; the project now focuses on quantum computing (Qumat, QDP).

PyTorch: DDP and FSDP2

For most enterprise deep learning, native PyTorch is now the starting point. DDP covers models that fit on a single GPU. FSDP2 covers models that do not, and the tensor parallel tutorial shows how to combine it with tensor parallelism through a 2D device mesh. If your code still uses FullyShardedDataParallel, plan a migration, because PyTorch's own documentation marks it as deprecated.

DeepSpeed ZeRO

DeepSpeed's project site lists ZeRO, 3D parallelism, DeepSpeed-MoE and ZeRO-Infinity among its system innovations, and describes DeepSpeed as part of Microsoft's AI at Scale initiative. It is a strong fit when GPU memory is the constraint and offload to CPU or NVMe is acceptable. Azure Machine Learning supports DeepSpeed as a top-level feature, according to Microsoft's guide.

Ray Train

Ray Train is a library for distributed training and fine-tuning that scales training code from a single machine to a cluster. It does not replace DDP, FSDP or DeepSpeed; it runs them. That makes it useful for platform teams that want a common scheduling and fault-handling layer across PyTorch, Hugging Face and gradient-boosting workloads.

TensorFlow distribution strategies and JAX

The TensorFlow distributed training guide lists MirroredStrategy for synchronous training on several GPUs in one machine, MultiWorkerMirroredStrategy across machines and TPUStrategy for TPUs. ParameterServerStrategy and CentralStorageStrategy are still marked experimental, and Estimators are not recommended for new code. JAX takes a compiler-first approach: you arrange devices into a named Mesh, describe how arrays are sharded, and either let the compiler insert communication or write collectives yourself with shard_map.

Spark MLlib for classical machine learning

Spark MLlib is still the practical choice for distributed classical machine learning on large tables, such as the alternating least squares (ALS) method used for recommendations. The MLlib guide (Spark 4.3.0) confirms that the DataFrame-based spark.ml API is primary and the RDD-based spark.mllib API is in maintenance mode, though neither is deprecated. For deep learning on Spark clusters, Microsoft's Azure Databricks documentation describes TorchDistributor as an open-source PySpark module that launches PyTorch training jobs as Spark jobs. See our guide to Apache Spark architecture for how the cluster model works.

What has changed since this guide was first written?

  • Horovod is archived. The Horovod GitHub repository was archived on 17 September 2026 and its README now reads "Horovod (inactive)". The LF AI & Data project page states that the TAC and Governing Board voted to archive it in September 2026.

  • CNTK is archived. The CNTK repository was archived on 17 February 2026; version 2.7 was announced as the last main release with no plans for new features.

  • Mahout has moved on. The Apache Mahout site says Mahout Classic (Samsara and MapReduce) is in maintenance mode and current work is on quantum tools.

  • FSDP1 is deprecated in favour of FSDP2 (fully_shard).

  • Cloud services have been renamed. Google's distributed training documentation now redirects to pages titled Gemini Enterprise Agent Platform. Amazon's service is now documented as SageMaker AI.

Which cloud platforms support distributed training?

Platform Distributed training support (from vendor documentation)
Amazon SageMaker AI Distributed training libraries for data and model parallel jobs, plus support for PyTorch DDP, torchrun and MPI. The model parallelism library v2 aligns its APIs with PyTorch FSDP and adds hybrid sharded data parallelism, tensor parallelism and activation offloading, on training jobs or SageMaker HyperPod clusters.
Azure Machine Learning PyTorch, TensorFlow and DeepSpeed distributed jobs, with InfiniBand acceleration described in the distributed GPU training guide.
Google Cloud Distributed training jobs, now documented under Gemini Enterprise Agent Platform (formerly Vertex AI training).
Databricks Distributed deep learning with Ray, TorchDistributor and DeepSpeed, and a notebook @distributed API (in Beta) for DDP, FSDP and DeepSpeed, according to Microsoft's Azure Databricks documentation.

What are the benefits and challenges?

Benefits

  • Shorter training time: parallel workers process more data per step, so experiments finish sooner.

  • Larger models: sharding and model parallelism let you train or fine-tune models that cannot fit in one GPU's memory.

  • Use of existing infrastructure: Spark MLlib and TorchDistributor let teams train where their data already lives. For AI that must also run on-premises or across hybrid estates, NexaStack is an agentic operating platform for physical AI that runs across on-premises, cloud and hybrid environments.

Challenges

  • Communication overhead: all-reduce, all-gather and pipeline hand-offs can dominate step time, especially across slower links between servers.

  • Convergence: as the PyTorch tensor parallel tutorial notes, the global batch size cannot keep growing with GPU count without hurting convergence, which limits pure data parallelism.

  • Fault tolerance: a long job across many nodes is more exposed to a single failure, so checkpointing and restart policies matter.

  • Heterogeneous hardware: mixed GPU types or network speeds create stragglers and complicate scheduling.

How should enterprises govern cost and security?

Distributed training multiplies GPU hours, so cost control starts with the parallelism choice. Use plain DDP when the model fits; sharding and offload add communication that you pay for in time. Track utilisation per job, cap cluster size per project, and checkpoint so that interrupted jobs resume rather than restart.

On security, treat training clusters as production systems. Restrict who can launch multi-node jobs, keep training data access governed by the same policies as the source systems, log which dataset and code version produced each model, and remove archived frameworks such as Horovod and CNTK from approved images, since they no longer receive fixes. Our MLOps guide covers how to fold these controls into a model lifecycle, and our article on machine learning in cybersecurity covers wider ML security concerns. When trained models go on to drive AI agents, ElixirData Context OS keeps governed context, versioned policy and decision traces in one decision layer above those agents.

What should you plan for in 2027?

The guidance in this guide carries into the next planning cycle. Three points belong in the plan.

  • Migrate off deprecated and archived tools. Move any FullyShardedDataParallel code to FSDP2 (fully_shard), move Horovod and CNTK jobs to PyTorch DDP or FSDP2, TensorFlow distribution strategies or DeepSpeed, and remove them from approved images.
  • Scale in the same order. Profile on one GPU, use DDP first, shard with FSDP2 or ZeRO when memory runs out, and add tensor or pipeline parallelism only for very large models.
  • Keep governing cost and security. Cap cluster size per project, checkpoint long jobs, log which dataset and code version produced each model, and recheck each framework's status before you commit budget.

What is a sensible adoption sequence?

  1. Profile on one GPU. Confirm the bottleneck is compute or memory, not data loading.

  2. Scale out with DDP (or MirroredStrategy in TensorFlow) on one multi-GPU server, then across servers.

  3. Shard when memory runs out with FSDP2 or DeepSpeed ZeRO, adding CPU or NVMe offload only if needed.

  4. Add tensor and pipeline parallelism only for very large Transformer models or very large GPU counts.

  5. Standardise orchestration with Ray Train, a managed cloud service or Databricks so that teams share images, quotas and monitoring.

When should you not distribute training?

Do not distribute by default. If a model trains in acceptable time on one GPU, adding workers brings communication cost, debugging effort and more failure points for little gain. Classical models on moderate data are often better served by a single large machine. Fine-tuning a pre-trained model with parameter-efficient methods may also fit on one device. Start simple and scale only when measurements show you need to. For help choosing tooling, see our overview of machine learning tools or our machine learning development services.

To map one model-driven decision your agents should make, and the context and policy it depends on, book a Context Workshop. See what happens in the workshop.

Related on XenonStack

Frequently asked questions

What is the difference between data parallelism and model parallelism?

Data parallelism gives every worker a full copy of the model and a different slice of the data, then synchronises gradients. Model parallelism splits the model itself across devices, either by layer (pipeline) or within layers (tensor). Microsoft advises using distributed data parallelism more than 90% of the time.

What is FSDP?

Fully Sharded Data Parallel is PyTorch's sharded data parallelism. It shards parameters, gradients and optimiser states across GPUs to cut memory per device. The original FSDP1 API is deprecated; new work should use FSDP2 (fully_shard).

Is Horovod still maintained?

No. The Horovod repository was archived on 17 September 2026 due to inactivity, and LF AI & Data voted to archive the project in September 2026. Existing jobs should move to PyTorch DDP or FSDP2, TensorFlow distribution strategies, or DeepSpeed.

How do DeepSpeed ZeRO stages differ?

Stage 1 partitions optimiser states, Stage 2 also partitions gradients, and Stage 3 also partitions model parameters. ZeRO-Offload and ZeRO-Infinity can move state to CPU memory and, for ZeRO-Infinity, NVMe storage.

Is Spark MLlib still relevant?

Yes, for classical machine learning on large tabular data. The DataFrame-based API is primary in Spark 4.3.0, and the RDD-based API is in maintenance mode but not deprecated.

Next Steps with Machine Learning Framework

Talk to our experts about implementing compound AI systems and how industries and departments leverage Machine Learning frameworks and Decision Intelligence to become decision-centric. We utilize AI to automate and optimize IT support and operations, enhancing efficiency and responsiveness.

 

Follow XenonStack on LinkedIn: XenonStack on LinkedIn for new guides on agentic AI, data and platform engineering.

Ready to put AI agents to work? Explore ElixirClaw, the agentic OS platform to build, orchestrate and govern AI agents.

Table of Contents

dr-jagreet-gill

Dr. Jagreet Kaur

Chief AI Officer, XenonStack

LinkedIn profile

Dr. Jagreet Kaur specializing in Generative AI for synthetic data, Conversational AI, and Intelligent Document Processing. With a focus on responsible AI frameworks, compliance, and data governance, she drives innovation and transparency in AI implementation

Get the latest articles in your inbox

Subscribe Now

Interested in solving your challenges with the XenonStack team?
Get Started

Tell us about you and your priorities so we can prepare the right conversation. It takes about 2 minutes.

Please Select your Industry
Banking
Fintech
Payment Providers
Wealth Management
Discrete Manufacturing
Semiconductor
Machinery Manufacturing / Automation
Appliances / Electrical / Electronics
Elevator Manufacturing
Defense & Space Manufacturing
Computers & Electronics / Industrial Machinery
Motor Vehicle Manufacturing
Food and Beverages
Distillery & Wines
Beverages
Shipping
Logistics
Mobility (EV / Public Transport)
Energy & Utilities
Hospitality
Digital Gaming Platforms
SportsTech with AI
Public Safety - Explosives
Public Safety - Firefighting
Public Safety - Surveillance
Public Safety - Others
Media Platforms
City Operations
Airlines & Aviation
Defense Warfare & Drones
Robotics Engineering
Drones Manufacturing
AI Labs for Colleges
AI MSP / Quantum / AGI Institutes
Retail Apparel and Fashion

Continue