# Before Designing an AI Data Center, Understand the Workload

*AI Data Center End-to-End Design Series | Lesson 02 · Part 1*

In [Lesson 01 — Why AI Data Centers Are Different: Designing from Scratch](01-why-ai-data-centers-are-different.md), we explored GPU clusters, scale-up and scale-out networks, and established our initial 32-GPU reference architecture.

Before selecting GPUs, switches or network speeds, we need to answer a more fundamental question:

**What exactly are we building this infrastructure for?**

## 1\. Architecture begins with customer requirements

Imagine a customer approaches us with a requirement:

> We want to build an AI infrastructure platform with 32 GPUs today, expand to 256 GPUs within a year, and eventually scale to 1,024 GPUs.

Should we immediately recommend 400G Ethernet, 800G Ethernet, InfiniBand or the latest GPU?

Not yet.

As a Solution Architect, our first responsibility is to understand the customer's business objectives and application requirements.

<a href="../blog-articles/lesson-02/part-01/diagrams-source/01-customer-requirement-discovery.svg"><img src="https://cdn.hashnode.com/uploads/covers/68d2ecc1b6291e1e0598bdb1/0a378faf-f3fe-4880-ab8e-a4e8ad624bdc.svg" alt="Key dimensions of customer requirement discovery." width="480" /></a>

*Figure 1 — Key dimensions of customer requirement discovery.*

| Discovery area | Questions to ask |
| --- | --- |
| Business | What problem are we solving? |
| Workload | Training, fine-tuning or inference? |
| Model | What size, architecture and precision? |
| Performance | What throughput and latency targets? |
| Capacity | How many concurrent jobs or requests? |
| Availability | What failures must we tolerate? |
| Scalability | How will the platform grow? |
| Economics | What are the budget and operating constraints? |

🏗️ **Architect's Corner — Beyond GPU Count**

Two customers requesting the same number of GPUs may need very different architectures. Understand the workload, performance targets and business objectives before selecting infrastructure.

## 2\. Not all AI workloads are the same

<a href="../blog-articles/lesson-02/part-01/diagrams-source/02-ai-workload-types.svg"><img src="https://cdn.hashnode.com/uploads/covers/68d2ecc1b6291e1e0598bdb1/18929609-bc4a-4bab-ac33-7ecea171da93.svg" alt="Training, fine-tuning and inference." width="480" /></a>

*Figure 2 — Training, fine-tuning and inference.*

### Training — Teaching the model

The model learns patterns from data by adjusting its internal parameters. Large-scale distributed training often requires frequent exchanges of gradients and intermediate computation results between GPUs.

### Fine-tuning — Adapting the model

An existing pretrained model is adapted for a specific task or domain, such as networking documentation.

Low-Rank Adaptation (LoRA) reduces training memory requirements by training additional parameters while keeping the original weights frozen.

### Inference — Using the model

A trained model generates predictions or responses without normally updating its weights. When we ask an AI assistant a question, the model performs inference.

| Characteristic | Training | Fine-tuning | Inference |
| --- | --- | --- | --- |
| Objective | Learn | Adapt | Predict |
| Weight updates | Yes | Full or partial | Normally no |
| Memory demand | High | Method dependent | Context and concurrency dependent |
| Communication | Often collective-heavy | Method dependent | Architecture dependent |
| Key metric | Time to train | Time to adapt | Latency and throughput |

> 💡 **Analogy — Learning and Applying Knowledge**
>
> - **Training:** Completing an engineering degree.
> - **Fine-tuning:** Specializing in a particular technology.
> - **Inference:** Applying that knowledge to solve a problem.

> 🏗️ **Architect's Corner — Workload Determines the Fabric**
>
> Independent inference replicas may not require a dedicated GPU backend fabric, while distributed inference can introduce significant network requirements. Understand the workload before selecting the network.

## 3\. Understanding the building blocks of an AI model

