Benchmarking the Performance of Large Language Models on the Cerebras Wafer Scale Engine

Zuoning Zhang, Dhruv Parikh, Youning Zhang, Viktor K. Prasanna

Introduction

As Large Language Models (LLMs) continue to expand in scale—growing by over three orders of magnitude in recent years—traditional hardware architectures face significant hurdles. Standard GPU clusters often encounter the "Memory Wall," where the disparity between processor speed and memory bandwidth limits performance. Furthermore, the communication overhead required to parallelize Transformers across hundreds of individual chips can bottleneck training efficiency.

This paper evaluates the performance of state-of-the-art LLMs, specifically BERT and GPT-3, on the Cerebras Wafer Scale Engine (WSE-2). The WSE-2 is a massive single-chip processor designed to overcome these traditional limitations by integrating compute and memory at an unprecedented scale.

The Cerebras Architecture

The WSE-2 features 850,000 cores and 40 GB of on-chip SRAM on a single silicon wafer. This design allows for a memory bandwidth of 20 PB/s, which is several orders of magnitude higher than traditional discrete GPU setups.

The Cerebras WSE-2 architecture features a grid of 850,000 cores, each equipped with its own compute logic and 48KB of local SRAM.

A key architectural innovation is "Weight Streaming," where model weights are stored externally and streamed onto the chip. This enables the system to handle models with billions of parameters, far exceeding the 40GB of local on-chip memory, while maintaining high utilization.

Methodology

The researchers benchmarked the Cerebras CS-2 system using two primary models:

  • BERT (Base and Large): Evaluated for training throughput and inference latency using the SST-2 (Stanford Sentiment Treebank) dataset.
  • GPT-3: Variants ranging from 256M to 20B parameters were tested for pre-training throughput using a subset of the PILE dataset.

The study employed roofline modeling to determine whether the system was compute-bound (limited by raw math performance) or memory-bound (limited by data movement).

Performance and Scalability

The benchmarking results demonstrate that the WSE-2 effectively "scales the memory wall." For both BERT and GPT-3, the architecture keeps the models compute-bound rather than memory-bound.

GPT-3 training throughput remains stable across various batch sizes for models up to 13B parameters, with a slight drop observed for the 20B model at the largest batch sizes.

Key results include:

  • Training Throughput: BERT-Base reached a peak throughput of approximately 15,000 samples/sec at a batch size of 2048. BERT-Large peaked at roughly 7,500 samples/sec at a batch size of 8192. For GPT-3, throughput remained remarkably consistent across batch sizes for models up to 13B parameters.
  • The 20B Threshold: As shown in the throughput analysis, the 20B parameter GPT-3 model maintained steady performance until reaching very large batch sizes, where it finally began to hit data transfer limits.
  • Inference Efficiency: BERT inference latency remained nearly constant as batch sizes increased, suggesting that the WSE can process high-volume queries with minimal marginal cost per sample.

Conclusion

The Cerebras WSE-2 represents a significant shift in hardware for AI, successfully preventing memory bandwidth from becoming the primary bottleneck for massive LLMs. By keeping computation on-wafer and utilizing high-bandwidth on-chip SRAM, the system achieves high training throughput and low-latency inference. Future work may extend these benchmarks to computer vision models to see if similar architectural advantages apply to high-resolution image processing.

Summary updated

BibTeX
@inproceedings{zhang2024benchmarking,
  author = {Zuoning Zhang and Dhruv Parikh and Youning Zhang and Viktor K. Prasanna},
  title = {{Benchmarking the Performance of Large Language Models on the Cerebras Wafer Scale Engine}},
  booktitle = {HPEC},
  year = {2024},
  doi = {10.1109/hpec62836.2024.10938519},
}
Figure