Can another upgrade fix a slow reply? The MY robot has installed an accelerator with more peak compute and still needs evidence. Follow one illustrative service, measure waiting and data flow, then choose the next comparison.
Try the lab: change batch, KV and bandwidth conditions
More peak compute. Why is the reply still slow?

The MY robot operates a conversational service. Its team installs an accelerator with a higher peak compute rating, yet users still find the replies slow. The supplied observations are that the reply starts promptly but continues slowly, while memory capacity remains available. This is an illustrative scenario, and these clues are teaching assumptions. They do not yet establish which hardware the team should buy.
Separate the user's wait into two parts. Time to first token, or TTFT, runs from sending the question to seeing the first output. The gaps between later outputs describe how generation continues. A token is the model's text unit: it may be a character, part of a word or another fragment, with no fixed conversion to visible character count. Measurements also need consistent start and end points. Inter-token latency, or ITL, describes adjacent output gaps; here TPOT is the average time per token after the first output. One describes individual gaps, the other their average.[1]
The initial wait can include queueing, preprocessing and the model's work on the prompt. Data also has to reach the compute units. Subsequent generation can be affected by computation, memory access and scheduling. Seeing some compute units idle does not establish that memory bandwidth is insufficient. Synchronization or too little available work can produce a similar observation. Stage-level traces and relevant resource counters are needed to distinguish these explanations.[2]
The teacher puts the next upgrade order aside. This lesson will follow the data behind the same reply, separating model weights from the KV cache and comparing the amount of data with the paths available to carry it. GPUs, ASICs, HBM and CXL enter the story when they address a specific constraint. The final decision is which evidence supports an architectural change and which measurements must be repeated afterward. The next page separates processing the prompt from continuing the reply.
Reading a prompt and continuing a reply do different work

When the model receives a prompt, it first processes the supplied input in a stage called prefill. It computes internal representations and prepares keys and values, or K and V, for subsequent attention calculations. These are data the model uses to match against earlier context and retrieve information; the next page follows how they are stored. Several input positions can be computed together, while the attention mask still determines which content each position may consult.[1][11]
Continuing the reply is called decode. In ordinary autoregressive generation, the next token is selected before it becomes part of subsequent work. New K/V entries are appended to the cache. Dependencies remain within a sequence, but different conversations can run together. A scheduler may also switch work at step boundaries; sequential generation does not make an entire reply uninterruptible.[1] In the ordinary flow used here, sampling the final prefill position produces the first output token; decode continues with subsequent tokens.
The initial wait includes queueing and prompt work, with possible preprocessing, sampling and response overhead. Later token intervals reflect decode and serving decisions. Neither measurement is simply one kernel's runtime, but they help locate the part of the service that users experience as slow. The illustrated timeline shows order, not fixed durations.[8]
The example starts promptly but continues slowly, so examine generation first. A batch is a group of requests processed in the same step. With fewer conversations in the group, loaded weights have fewer opportunities for shared use, making data delivery more likely to matter. Larger batches, different attention designs or hardware can change the main limit. First list the data needed per step, then examine sharing before choosing additional resources.
Weights and KV cache need separate budgets