<a href="../blog-articles/lesson-02/part-01/diagrams-source/03-transformer-model-architecture.svg"><img src="https://cdn.hashnode.com/uploads/covers/68d2ecc1b6291e1e0598bdb1/d2ae1523-de5e-4bdb-b569-277cb2bcfa0f.svg" alt="Simplified transformer model architecture." width="480" /></a>

*Figure 3 — Simplified transformer model architecture.*

| Term | Simple explanation |
| --- | --- |
| Token | A unit of text processed by the model |
| Parameter | A numerical value learned during training |
| Tensor | A multidimensional collection of numbers |
| Layer | A computational stage within the model |
| Shard | A partition of a larger tensor or model state |
| Activation | An intermediate computation result |
| Gradient | Indicates how the loss changes with respect to a variable |
| Optimizer | An algorithm that updates model parameters |
| Expert | A computational component selected by an MoE router |
| HBM | High-bandwidth accelerator memory |
| KV cache | Stored attention keys and values from processed tokens |

Tokens are represented numerically using tensors. Model layers process those tensors using learned weights and produce intermediate results called activations. During training, gradients help determine how model weights should be updated.

## 4\. How much GPU memory do we really need?

A customer wants to deploy a 70-billion-parameter language model. Does that mean it requires 70 GB of GPU memory? Not necessarily. It depends on numerical precision.

| Precision | Bits | Bytes per parameter |
| --- | --: | --: |
| FP32 | 32 | 4 |
| FP16 / BF16 | 16 | 2 |
| INT8 | 8 | 1 |
| INT4 | 4 | 0.5 |

**Weight memory = parameters × bytes per parameter.**

<a href="../blog-articles/lesson-02/part-01/diagrams-source/04-model-precision-weight-memory.svg"><img src="https://cdn.hashnode.com/uploads/covers/68d2ecc1b6291e1e0598bdb1/abc88717-fec1-4869-82a9-7c2e45bed6ea.svg" alt="Impact of numerical precision on model weight memory." width="480" /></a>

*Figure 4 — Impact of numerical precision on model weight memory.*

For a 70B BF16 model: 70 billion × 2 = **140 GB**.

Quantization can reduce memory consumption but may introduce accuracy trade-offs, metadata overhead and hardware compatibility requirements.

Two 80 GB GPUs provide 160 GB of aggregate memory. Does that guarantee efficient inference? No. Weights are only one part of the memory requirement.

## 5\. Why training and inference have different memory requirements

<a href="../blog-articles/lesson-02/part-01/diagrams-source/05-training-vs-inference-memory.svg"><img src="https://cdn.hashnode.com/uploads/covers/68d2ecc1b6291e1e0598bdb1/eca77057-b40e-41ac-982c-d0d8926a4f93.svg" alt="Comparison of illustrative training and inference memory requirements." width="480" /></a>

*Figure 5 — Comparison of illustrative training and inference memory requirements.*

### 5.1 Inference memory — Understanding KV cache

During autoregressive inference, a language model generates new tokens based on previously processed tokens. Instead of repeatedly computing attention keys and values for those tokens, it stores them in a Key-Value (KV) cache.

For a conventional transformer using grouped-query attention:

**KV memory = 2 × L × Hkv × D × B × T × C**

L = layers; Hkv = KV heads; D = head dimension; B = bytes per cached element; T = cached tokens per sequence; C = concurrent sequences.

Consider a Llama 3.1 70B-style model with 80 layers, eight KV heads, head dimension 128, BF16 KV cache, 8,192 cached tokens per sequence and 32 concurrent sequences. Estimated KV cache: **85.9 GB**.

| Memory component | Requirement |
| --- | --: |
| Model weights | 140 GB |
| KV cache | 85.9 GB |
| Illustrative runtime reserve | 40 GB |
| **Total** | **265.9 GB** |
| Candidate capacity (4 × 80 GB) | 320 GB |
| Remaining headroom | 54.1 GB |

