← All posts

The 0.01% Guide to AI Infrastructure: Understanding LLM Internals and GPU Execution

2026-05-06

Originally published on LinkedIn.

Revised on 26 October 2026: the model dimensions, file layout and hardware figures now match the official GPT-oss 120B configuration and the DGX H200 specifications, and the role of Megatron Bridge is clarified. The illustrations were generated with AI tools and simplify the model; where their numbers differ from the text, the text is correct.

Generative AI platforms like ChatGPT, Perplexity, and Gemini have become ubiquitous, fundamentally transforming the modern technological landscape. Across industries, enterprises are deploying AI at an unprecedented scale, integrating Large Language Models (LLMs) into complex data pipelines and establishing sophisticated MLOps practices. Today, specialized tech organizations are fine-tuning foundational models to tackle domain-specific challenges in healthcare, law, and finance, while developers globally have embraced AI-powered coding interfaces to accelerate their workflows.

Yet, despite this massive wave of adoption, a critical knowledge gap remains. For most, the underlying mechanics of these systems are treated as a black box. Very few professionals truly grasp the internal intricacies of LLM architecture—such as embedding spaces, multi-head attention, and Mixture of Experts (MoE) routing. Even fewer understand the complex AI infrastructure required to load these massive models into GPU clusters for optimized inference.

This article bridges that gap. By breaking down the complete lifecycle—from how text tokens are processed in neural network layers to how matrix multiplications are executed at the hardware level—this guide will demystify the system architecture. By the end, you will join the 0.01% of professionals who truly understand the robust engineering and infrastructure that makes modern AI possible.

From Theory to Silicon: Introducing GPT-oss 120B

This article breaks down how a reference large language model such as GPT-oss 120B works, from its internal Transformer architecture to the way it is packaged, stored, loaded from disk, and executed on GPU compute infrastructure.

It is aimed at readers who already have a basic understanding of LLMs, although anyone with a general technical background should be able to follow by reviewing a few concepts as they go.

GPT-oss 120B is built on a Transformer architecture that combines attention mechanisms with a Mixture of Experts (MoE) design. It has 116.8 billion parameters in total, but only about 5.1 billion are active for each token: instead of engaging the full network, the model selectively activates a few specialized experts, which makes inference far cheaper than the parameter count suggests.

The GPT-oss 120B model architecture

The GPT-oss 120B model architecture

Step 1: Tokenization and Embeddings

Before the model can process text, it must convert human language into a mathematical format. The input sentence is divided into discrete segments called tokens (whole words or pieces of words), each with a numerical ID from a vocabulary of about 201,000 entries. An embedding table then maps each ID to a dense vector—in this architecture, an array of 2,880 numbers per token. This vector is the model's starting representation of the token's meaning before it enters the computational pipeline.

Step 2: The Transformer Layers

The core engine of the model is a sequential tower of 36 transformer layers where the actual "reasoning" occurs. As the token embeddings pass through each layer sequentially, they accumulate deeper contextual understanding through three primary mechanisms:

Step 3: The Language Model Head

After the token vector has traversed all 36 layers, the highly enriched mathematical representation reaches the final stage: the Language Model (LM) Head. This component translates the 2,880-dimensional vector back into human language by calculating next-token probabilities. It outputs a probability distribution across the model's entire vocabulary, from which the system selects the next token to generate.

Mapping Architecture to Disk: The Safetensors Format

Safetensors and disk storage

Safetensors and disk storage

Understanding the abstract architecture of GPT-oss 120B is only half the equation. To deploy the model, those mathematical structures must be serialized and stored on physical media (NVMe/SSDs). Modern LLMs use the Safetensors format, which stores tensors in a simple, safe layout that can be memory-mapped and read without copying, so that loading is fast. Because the checkpoint is tens of gigabytes, it is split, or "sharded," into several files that are easier to download, store and load in parallel.

The Storage Sharding Strategy

When you download an LLM to disk, you are downloading a directory of these Safetensors shards plus an index. For GPT-oss 120B, the official checkpoint on Hugging Face has 15 shard files of roughly 4 to 4.6 GB each:

Exploded View: Inside a Single Layer

If we inspect the tensors that belong to a single layer (such as layer 0), we find the raw matrices required for GPU compute:

Because Safetensors files can be memory-mapped, a loader can read exactly the tensors, or slices of tensors, that each GPU needs, instead of deserializing whole files into RAM. For inference, all 36 layers are loaded into GPU memory once, when the server starts.

The Inference and Training Pipeline: From Storage to Silicon

