huggingface/nanotron

Minimalistic large language model 3D-parallelism training

What it solves

Nanotron simplifies the complex process of pretraining transformer models, providing a scalable and high-performance framework that allows users to train models on custom datasets without needing to build the underlying distributed training infrastructure from scratch.

How it works

It provides a flexible API and a set of optimized training scripts that leverage advanced distributed training techniques. The library implements 3D parallelism (combining Data, Tensor, and Pipeline parallelism) and expert parallelism for Mixture-of-Experts (MoE) models to distribute the workload across multiple GPUs and nodes efficiently.

Who it’s for

It is designed for researchers and engineers who need to pretrain large-scale language models (LLMs) or other transformer-based architectures and require a tool that is both easy to use and capable of scaling to massive compute clusters.

Highlights

  • 3D Parallelism: Supports Data Parallelism (DP), Tensor Parallelism (TP), and Pipeline Parallelism (PP).
  • MoE Support: Includes expert parallelism for Mixture-of-Experts models.
  • Optimization Techniques: Features ZeRO-1 optimizer, FP32 gradient accumulation, and custom module checkpointing for memory efficiency.
  • Scaling Tools: Implements spectral µTransfer parametrization to help scale up neural networks.
  • Performance Monitoring: Uses CUDA event-based timing for precise GPU performance measurement.

Related

  • Project
  • Project
  • Project
  • Project