Four 80 GB GPUs are a potential candidate, provided the framework supports suitable partitioning and each GPU's allocation remains within capacity.

### 5.2 Training memory — Beyond model weights

Training requires additional memory for gradients, optimizer states, activations and temporary buffers. Consider one conventional mixed-precision Adam configuration:

| Component | Bytes per parameter |
| --- | --: |
| BF16 weight | 2 |
| BF16 gradient | 2 |
| FP32 master weight | 4 |
| Adam first moment | 4 |
| Adam second moment | 4 |
| **Total** | **16** |

70 billion × 16 = **1,120 GB**, before activations and runtime memory. An eight-GPU server with 80 GB per GPU provides only 640 GB.

Tensor Parallelism, Pipeline Parallelism, FSDP and ZeRO can help distribute computation or training state. Actual requirements depend on the implementation.

🏗️ **Architect's Corner — Memory Fit ≠ Performance**

A model that fits within available GPU memory may still fail latency or throughput targets. Validate both per-GPU memory requirements and application performance.

## 6\. Why do we need different parallelism techniques?

A model that fits comfortably on one GPU and meets performance requirements may not need distributed parallelism. But processing more data, distributing large layers, distributing groups of layers and distributing experts are different problems.

<a href="../blog-articles/lesson-02/part-01/diagrams-source/06-ai-parallelism-techniques.svg"><img src="https://cdn.hashnode.com/uploads/covers/68d2ecc1b6291e1e0598bdb1/4612c48d-32e3-4d64-9b43-50a33f766bb7.svg" alt="Fundamental differences between DP, TP, PP and EP." width="480" /></a>

*Figure 6 — Fundamental differences between DP, TP, PP and EP.*

### Data Parallelism (DP) — Divide the data

For 1,000 training samples, two GPUs can process different samples using identical model replicas in conventional DP, then synchronize gradients. **Problem solved:** increase training throughput.

### Tensor Parallelism (TP) — Divide the work within layers

Partition a large weight matrix across GPUs. Each GPU performs a portion of the computation and exchanges partial results. For 140 GB of weights across four GPUs, ideal partitioning requires 35 GB per GPU. **Problem solved:** distribute model memory and computation.

### Pipeline Parallelism (PP) — Divide the layers

An eight-layer model can be distributed across four GPUs with two consecutive layers each. Activations pass between stages; during training, activation gradients propagate backward. **Problem solved:** distribute model capacity.

### Expert Parallelism (EP) — Divide the experts

Mixture of Experts (MoE) models contain computational components called experts. A learned router selects a subset for each token representation. Distributed experts receive token representations and return results. **Problem solved:** distribute expert memory and computation.

💡 **Analogy — A Busy Restaurant**

- **DP:** Multiple chefs prepare different orders using the same recipe.
- **TP:** Multiple chefs collaborate on one complex dish.
- **PP:** Different stations handle preparation, cooking and presentation.
- **EP:** Specialized chefs handle selected parts of an order.

These techniques are not mutually exclusive. They can be used independently or combined depending on workload memory and performance requirements.

### How do GPUs exchange information?

Distributed AI frameworks use communication operations called collectives.

<a href="../blog-articles/lesson-02/part-01/diagrams-source/07-gpu-collective-communication.svg"><img src="https://cdn.hashnode.com/uploads/covers/68d2ecc1b6291e1e0598bdb1/a419eb2d-4f11-4cb4-86b4-2cc73d555ad1.svg" alt="Fundamental GPU collective communication operations." width="480" /></a>

*Figure 7 — Fundamental GPU collective communication operations.*

Libraries such as NVIDIA Collective Communications Library (NCCL) provide these operations.

| Parallelism | What is divided? | Typical communication |
| --- | --- | --- |
| DP | Training data | AllReduce |
| TP | Layer computations | AllReduce, AllGather |
| PP | Model layers | Point-to-point |
| EP | Model experts | All-to-All |

