---
title: "Scaling LLM Inference: Innovations in Tensor Parallelism, Context Parallelism, and Expert Parallelism"
description: "Meta scales LLM inference with three parallelism techniques aimed at latency targets of under 350ms time-to-first-token and under 25ms per incremental token."
url: "https://swe.quest/articles/scaling-llm-inference-innovations-in-tensor-parallelism-context-parallelism-and-0ffa604a22d7428d"
canonical: "https://engineering.fb.com/2025/10/17/ai-research/scaling-llm-inference-innovations-tensor-parallelism-context-parallelism-expert-parallelism/"
source: "Meta Engineering"
published: "2025-10-17"
difficulty: "hard"
kind: "Case study"
reading_minutes: 5
tags: ["inference","llms","distributed-systems","performance","hardware"]
---

# Scaling LLM Inference: Innovations in Tensor Parallelism, Context Parallelism, and Expert Parallelism

A post on [Meta Engineering](https://swe.quest/sources/meta.md), published 2025-10-17, 5 min read, Case study. Original: [https://engineering.fb.com/2025/10/17/ai-research/scaling-llm-inference-innovations-tensor-parallelism-context-parallelism-expert-parallelism/](https://engineering.fb.com/2025/10/17/ai-research/scaling-llm-inference-innovations-tensor-parallelism-context-parallelism-expert-parallelism/)

## Summary

Meta scales LLM inference with three parallelism techniques aimed at latency targets of under 350ms time-to-first-token and under 25ms per incremental token. For tensor parallelism, custom direct-data-access allreduce algorithms (flat and tree) cut communication latency, beating RCCL by 10-50% on decode and bringing AMD MI300X to parity with H100. Context parallelism via ring attention, in Pass-KV and Pass-Q variants, enables 1M-token prefill in under a minute on one H100 host and near-linear scaling for Llama 3 405B (128K tokens in 3.8s over 16 nodes). Expert parallelism for MoE models relies on all-to-all token exchange that costs 10-30% of latency, and Meta is moving toward N-D parallelism with disaggregated prefill and decode tiers on heterogeneous hardware.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Distributed systems](https://swe.quest/tags/distributed-systems.md) (Distributed systems)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Hardware](https://swe.quest/tags/hardware.md) (Infrastructure)

## Prerequisites

- transformer attention and KV cache ([easy posts on Caching](https://swe.quest/tags/caching.md?difficulty=easy))
- GPU collective communication (allreduce) ([easy posts on Hardware](https://swe.quest/tags/hardware.md?difficulty=easy))
- mixture-of-experts models

## Keywords

tensor parallelism, context parallelism, expert parallelism, ring attention, NCCL, RCCL, Llama 4, AMD MI300X

## Related posts

- [Reinforcement learning is an infrastructure problem](https://swe.quest/articles/reinforcement-learning-is-an-infrastructure-problem-5f300edd7294912f.md): Modal · 2026-06-01 · Medium · 10 min read · Model training, LLMs, Hardware, Open source
  RL post-training of LLMs is bottlenecked by infrastructure rather than algorithms: training engines, rollout inference and isolated environments must all scale together, and once training goes multi-node, trainer-to-rollout weight sync dominates.
- [Keep the Tokens Flowing: Lessons from 16 Open-Source RL Libraries](https://swe.quest/articles/keep-the-tokens-flowing-lessons-from-16-open-source-rl-libraries-14bbb97951dedd55.md): Hugging Face · 2026-03-10 · Hard · 45 min read · Model training, Distributed systems, Inference & serving, LLMs
  Async RL post-training libraries have converged on one architecture: disaggregate inference and training onto separate GPU pools, connect them with a rollout buffer, and push weights asynchronously so generation never stops and training never waits.
- [Benchmarking inference at scale: coding agents](https://swe.quest/articles/benchmarking-inference-at-scale-coding-agents-f8c09180ef476b13.md): Together AI · 2026-05-19 · Hard · 6 min read · Inference & serving, Performance engineering, LLMs, AI for coding
  On a long-context, high-concurrency coding agent workload (prompts ~45k–200k tokens, ~450-token outputs, EAGLE speculative decoding) running Kimi K2.5 on B200 GPUs, Together Inference Engine delivers 31% more per-user TPS than TensorRT-LLM at 2.5M TPM.
- [Adaptive Parallel Reasoning: The Next Paradigm in Efficient Inference Scaling](https://swe.quest/articles/adaptive-parallel-reasoning-the-next-paradigm-in-efficient-inference-scaling-f9d6823dd4daffcb.md): Berkeley AI Research · 2026-05-08 · Hard · 16 min read · Inference & serving, LLMs, Model training
  Adaptive Parallel Reasoning (APR) lets a reasoning model emit special control tokens to decide when to fork independent subtasks into concurrent threads, how many to spawn, and when to stay sequential.
- [Optimizing inference speed and costs: Lessons learned from large-scale deployments](https://swe.quest/articles/optimizing-inference-speed-and-costs-lessons-learned-from-large-scale-1e80b28572985147.md): Together AI · 2026-01-22 · Easy · 6 min read · Inference & serving, LLMs, Cost optimization, Performance engineering
  Lower LLM inference latency and cost come mainly from how inference runs rather than from buying more GPUs.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