Weights are the model's learned parameters. Conversations using the same model can share one copy rather than duplicate the entire model per user. Our supplied example has seven billion parameters stored at two bytes each, giving a 14 GB weight payload. GB is decimal here. Format metadata, workspace and serving allocations are excluded, so this is not the device's total memory requirement.
To generate a new token, attention consults earlier context. Keys from earlier positions help determine which information to attend to; values provide the corresponding content representations. Saving both avoids computing them again, and that storage is the KV cache. Avoiding recomputation still requires storage and reads. In this full dense-attention example, every new position uses earlier K/V for its sequence. Conversations have separate state, and this calculation does not use prefix-sharing optimizations.[2][3]
KV size depends on how attention is grouped into heads. A new position's query is compared with earlier keys to determine which information to use; a model can let multiple query heads share K/V. This example has 32 layers, 8 KV heads per layer, 128 dimensions per head and 2 bytes per value, retaining 4096 tokens. Counting both K and V gives 536870912 bytes per sequence, about 0.537 GB or exactly 0.5 GiB. Its 32 query heads share 8 KV heads, connecting to GQA later. Seven billion parameters alone cannot determine this KV capacity.
Keeping several sequences of the same length multiplies that KV allocation by concurrency. Real requests have different lengths and additional block-tail waste or allocation constraints. The teacher therefore budgets weights, per-conversation KV and workspace separately. A budget for one user can miss the pressure that appears when a service scales.
Engineer extension: K, V and head geometry
KV bytes = 2 × layers × KV heads × head dimension × cached tokens × bytes/value × sequences. The first factor counts K and V; it is not a DDR factor. One supplied sequence uses 2×32×8×128×4096×2 = 536,870,912 bytes. Query-head count is not substituted for KV-head count in GQA. Sharding, replication and allocation metadata need separate budgets.[3]
Why wait for data when memory still has room?

Capacity describes how much data can remain stored. Bandwidth describes bytes delivered per second, while latency describes how long one access takes to return. A larger cabinet does not automatically widen its doorway, and more concurrent transfers do not make every individual access immediate. The analogy separates the three concepts; controllers, queues and access patterns still need inspection.
The example now supplies an illustrative trace: few conversations run concurrently, capacity is sufficient and queueing does not dominate. Compute has headroom, but weights are not supplied fast enough. These conditions focus the investigation on data delivery. A real service needs comparable measurements, since idle compute could also reflect insufficient work or synchronization waits.
Estimate delivery time first. Suppose each decode or batch step moves 14 GB of weights once across the same channel from accelerator-local memory, at an effective 1000 GB/s. Dividing 14 by 1000 gives 14 ms. If a single conversation generates one token per step and transfers those weights every step, this channel alone limits its ideal rate to about 71 tokens/s (1000÷14). These are a lower bound for the transfer component and a corresponding rate ceiling, excluding KV, other computation and synchronization. They do not alone establish a missed service target, and overlapping work requires an execution-aware total.
Diagnosis compares usable compute with effective data supply rather than two peak specifications. Small requests, uneven traffic or insufficient concurrency can keep a channel below its advertised rate. The interactive model below fixes selected assumptions and compares time lower bounds, with omissions stated alongside it. First, we examine whether several conversations can share weight traffic.
Engineer extension: time bounds and the roofline
For F operations and D transferred bytes, usable compute rate C and effective bandwidth B give an ideal fully overlapped lower bound max(F/C, D/B). Stages that cannot overlap need separate timing. The lab includes decode weight reads and historical KV reads in its traffic model, but simplifies attention computation, KV writes, queueing and synchronization. It compares assumptions rather than predicting serving latency.[1][2]
Does serving more people make each reply faster?

Batching puts compatible sequences into the same execution step. When they use the same model, retrieved weights can serve more computation. Weight traffic per user may therefore fall. This is improved reuse; it does not let one conversation ignore its previous token or guarantee that every user becomes faster by the batch-size multiplier.[1]
Each sequence still needs its own KV and computation. Eight sequences with the supplied 4096-token geometry need roughly 8×0.537 GB of KV, while the 14 GB weights need not be copied eight times. Higher concurrency can improve reuse but move the limit toward compute, KV reads or capacity. Real workloads also vary in length, completion time and layout.
Total tokens per second measures system output; per-user latency describes one person's wait. Waiting to assemble a batch can increase the initial delay, and more work per step can change later intervals. Compare schemes with the same quality, arrival load and latency requirements. Throughput that includes replies violating the latency target can misrepresent an interactive service.[8]
Continuous batching replaces completed sequences with new work to reduce empty slots. New prefill may still compete with ongoing decode. Implementations can adjust priorities or process prompts in chunks, but their effect needs workload validation. The robot sets a latency budget before testing how much sharing is possible instead of treating the largest batch as the answer.[13]
What changes when we move fewer bytes?