🏗️ **Architect's Corner — Parallelism Shapes the Network**

Different parallelism techniques create different communication patterns. These patterns determine the fabric's bandwidth, latency and congestion-control requirements.

## 7\. Connecting the workload to the network

| Characteristic | Scale-up | Scale-out |
| --- | --- | --- |
| Purpose | Tightly coupled accelerator communication | Communication across compute systems |
| Technologies | NVLink, NVSwitch, UALink | RoCEv2, InfiniBand |
| Typical placement | Server or rack-scale domain | Across servers and racks |
| Common workloads | Tensor parallelism | Data and pipeline parallelism |

These placements are common design preferences, not mandatory rules.

| Interface | Nominal one-direction bandwidth |
| --- | --: |
| H100 NVLink aggregate | 450 GB/s |
| 800G NIC | 100 GB/s |
| 400G NIC | 50 GB/s |

H100 NVLink aggregate bandwidth is 900 GB/s bidirectional. NIC values are nominal line rates, not measured application throughput. This difference helps explain why frequent tensor communication is generally preferred within a high-bandwidth scale-up domain.

### Returning to our 32-GPU architecture

Our customer plans four eight-GPU servers connected through a dedicated backend network.

<a href="../blog-articles/lesson-02/part-01/diagrams-source/08-32-gpu-reference-architecture.svg"><img src="https://cdn.hashnode.com/uploads/covers/68d2ecc1b6291e1e0598bdb1/983d4f24-3b94-400f-a229-73b9d8c2b518.svg" alt="Initial 32-GPU logical architecture with scale-up and scale-out communication domains." width="480" /></a>

*Figure 8 — Initial 32-GPU logical architecture with scale-up and scale-out communication domains.*

Each server provides a high-bandwidth scale-up domain, while the leaf-spine backend enables communication across servers. Depending on workload placement, tensor communication can remain within servers while other distributed operations traverse the backend.

NIC speeds, switch capacity, oversubscription and congestion control must still be derived from measurable workload requirements.

🏗️ **Architect's Corner — Workload-Driven Fabric Design**

Map GPU communication patterns to the physical topology before selecting NIC speeds, switch capacity and oversubscription.

**Design the network around the workload, not the workload around the network.**

## 8\. Think About It

A customer's model fits comfortably within one GPU, but training takes longer than the business can tolerate. Would you recommend DP, TP or PP?

What changes if the customer upgrades to a model that no longer fits?

**Architect's reasoning:** DP is a natural starting point for throughput when the complete training workload fits. TP, PP or sharded training-state techniques may help when it does not. The final decision depends on memory, communication overhead and performance targets.

## 9\. Key takeaways

- Business objectives drive workload requirements.
- Workloads drive compute and memory requirements.
- Parallelism determines GPU communication patterns.
- Communication patterns drive network requirements.
- Memory feasibility does not guarantee application performance.
- Architecture decisions must be validated against actual workloads.

## What's next?

**Lesson 02 — Part 2: From AI Workloads to Infrastructure Requirements**

We will translate these concepts into measurable training throughput, inference latency, network bandwidth, scaling efficiency, storage, availability and future growth requirements.

## Further reading

- [PyTorch Distributed Overview](https://pytorch.org/tutorials/beginner/dist_overview.html)
- [NVIDIA Megatron Core](https://docs.nvidia.com/megatron-core/developer-guide/latest/)
- [NVIDIA NCCL](https://docs.nvidia.com/deeplearning/nccl/user-guide/docs/)
- [DeepSpeed ZeRO](https://www.deepspeed.ai/tutorials/zero/)
- [NVIDIA H100](https://www.nvidia.com/en-us/data-center/h100/)

All sizing examples use illustrative assumptions and decimal GB; actual allocations and performance require validation.

**Understand the workload. Design around customer requirements. Validate the outcome.**

**Packets & Fabrics**

*Decoding Networks. Designing AI Fabrics.*
