DMC is a distributed deep learning training pipeline designed to enable collaborative model training across multiple machines using commodity hardware. It focuses on modularity, dataset sharding, adaptive communication, and orchestrated distributed training.
• Dataset Sharding Pipeline — splits datasets into shards using file-based or logically grouped strategies.
• HRW-based Distribution — assigns shards deterministically across nodes using rendezvous (HRW) hashing.
• Replica Shards — supports redundancy for fault recovery through replica placement.
• PyTorch Distributed Training — leverages PyTorch DDP for stable and scalable training.
• Ansible-based Orchestration — uses Ansible to coordinate multi-node execution.
• Adaptive Communication (AdaComm) — dynamically adjusts gradient synchronization frequency.
• Replication Factor — controls the redundancy of the dataset in the cluster to cater training takover in case of machine crash.
DMC operates as a pipeline with preprocessing and training stages.
The user provides a dataset on a master node.
DMC creates dataset shards using two strategies:
-
File-based sharding — for independent files.
-
Group-based sharding — preserves logical relationships.
Additional capabilities:
- User-defined shard sizing
- HRW hashing for shard-to-node assignment
- Replica shard placement for redundancy
Each worker node pulls its assigned shards from the master using a pull-based mechanism.
This completes preprocessing.
Training is orchestrated and executed in multiple layers:
-
Orchestration Layer
- Uses Ansible to launch distributed jobs across nodes
- Initializes training processes via a runner script
-
Distributed Environment
- Runner initializes a PyTorch Distributed (DDP) environment
- Environment can be torn down and recreated during failures
-
Data Loading
- Custom dataloader loads data from local shards
- No centralized dataset dependency during training
-
Training Execution
- User wraps optimizer with a DMC abstraction
- DMC internally uses PyTorch DDP for gradient synchronization
DMC implements adaptive gradient communication based on the paper: Adaptive Communication Strategies for Distributed SGD.
Key idea:
-
Early training → large gradients → less frequent communication
-
Later training → convergence phase → more frequent communication
Controlled via parameter:
- τ (tau) — number of local steps before synchronization
This reduces network overhead while maintaining convergence quality.
While not fully implemented, DMC architecture was designed keeping fault tolerance in mind. For example, we use the concept of Original and Replica Shards in order to ease machine training takeover in case of machine crash. The machine with the Replica shards can takeover the training which was originally assigned to the crashed machine. This data redundancy in the system is controlled by Replication Factor. The higher the replication factor, the more the fault tolerance capability.
-
Setup cluster nodes and ensure SSH + Ansible connectivity.
-
Populate nodes.txt and inventory.ini in the root with the master and worker IP addresses.
-
Place dataset on master node.
-
Run sharding logic on master node using
sharding_runner.pyto create shards.python3 sharding_runner.py /path/to/dataset --max-shard-size 4 --mode folder --depth 3
-
Run the puller.py on worker machines. Using:
python3 puller.py
-
Initiate the distributed training using the command:
ansible-playbook -i inventory.ini run_dmc.yml
• Fault tolerance is not yet implemented.
• Requires controlled network environment (LAN preferred).
• Robust fault tolerance with seamless recovery
• Improved monitoring and metrics