Describe how you would implement a distributed training pipeline using PyTorch's DistributedDataParallel (DDP). Implement a function that converts a configuration into a deterministic training-plan summary. Use the configured backend or default to nccl, compute the number of batches using ceiling division, and indicate that checkpointing is rank-zero-only and cleanup is required.
Input: A dictionary containing world_size, epochs, dataset_size, batch_size, and optional backend and seed values.
Output: A dictionary containing rank_count, batches_per_epoch, backend, checkpoint_rank_zero_only, and has_cleanup.
world_size, epochs, dataset_size, and batch_size are positive integers.dataset_size and batch_size are at most 10^9.backend, when present, is a string such as nccl or gloo.def build_ddp_training_plan(config):