Single-node inference pipeline

Single-node inference pipeline

Having mapped the LLM architecture into Safetensors shards on disk, the next infrastructure challenge is moving those weights into the execution environment. The loading path described here is the same for inference and for training; training then needs much more GPU memory for gradients, optimizer states and activations. In both cases a carefully orchestrated pipeline moves data from slow non-volatile storage into ultra-fast GPU memory, and ultimately into the compute cores.

Loading the Weights: From Disk to GPU

The journey begins at the NVMe/SSD storage level. The CPU reads the Safetensors shards into system RAM (or memory-maps them), and the weights are then copied into GPU memory. For a large model spread over several GPUs, simply copying the files is not enough: each GPU must receive exactly its share of the weights.

Weight Buffering in HBM3e VRAM

Once across the PCIe bus, the model data lands in the GPU's High Bandwidth Memory (HBM3e VRAM).

Execution: L2 Cache to Streaming Multiprocessors (SMs)

VRAM is fast, but execution requires the data to be placed as close to the compute units as possible. To generate each new token, the GPU reads the weights it needs (every attention matrix plus the 4 selected experts in each layer) from VRAM through the L2 cache.

Loading from NVMe through RAM and PCIe into VRAM happens once. What sustains real-time generation is the per-token path: VRAM, through the caches, into the Tensor Cores. Generating a token mostly means reading weights, so it is limited by memory bandwidth (4.8 TB/s on an H200) more than by compute. This is also why MoE pays off: with only about 5.1 billion active parameters, each token needs to read a small fraction of the model.

Scaling Up: Multi-GPU Inference on an NVIDIA DGX H200 Node

Multi-GPU inference pipeline (DGX H200)

Multi-GPU inference pipeline (DGX H200)

While the internal architecture of an LLM and the loading process into a single GPU are complex, running a model like GPT-oss 120B in production usually means scaling across multiple GPUs. Its 65 GB of weights fit on one 80 GB GPU, but that leaves little room for the KV cache of many concurrent users, and a single GPU limits both throughput and latency. Larger models simply do not fit on one card. To solve this, enterprise architectures rely on nodes like the NVIDIA DGX H200, which houses 8 high-performance GPUs (H200 SXM5 modules) working as a single unified engine.

Breaking Down the Workload: Parallelism Strategies

To make 8 GPUs act as one, the model's workload and memory must be divided. The two primary strategies to distribute the parameters of GPT-oss 120B are Tensor Parallelism and Pipeline Parallelism; a third, Expert Parallelism, is specific to MoE models and is covered further below.

  1. Tensor Parallelism (TP): Splitting the Math. Instead of giving one GPU the entire matrix multiplication task, Tensor Parallelism slices each weight matrix across the GPUs.
  1. Pipeline Parallelism (PP): An Assembly Line for Layers. While TP slices the matrices, Pipeline Parallelism divides the sequence of the model's 36 layers across different GPUs, creating a sequential assembly line.

Advanced Deep Dive (Optional Reading): The Synergy of Tensor and Pipeline Parallelism

When you combine Tensor Parallelism (TP) and Pipeline Parallelism (PP)—often called "3D Parallelism" when combined with Data Parallelism—they work together in a grid-like fashion.

Imagine you have an 8-GPU node and you configure it with:

Here is exactly how the GPUs are assigned:

  1. Stage 1 of the Pipeline (Layers 0–17): This entire block of layers is assigned to a "TP Group" consisting of GPUs 0, 1, 2, and 3.
  2. Stage 2 of the Pipeline (Layers 18–35): This second block of layers is assigned to the second "TP Group" consisting of GPUs 4, 5, 6, and 7.

The Flow of Execution

As data moves through the system, here is what happens:

Why do both?

Tensor Parallelism requires GPUs to talk to each other constantly (several times per layer) to share partial matrix math results. This requires extreme bandwidth, which is why it is almost always kept inside a single server, over NVLink.

Pipeline Parallelism only requires GPUs to talk to each other at the boundary between stages (just passing the result of Layer 17 to Layer 18). Because the communication requirement is much lower, PP is often used to bridge across different servers (e.g., Server A handles the first half of the model, Server B handles the second half).

By combining them, you keep the ultra-fast TP math confined to GPUs physically wired together, while using PP to scale the model's depth across more hardware without causing a massive network bottleneck.

The NVLink Fabric: The Backbone of Synchronization

Because Tensor Parallelism requires constant sharing of partial results, traditional PCIe connections are far too slow. This is where the NVLink fabric becomes critical.

