Distributed deep learning is an inevitable choice in learning large-scale deep learning models today. Beyond a certain level, training deep learning models can take days or months, which can lead to catastrophic consequences in applications that require rapid trend reflection or decision-making. Distributed deep learning is largely divided into synchronous and asynchronous methods according to the synchronization method at the time of parameter update. The former updates the parameter with the average value of the gradient calculated by all workers, and there is a problem that the processing speed is matched to the slowest worker. The latter is faster because it updates the parameters without waiting for the slowest worker, but converges more slowly to the optimal state due to the stale gradient problem. This paper introduces two distributed learning methods that address the straggler issue while preserving the speed and convergence rate of synchronous methods in straggler-free environments. First, Dynamic Partial All-Reduce is proposed as a distributed learning algorithm that employs a synchronous method while autonomously managing worker participation in global synchronization to effectively mitigate the impact of the straggler problem. In this algorithm, if a slow worker is detected, the influence of the straggler is limited by excluding the worker from global communication and allowing the remaining workers to update the parameters. Then, when the slow worker recovers the normal speed, it returns to the synchronization group again. In this way, the decision is made by comparing what causes the greater loss in speed and convergence between the loss of computational power due to the exclusion of one GPU from the learning process, the omission of as much learning data as distributed to the worker, and the slowdown due to straggler. Next, a proposal is made for Adaptive Weighted All-Reduce, which is a distributed deep learning algorithm designed to identify randomly occurring stragglers using worker performance profiling information. AWAR then robustly responds to the resulting slowdown in the learning task caused by these stragglers. While learning is in progress through synchronization in the normal worker group, workers classified as stragglers participate in learning asynchronously, so the straggler effect can be minimized and the GPU computational resources of the straggler can be maximally utilized. Since the weighted model averaging is performed every epoch based on the number of gradient updates, the effect of learning quality deterioration due to premature model is adaptively controlled and the convergence rate is comparable to that of Ring-All Reduce. These algorithms were implemented using PyTorch and Horovod, and all experiments were conducted on Tencent Cloud.
분산 딥러닝은 오늘날 대규모 딥러닝 모델을 학습하는 데 있어 불가피한 선택이다. 일정 규모 이상의 딥러닝 모델을 학습하는 데는 며칠에서 몇 달까지도 소요될 수 있다. 이는 신속한 추세 반영 또는 의사 결정이 필요한 애플리케이션에서 치명적인 결과를 초래한다. 데이터 병렬 처리 유형에 속하는 분산 딥러닝의 경우, 파라미터 업데이트 시점의 동기화 방식에 따라 크게 동기식과 비동기식으로 나뉜다. 전자는 모든 워커가 계산한 그래디언트의 평균값으로 매개변수를 업데이트하는데, 처리 속도가 가장 느린 워커에게 맞춰지는 문제가 있다. 후자는 가장 느린 워커를 기다리지 않기 때문에 더 빠르지만, 이전 시점의 모델을 기준으로 계산된 그래디언트가 매개변수 업데이트에 활용되는 경우 최적의 상태로의 수렴 속도가 저하되는 문제가 있다. 본 논문에서는 스트래글러 존재 시에도 속도와 수렴률 측면에서 동기종 환경에서의 동기식 방식에 준하는 성능 수준을 유지하는 두 가지 강건한 분산 학습 방법을 제안한다. 먼저, 동기식 방식을 사용하되 워커들의 전역 동기화 참여 여부를 동적으로 관리하여 스트래글러 문제의 영향을 자율적으로 제어하는 학습 알고리즘인 동적 부분 올-리듀스를 제안한다. 워커의 계산 속도 저하가 발생하는 시점은 예측 불가능하며 속도 저하의 정도 또한 사전에 파악할 수 없다. 제안하는 알고리즘에서는 느린 워커가 탐지되면 해당 워커를 전역 통신 작업에서 제외시킨 후 나머지 워커들 간 매개변수 업데이트를 진행함으로써 스트래글러의 영향을 최소화한다. 이때 측정을 통해 파악된 속도 저하의 정도에 따라 해당 워커를 슬로워 워커로 분류하여 일시적으로 제외시킬지 혹은 스트라이크아웃 워커로 분류하여 영구적으로 배제할지 결정한다. 이후 슬로우 워커가 정상 속도를 회복하는 경우, 다시 동기화 그룹에 복귀시킨다. 이처럼 워커, 즉 GPU 1개의 학습 과정 배제로 인한 계산력 손실 및 해당 워커에 분배된 학습 데이터 누락, 그리고 스트래글러로 인한 작업 시간 증가 사이에서 어떤 요인이 속도와 수렴률 측면에서 더 큰 손실을 초래하는지 비교하여 결정을 내린다. 다음으로, 워커의 성능 프로파일링 정보를 기반으로 임의적으로 발생하는 스트래글러를 탐지하고 스트래글러로 인한 학습 작업의 속도 저하에 강건하게 대응하는 분산 딥러닝 학습 알고리즘인 적응적 가중 올-리듀스를 제안한다. 일반 워커 그룹에서 동기화를 통해 학습이 진행되는 동안 스트래글러로 분류된 워커는 비동기적으로 학습에 참여하므로 해당 워커의 전체 작업 지연 효과를 최소화하고 스트래글러의 GPU 연산 자원까지 최대한 활용한다. 가중 모델 평균 작업은 그래디언트 업데이트 횟수를 기반으로 매 에포크마다 수행되므로 학습이 적게 진행된 모델이 정확도에 미치는 부정적인 영향이 적응적으로 제어되며 수렴 속도는 링 올-리듀스와 유사한 수준으로 유지된다. 알고리즘의 구현은 PyTorch와 Horovod를 기반으로 이루어졌으며 모든 실험은 텐센트 클라우드에서 수행하였다.