Weight quantization changes numerical representation and can reduce stored and transferred payload. Moving from two to one byte per weight changes this example's weight data from 14 GB to 7 GB. Real formats may add scales and other metadata. Available kernels, decoding work and model quality affect the result; half the payload does not establish twice the speed.[14]
KV precision and attention-head design are separate choices. GQA shares fewer KV heads across multiple query heads, changing the retained KV volume. Our example already supplies 32 query heads and 8 KV heads. A serving switch cannot preserve arbitrary models' original quality automatically; the architecture and any required training must match.[3]
PagedAttention addresses a different waste. Reserving a large contiguous region per sequence can waste space when future length is unknown. Fixed-size blocks and mappings allow noncontiguous physical allocation, without first moving data to fill every gap. Lower allocation waste can fit more sequences into available capacity; dense attention still reads historical K/V.[2]
The illustration therefore keeps two main mechanisms: quantization and block mapping. One reduces numerical payload, while the other improves allocation. Both return to quality and execution-support checks. The teacher then asks whether either change addresses this case's weight-supply limit. Benefits must be retested with the same task and service targets.
Engineer extension: validate each reduction separately
Weight quantization changes weight representation; KV quantization changes cache representation; PagedAttention changes allocation and management. Fixed-size KV blocks may occupy noncontiguous physical locations and can still leave unused space in the final block. GQA changes model head geometry. Allocation efficiency, numerical precision and model architecture require separate validation.[2][3][14]
When is HBM worth using for inference?

HBM supplies nearby accelerators through a wide in-package interface. Its value follows traffic requirements and does not disappear because a task is called inference. If this case's effective bandwidth is insufficient, high-bandwidth local memory is a candidate worth comparing alongside reuse and quantization.
Bandwidth requires suitable controllers, package connections and traffic distribution. A channel's headline capability does not mean every access pattern can use it fully. Fragmented or uneven requests affect delivery, while capacity, power and cooling must also fit. This continues the preceding HBM lesson without multiplying external bandwidth by stack height.[12]
Inference can face both weight storage and multi-user KV pressure. More local capacity can reduce the data that must be moved outward, but not every stored gigabyte is accessed equally often. An outer tier brings its own bandwidth and latency. Greater reachable capacity must not be presented as equal-speed in-package HBM.[6]
HBM is therefore neither automatically wasteful for inference nor justified solely by a bandwidth figure. The team checks the same workload against its latency target, then evaluates hardware, packaging, energy and service utilization together. The next page separates another frequently conflated choice: the compute chip does not automatically dictate one memory technology.
Does an ASIC solve the memory problem?

An ASIC can target expected operators and formats, removing unnecessary general-purpose capability and tailoring data paths. That creates optimization opportunities, with design, software and flexibility costs. Whether it remains well utilized when models or serving patterns change belongs in the evaluation; peak compute alone is insufficient.
Compute and memory are two connected choices. A GPU offers more general parallel computation, while an ASIC targets expected work; both still need a data supply. HBM, DDR and LPDDR describe memory-configuration directions. Google's TPU v5e combines an ASIC design with HBM and supports training and inference, an official example of integrating the two choices. Choosing an ASIC still leaves memory capacity and delivery rate to be checked.[10]
A design-space diagram does not imply interchangeable modules. Controllers, PHYs, power, packaging and software need matching support. Two accelerators that execute similar models can have different memory access paths. Architectural comparisons must draw the paths that the actual platform provides.
Weights and KV do not disappear when the compute unit changes. In the supplied case, weight delivery is limiting. More arithmetic capability alone may leave that limit unchanged unless reuse or the data path also improves. The teacher keeps the memory budget visible while assessing whether specialization changes the constrained part of the system.
Whose memory does CXL expand?