VRAM Layout and Distributed MoE

Inside each of the 8 H200 GPUs, the 141 GB of HBM3e VRAM is carefully partitioned. A portion holds the embeddings, another holds the sharded layer matrices assigned to that GPU, and a large segment is reserved for the KV Cache (which remembers the context of each user's conversation).

Furthermore, the Mixture of Experts (MoE) architecture scales well in this environment through Expert Parallelism (EP). Instead of storing all 128 experts on every GPU, the experts are distributed across the node, 16 per GPU with 8 GPUs. When the router determines which 4 experts a token needs, the token's data is sent over the NVLink fabric to the GPUs that hold those experts (an "all-to-all" exchange), computed there in parallel, and gathered back.

By mastering this orchestration—loading weights over PCIe, splitting math via Tensor Parallelism, dividing layers via Pipeline Parallelism, distributing experts via Expert Parallelism, and synchronizing at hundreds of gigabytes per second over NVLink—systems architects can deploy 120-billion-parameter models that stream each new token in a few milliseconds.

Enter vLLM: The Software Engine for High-Throughput Inference

Production-scale inference serving with vLLM

Production-scale inference serving with vLLM

So far, this article has focused on the physical and architectural journey of the model—how GPT-oss 120B is stored in Safetensors, loaded across the PCIe bus, held in HBM3e VRAM, and distributed across 8 GPUs via Tensor, Pipeline and Expert Parallelism.

However, hardware alone does not make a production-ready AI service. To serve thousands of users simultaneously, at the scale of services like ChatGPT or Perplexity, you need highly optimized software to manage the traffic, memory, and queuing of incoming requests. This is where vLLM comes in. vLLM is a state-of-the-art, open-source inference server designed to squeeze the maximum throughput out of the GPU hardware we just discussed.

Key vLLM Optimizations

The image highlights several critical software optimizations that vLLM applies on top of the physical infrastructure:

The Difference: Architecture vs. Serving

To understand the complete pipeline, it is crucial to distinguish between what we learned earlier and what vLLM does:

Megatron, Megatron Bridge and vLLM: Are they the same?

A common point of confusion is the relationship between NVIDIA's Megatron projects and inference servers like vLLM.

Megatron-LM and its library, Megatron Core, are designed for the massive undertaking of pre-training and fine-tuning foundational models. Megatron Core provides the low-level building blocks to orchestrate Tensor, Pipeline, Sequence, Context and Expert parallelism across thousands of GPUs during training.

Megatron Bridge is a separate NVIDIA library, part of the NeMo framework, built on top of Megatron Core. It converts checkpoints between the Hugging Face format and Megatron's format in both directions, distributing the weights according to the chosen parallelism layout as it does so. It also provides ready-made training and fine-tuning recipes, including LoRA, and supports GPT-oss among its models.

Can Megatron be used for inference? Yes, Megatron Core includes inference support, but it is mostly used to test and evaluate a model during and after training. It is not optimized for serving thousands of concurrent users in a production environment.

vLLM, on the other hand, is purpose-built for production inference. Interestingly, vLLM borrows Megatron-LM's Tensor Parallelism algorithm to distribute the model across GPUs. A common enterprise workflow is therefore: import a Hugging Face checkpoint into Megatron with Megatron Bridge, train or fine-tune it with Megatron Core, export the result back to Hugging Face Safetensors with Megatron Bridge, and load those weights into vLLM to serve the model to end-users with maximum efficiency and the lowest latency.

The Strategic Imperative of AI Infrastructure

As generative AI transitions from experimental workflows to core enterprise operations, the industry conversation must shift from simply asking "which model is smartest" to "how robust is our underlying infrastructure." True competitive advantage in the AI space is no longer just about prompt engineering or having the best model weights. It is about mastering the deployment stack.

Understanding this end-to-end pipeline—from optimizing NVMe-to-VRAM loading and orchestrating multi-GPU parallelism, to maximizing concurrent user throughput with advanced serving engines like vLLM—is what separates a fragile proof-of-concept from a highly profitable, scalable production environment. As AI architectures continue to grow in complexity, the organizations that win will be those that treat MLOps and infrastructure architecture not as an afterthought, but as the foundation of their business strategy.

I'd love to hear from other engineering leaders and systems architects in my network: As you scale your LLM deployments, what are the biggest hardware or serving bottlenecks you are currently navigating in your clusters? Let's discuss in the comments.

References & Further Reading

Images generated with: Gemini and Perplexity