Skip to main content
QUICK REVIEW

[Paper Review] Multi-node Bert-pretraining: Cost-efficient Approach

Jiahuang Lin, Xin Li|arXiv (Cornell University)|Aug 1, 2020
Topic ModelingComputer Science26 references7 citations
TL;DR

This paper presents a cost-efficient multi-node BERT-large pre-training framework that achieves 12-day training on a 32-node academic cluster with 256 NVIDIA T4 GPUs, using algorithmic and software optimizations to improve single-device throughput, distribute training workloads efficiently, and mitigate communication bottlenecks over a 10 Gbps network, achieving 70% weak scaling efficiency and comparable model performance to industrial-scale setups at a fraction of the cost.

ABSTRACT

Recently, large scale Transformer-based language models such as BERT, GPT-2, and XLNet have brought about exciting leaps in state-of-the-art results for many Natural Language Processing (NLP) tasks. One of the common trends in these recent models is a significant increase in model complexity, which introduces both more weights and computation. Moreover, with the advent of large-scale unsupervised datasets, training time is further extended due to the increased amount of data samples within a single training epoch. As a result, to train these models within a reasonable time, machine learning (ML) programmers often require advanced hardware setups such as the premium GPU-enabled NVIDIA DGX workstations or specialized accelerators such as Google's TPU Pods. Our work addresses this limitation and demonstrates that the BERT pre-trained model can be trained within 2 weeks on an academic-size cluster of widely available GPUs through careful algorithmic and software optimizations. In this paper, we present these optimizations on how to improve single device training throughput, distribute the training workload over multiple nodes and GPUs, and overcome the communication bottleneck introduced by the large data exchanges over the network. We show that we are able to perform pre-training on BERT within a reasonable time budget (12 days) in an academic setting, but with a much less expensive and less aggressive hardware resource requirement than in previously demonstrated industrial settings based on NVIDIA DGX machines or Google's TPU Pods.

Motivation & Objective

  • To enable efficient, cost-effective BERT-large pre-training in academic settings with limited hardware budgets.
  • To address the high computational and financial barriers of training large-scale Transformer models like BERT-large.
  • To optimize single-GPU throughput and multi-node distributed training performance on commodity hardware.
  • To reduce communication overhead in distributed training through gradient accumulation and system-level tuning.
  • To demonstrate that state-of-the-art model quality can be achieved with significantly lower hardware costs than industrial benchmarks.

Proposed method

  • Utilized a 32-node cluster with 8 NVIDIA T4 GPUs per node, totaling 256 GPUs, connected via a 10 Gbps network.
  • Applied gradient accumulation over 4 steps to reduce inter-node communication frequency and network traffic.
  • Optimized single-GPU training throughput through mixed-precision training and efficient memory management.
  • Implemented two-phase pre-training: phase 1 with sequence length 128 (36 epochs), phase 2 with sequence length 512 (6 epochs), using different batch sizes and learning rates.
  • Employed model parallelism and data parallelism across nodes, with synchronous stochastic gradient descent for parameter updates.
  • Used loss curve analysis and hyperparameter tuning to diagnose convergence issues in phase 2 and improve training stability.

Experimental results

Research questions

  • RQ1Can BERT-large be pre-trained within 12 days using only academic-grade hardware and a 10 Gbps network?
  • RQ2What system-level optimizations are necessary to achieve high scaling efficiency on commodity multi-GPU clusters?
  • RQ3How does gradient accumulation affect communication overhead and training throughput in distributed BERT pre-training?
  • RQ4Why does phase 2 of BERT pre-training exhibit convergence instability, and can it be resolved without increasing hardware cost?
  • RQ5To what extent can model performance be preserved when training on low-cost T4 GPUs compared to high-end DGX or TPU systems?

Key findings

  • The authors completed BERT-large pre-training in 12 days using 256 T4 GPUs on a 32-node academic cluster, achieving 70% weak scaling efficiency.
  • The total hardware cost was approximately $624K, which is 24 times less than the $15M–$12.8M cost of equivalent DGX or TPU Pod setups.
  • The model achieved 81% to 83% F1 score on SQuAD v1.1 after fine-tuning, which is within 9%–10% of Google’s 90.9% and NVIDIA’s 90%–91%.
  • Convergence issues in phase 2 were traced to hyperparameter misconfiguration, not system optimization; with better tuning, phase 2 could be completed in 4 epochs instead of 6.
  • The loss curves for optimized and non-optimized runs showed that performance optimizations did not harm convergence, and the optimized run was even more stable in phase 2.
  • The cost of renting 256 T4 GPUs on Google Cloud for 12 days was $25,739, which is 24 times less than the capital cost of owning the hardware, but the hardware has a 3-year lifespan, enabling 90 such experiments.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.