When a host needs more memory, one option is a CXL-connected expansion device containing DRAM. Type 3 devices commonly serve this memory role. The path runs from the host CPU through a CXL link and device controller to DRAM. Each part needs compatible support to manage addresses and requests. This first explains host capacity expansion; whether a GPU can use the data and by which route requires checking the actual platform.[5][9]
Expansion and pooling are separate capabilities. Adding capacity to one host does not establish dynamic allocation of the same pool across multiple hosts. Pooling needs suitable devices, switching topology and management. Versions and configurations matter; a CXL label does not establish every possible usage model.[4]
GPU access requires checking the actual platform path. Host-managed staging into GPU-local memory has transfer and synchronization costs and is not a direct GPU load from the outer tier. Newer protocol capabilities include Direct P2P.mem, but device, fabric and software support must be verified. Neither universal availability nor universal impossibility is justified.[5]
The supplied case has spare capacity, so it does not justify CXL expansion as the first correction. The teacher keeps it as an option because longer contexts or more concurrent requests may change the budget. Reachability leaves another question: does placing the data farther away fit the time at which the service needs it?
Engineer extension: verify requester and mappings
Host-managed device memory on a CXL Type 3 device enters host address space through platform decoding, firmware and OS support. That does not establish direct loads by an arbitrary GPU. Verify requester, mappings, IOMMU or access permissions, peer routing, drivers and versions. If the supported path uses host-staged copies, account for those copies and synchronization; device capacity is not proof of reachability.[5][9]
Does moving data outward save space or add waiting?

Hotness follows access patterns. Historical K/V remains in use at every new position under this example's full dense attention, so age alone does not make it cold. Sliding-window and other attention designs have different requirements that need a separate scope; they must not be folded into the same traffic estimate.[2][3]
Paused-request state or cold host pages may be candidates for an outer capacity tier when management support exists. Before reuse, the right version must reach the executable location at the right time. Fetch and synchronization remain visible in the diagram. Fetching hot data at every step can create a new limit on the slower path.[6][9]
An average hit rate does not describe every user's wait. A miss, migration or resource conflict can lengthen tail latency. Prefetch and overlap may hide some time, but require predictable demand, plus paths and runtimes that support concurrent work. Ideal overlap must not be assumed for every request.
The teacher compares added capacity with the cost of returning data. If hot data already fits locally, moving it outward need not help this case. A changed workload that exhausts capacity requires a fresh evaluation. Performing supported operations near the data offers another way to reduce external movement, with its own operator and numerical constraints.
Engineer extension: tiering and phase splitting differ
Active historical KV is still accessed each step in full dense attention. Windowed or sparse attention can use different access sets, depending on the model. A separate design assigns prefill and decode to different devices and transfers KV at the handoff. Evaluate resource-allocation benefits against transfer costs; different phase bottlenecks alone do not prove that splitting is faster.[11]
Which work belongs near the memory?

Near-memory computing, or NMC, places supported work in logic near the data. Processing in memory, or PIM, may put logic inside the memory device itself, with placement and capabilities depending on the design. These arrangements aim to reduce movement toward the main compute device, while supported operations still require implementation checks. Samsung's HBM-PIM illustrates HBM and memory-side processing coexisting as parts of one design.[7]
The illustration uses an explicit data-reduction exercise. A 1 MiB FP32 input contains 262,144 values, divided into 256 groups of 1024. Producing one FP32 sum per group yields 256×4 bytes, or 1 KiB. This is not a complete LLM layer. It shows how supported nearby work may reduce the payload leaving the memory system when downstream computation needs only a smaller result.
The full array must still be read internally, and computation remains. Floating-point accumulation order can change rounding, so validate numerical tolerance and task quality rather than promise bitwise-identical results. Layout, command dispatch and completion synchronization add costs. A 1024-fold payload reduction does not guarantee a 1024-fold reduction in time or energy.
For real inference, candidate operators must match the implementation's operations, precision, capacity and software. Unsupported work remains on the main accelerator. The teacher starts by comparing bytes avoided, then accounts for offload and integration costs. An NMC label is not evidence that the whole service became faster.
Engineer extension: reduction, precision and total cost
This illustrative calculation does not establish a specific product’s supported operation. One MiB of FP32 input contains 262,144 values. Reducing 256 groups of 1024 values returns 256 FP32 subtotals, or one KiB. Internal memory reads remain. A different floating-point addition order may change rounding, so the same mathematical grouped sum still needs error tolerances. Measure setup, layout, synchronization and energy too; fewer interface bytes do not establish a speed or energy multiplier.
Return to the upgrade plan. What should change?

