Kraken: Inherently Parallel Transformers For Efficient Multi-Device Inference

Rohan Baskar Prabhakar, Hengrui Zhang, David Wentzlaff

Introduction

As Large Language Models (LLMs) continue to scale toward hundreds of billions of parameters, the hardware requirements for inference have shifted from single-accelerator setups to massive multi-GPU clusters. While software-level optimizations and specialized hardware have improved throughput, the fundamental Transformer architecture remains a significant bottleneck in distributed environments. Specifically, the standard Transformer design imposes a "communication tax"—a performance penalty incurred when GPUs must synchronize data during inference.

Researchers from Princeton University have introduced Kraken, a redesigned Transformer architecture that integrates parallelism directly into its structural design. By restructuring the model to overlap expensive inter-GPU communication with actual computation, Kraken effectively breaks the "communication wall," achieving substantial speedups in Time To First Token (TTFT) without sacrificing model quality.

The Communication Wall in LLM Inference

Modern LLMs are typically too large to fit within the memory of a single GPU. To address this, practitioners use Tensor Parallelism (TP) to shard the model across multiple devices. However, standard TP introduces a major overhead: every layer requires GPUs to synchronize their intermediate results using "AllReduce" operations.

In a conventional Transformer, these synchronization steps are "blocking." This means the GPU sits idle, waiting for data from its neighbors before it can proceed to the next calculation. As models scale to 175B parameters and beyond, this communication overhead becomes a dominant factor in latency, particularly for the critical first token that determines the perceived responsiveness of interactive applications.

The Kraken Architecture

Kraken moves away from the traditional method of sharding a single large layer. Instead, it utilizes a fixed degree of intra-layer model parallelism through the following innovations:

1. Independent Sub-layers

Rather than one massive Multi-Head Attention (MHA) block sharded across GPUs, Kraken employs $N$ independent, smaller MHA and Feed-Forward Network (FFN) blocks. Each GPU manages its own independent "shard" of the layer, reducing the frequency of global synchronization.

2. The Overlap Strategy

In a standard Transformer setup, an AllReduce operation is required after the MHA block and again after the FFN block. Kraken reduces this requirement to a single AllReduce per layer. Crucially, the architecture is designed so that the output of the AllReduce from the previous layer is only required for the FFN of the current layer.

3. Parallel Execution and Scheduling

This structural change allows the GPU to initiate the current layer's Attention computation immediately while the AllReduce from the previous layer is processed in the background on a separate CUDA stream. By the time the Attention computation finishes, the data from the previous layer is ready for the FFN, effectively hiding the communication latency.

4. Parameter Parity

To ensure a fair comparison with baseline models, the researchers adjusted Kraken’s hyperparameters—such as reducing the FFN expansion factor from 4d to 2d—to ensure the total parameter count remains identical to the GPT-style models they replace.

Experimental Evaluation

Training and Benchmarks

The Kraken models were pretrained on OpenWebText, a high-quality open-source clone of the GPT-2 training set. To verify that these structural changes did not degrade the model's reasoning capabilities, the authors evaluated Kraken on the SuperGLUE benchmark suite, including tasks such as BoolQ (question answering), RTE (entailment), and COPA (reasoning).

Performance Results

Testing was conducted on HGX A100 systems using TensorRT-LLM. The results demonstrated:

  • Significant Speedups: Kraken achieved a geomean speedup of 35.6% in TTFT across various model sizes. In high-demand configurations, such as 175B parameter models with 4-way parallelism, speedups reached as high as 63.7%.
  • Quality Preservation: Kraken models maintained similar or slightly improved perplexity compared to standard GPT-2 architectures.
  • Reasoning Consistency: On SuperGLUE, Kraken performed comparably to standard Transformers in both zero-shot and three-shot settings, proving that the architectural modifications do not compromise the model's intelligence.

Discussion and Future Work

Kraken represents a shift toward architecture-hardware co-design. By treating communication as a first-class citizen in the model's design, Kraken proves that synchronization does not have to be a blocking bottleneck.

However, some limitations remain. Unlike software-only optimizations (such as quantization), Kraken requires training models from scratch, which is computationally expensive. The authors suggest that "weight distillation" from existing models like Llama-3 could be a viable path for adopting Kraken-style structures in the future. Additionally, because Kraken replicates certain parts of the Attention block, the KV Cache memory footprint is larger than in standard models, a challenge that could be mitigated by using Multi-Query Attention (MQA).

Future research will focus on applying Kraken’s "IO-aware" design principles to Mixture-of-Experts (MoE) architectures, which currently face even more complex communication challenges in distributed environments.

Summary updated

BibTeX
@inproceedings{prabhakar2024kraken,
  author = {Rohan Baskar Prabhakar and Hengrui Zhang and David Wentzlaff},
  title = {{Kraken: Inherently Parallel Transformers For Efficient Multi-Device Inference}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=jRtxzzk0a6},
}
Figure