Return to the supplied clues: low concurrency, a limiting weight path, compute headroom, available capacity and no dominant queue. Next compare quality-validated quantization; weight reuse when compatible arrivals exist and the latency budget permits; and effective-bandwidth improvements. These clues do not make extra compute or CXL capacity the first choice. This is a diagnosis from teaching assumptions, not a measured speedup.
If real measurements instead show a compute limit, investigate arithmetic capability and kernel efficiency. A capacity shortage may require sharding or supported tiering, with communication and movement counted separately. When queueing dominates, additional memory alone may not help. Constraints can coexist; the decision table selects the next experiment instead of endorsing every hardware label at once.
Experiments must hold model, quality and serving load constant. In addition to average tokens per second, inspect initial and subsequent latency, tail behavior and completed answers that meet the targets. Cost includes energy, integration and utilization. Chip price or price per gigabyte cannot represent the whole service. Repeat measurement after a change to see whether the limit moved.[8]
Now increase both concurrency and context length. KV storage and reads grow, while batching may share weights more effectively without shortening each person's wait. The previous choice needs revalidation. The transferable method is to draw the data and timing, verify usable paths and choose architecture from matched-workload evidence rather than a fixed component formula.
Glossary
- Prefill — Prompt processing that builds position representations and K/V.
- Decode — Generation that continues from an existing sequence.
- TTFT / ITL / TPOT — First-output wait / adjacent-output gap / average time per token after the first; specify endpoints.
- KV cache — Retained layer keys and values; saves reconstruction, still requires capacity and reads.
- Batch / continuous batching — Compatible sequences in one step / replacing completed work with new sequences.
- GQA — Multiple query heads share fewer KV heads.
- HBM — Stacked DRAM supplying high bandwidth through a wide interface.
- CXL Type 3 — Memory-expansion device type; actual access requires platform support.
- NMC / PIM — Work placed near data or within memory; supported operations vary by design.
Further reading
Primary sources
Checked 2026-10-20. Product documents support their stated scopes; illustrated numbers are explicit teaching assumptions.
- NVIDIA: Mastering LLM Techniques — Inference Optimization
- Efficient Memory Management for Large Language Model Serving with PagedAttention
- GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpoints
- CXL Consortium: Compute Express Link 2.0 Specification — Memory Pooling
- CXL Consortium: Introducing the CXL 3.1 Specification — Webinar Q&A Recap
- TPP: Transparent Page Placement for CXL-Enabled Tiered-Memory
- Samsung Semiconductor: Smart Memory Enables AI Growth
- MLCommons: MLPerf Inference 5.1 — Benchmarking Small LLMs with Llama 3.1-8B
- Linux 6.12: Compute Express Link Memory Devices
- Google Cloud: TPU v5e
- Splitwise: Efficient generative LLM inference using phase splitting
- AMD: HBM Performance Concepts
- NVIDIA TensorRT-LLM: Paged Attention, IFB, and Request Scheduling
- NVIDIA TensorRT-LLM: Quantization
Exercise: compute, traffic and capacity ledger
Compare batch, precision, context and remote-traffic fraction for a supplied 7B model. Larger batches share weight reads across more sequences. Moving hot traffic farther away can increase transfer time.
A simplified time lower bound, not measured tokens/s or a purchasing recommendation. Weights are read once per batch step; KV reads assume dense attention. Attention arithmetic, KV writes, other runtime memory, queueing and kernel overhead are omitted. Memory-channel times are added, then perfect compute/transfer overlap is assumed. Insufficient capacity yields no throughput prediction. GB is decimal; GiB is binary.
Learning guide
AI & Chip Architecture
Prerequisites
- Basic model, accelerator and memory concepts.
What I learned
- Separate prefill, decode and per-user waiting.
- Budget weights, KV capacity and traffic separately.
- Compare architectures using supported paths and matched serving conditions.