1. The question behind choosing a graphics card
Conversations about running large language models locally almost always circle back to three things. Which GPU should I buy, how much VRAM does it have, and what works in CUDA or ROCm? I’ve long been curious about the question one level down. What would a computer designed primarily for LLM inference look like if we started with the physics of moving data and chose the arithmetic units last?
When I was building LLM Calculator, I spent a lot of time working out how much space the weights and context buffer need and what it costs to move activations between cards. In the companion article on n-grams and low-bit quantization, I looked at how to split a model across SSD, RAM and VRAM. Here I want to zoom in further, down to the buffers on the silicon, the energy of one memory access, the network inside a chip and the wait for several accelerators to agree on a result.
The workload matters before we even pick a card. Processing a prompt (prefill) and generating the next token (decode) give the hardware quite different jobs. A server handling a hundred conversations can fetch weights once and use them for a queue of users. Sitting at my terminal, I have to wait for each new token in my own answer. A dense model and a Mixture of Experts also ask quite different things of memory.
The designs I find interesting have this much in common. Move as few bytes as possible, reuse what you fetch close to the arithmetic, and spend transistors on complicated control where the flexibility earns its keep. Follow that idea and you get spatial dataflow, local SRAM, systolic arrays and computation inside memory. A modern GPU already uses several of these ideas. Some specialized accelerators take them much further.
2. The arithmetic of prefill and decode
I see a model read my question and write an answer. The chip sees two rather different jobs. The Roofline model gives us a way to tell them apart. The speed we can reach is bounded both by how fast the chip can do arithmetic and by how fast memory can supply the numbers.
Before writing equations, it helps to give three terms their units. Capacity in GB tells us how much fits. Bandwidth in GB/s tells us how much can flow per second. Latency in seconds or microseconds tells us how long we wait for a particular request or packet. A big warehouse can be slow, and even a very wide link can take a surprisingly long time to deliver one small message.
Take a linear layer with a weight matrix . If each parameter occupies bytes, the matrix takes up
Feed it a batch of sequences with tokens apiece. The input is a matrix , one row of activations per token position. General matrix multiplication (GEMM) computes . It takes about
floating-point operations (FLOP). Why the two out front? A hardware MAC (multiply–accumulate) multiplies two numbers and adds the product to an accumulator. We count the multiply and the add separately. For integer formats the unit is operations rather than FLOP. When comparing datasheets I check both the format and the counting convention.
Arithmetic intensity counts operations per byte transferred at the particular level of memory we’re studying. Optimistically, suppose we read the weights once, read the inputs once and write each output once. Then
where and are the bytes per input and output activation. When the weights account for almost all the traffic, we get a handy approximation.
We’ll put the activations back into the denominator in a moment. They can get quite large for a long prompt. Splitting a matrix into tiles can also require extra reads, and the full Transformer runs attention as well as linear layers.
In prefill, many positions share the weights
During prefill we already know the prompt, so we can process many token positions together. Take one conversation (), a 4,096-token prompt () and one-byte weights (). Counting only the weights gives
Each weight we fetch can do work for thousands of tokens. That gives the matrix units a chance to run at full speed. The bend in the Roofline, called the ridge point , marks the change from a memory limit to an arithmetic limit.
Suppose our accelerator can deliver 1,000 TFLOP/s of dense arithmetic and 512 GB/s of memory bandwidth. The bend is at about 1,953 FLOP/byte. At 8,192 it looks as if we’re safely on the flat compute roof.
Let’s put back those activations. Use a square layer with , , , one-byte weights and two-byte inputs and outputs. The weights occupy 16 MiB, the inputs 32 MiB and the outputs another 32 MiB. The denominator has just grown fivefold, to 80 MiB.
With 512 GB/s, our ceiling drops to about 839 TFLOP/s, below the 1,000 on the datasheet. Even in prefill, the shape of the matrix and the bytes crossing the interface can put the layer back on the memory-limited slope. That’s why figure 01 shows 8,192 for weights alone. Including the input and output of this particular layer gives 1,638.4.
In decode, each sequence gets one new token
Once the model has read the prompt and starts writing, the arithmetic changes. In ordinary autoregressive decoding we need the previous step to begin the next one. For one conversation and , giving
That’s about 1 FLOP/byte for BF16 weights and just 2 FLOP/byte for one-byte weights. Batch conversations on a server and reuse weight reads across them, and the intensity can rise toward . Verifying several proposed positions together in speculative decoding also improves reuse. A server’s record aggregate throughput tells me little about the wait for the next word on a machine in my workshop.
Try another illustrative chip with a ridge point of . At , memory supplies operands for just of the peak arithmetic rate. That leaves 99.5% of the potential FLOP/s out of reach while the multipliers wait for weights. The percentage describes throughput. It tells us nothing about how many physical transistors have switched off. As the conversation grows, attention also has to read a growing KV cache of keys and values for earlier tokens, competing for that same bandwidth.
In practice — time the first token and the ones that follow
If a long answer feels sluggish, time two things for the same prompt. How long until the first token appears (TTFT, often dominated by prefill)? How long between tokens once the model starts writing (decode)? That tells you which phase to investigate for a compute or memory limit.
3. Why do von Neumann and Harvard both hit the memory wall?
The textbook distinction between von Neumann and Harvard architectures asks whether instructions and data share memory or travel on separate paths. Modern processors often have a shared address space and separate L1 instruction and data caches. With a large language model, I find a different question more revealing. How far is a weight from the multiply–accumulate unit that needs it, and who arranges the trip?
Two kinds of memory appear in the diagrams. SRAM is fast static memory, used here on the chip itself. DRAM stores bits more densely and needs refreshing. Accelerators use DRAM in the form of GDDR chips on a board or HBM stacks close to the processor. How we manage a memory matters as much as how we build its cells. A hardware cache automatically keeps recently used lines in the hope we’ll need them again. A scratchpad is local workspace where the program or compiler explicitly places tiles of data.
In a conventional processor a program counter points to an instruction. The decoder interprets it, the core fetches operands, does the work and writes back a result. Pipelining, out-of-order execution and vector instructions overlap parts of that sequence. A GPU shares some of the control cost across many threads. Figure 02 uses NVIDIA’s name SM (streaming multiprocessor). The CUDA programming model describes how an SM executes a warp of 32 threads under SIMT. It also houses tensor units and local SRAM. SIMT describes how instructions execute. A NoC (network-on-chip) connects blocks on the silicon and can appear in either a GPU or a dataflow chip.
The energy of an operation and the journey of its operands
On a real chip it costs energy to switch a gate and to charge the capacitance of a long wire. The usual estimate for dynamic power is
where is switching activity, capacitance, supply voltage and clock frequency. The energy for one switching event scales with . I still find Mark Horowitz’s ISSCC 2014 comparison (slide 32) a good way to see what a journey costs relative to the arithmetic. These numbers are for a 45 nm process.
| Operation in the historical comparison | Energy |
|---|---|
| 8-bit integer addition | 0.03 pJ |
| 8-bit integer multiplication | 0.2 pJ |
| FP16 addition | 0.4 pJ |
| FP16 multiplication | 1 pJ |
| 64-bit access to 8 KB SRAM | 10 pJ |
| 64-bit access to 1 MB SRAM | 100 pJ |
| 64-bit access to DRAM | 1300–2600 pJ |
Watch the widths in the table. The cleanest comparison uses two reads of the same width. Fetching 64 bits from external DRAM cost about 130 to 260 times as much as a 64-bit read from the small 8 KB SRAM. The absolute picojoule figures change with the process, voltage and bank design. INT8 and FP8 arithmetic also have different costs. The distance traveled still matters. For the energy of a token, I’d budget
where counts bytes moved at level of the memory hierarchy at an energy cost per byte. Shortening the trip a weight has to make can save a designer far more energy than squeezing another small improvement out of the multiplier.
Cache capacity and weight reuse
What happens to an ordinary cache while a model is writing? A 70B model at one byte per parameter weighs about 70 GB. If the last-level cache on a card holds a few tens of megabytes, the weights for layer one will be long gone by the time we finish all 80 layers for this token. Next token, we fetch them from DRAM again.
The cache still helps within a tile, with activations or with reuse across a batch. But a sequential pass over 70 GB of weights is a stream larger than the cache. There can also be conflict thrashing when hot lines keep evicting one another from the same sets. A substantial win on today’s GPUs comes from fusing kernels so intermediate results stay on chip. FlashAttention reorganizes attention specifically to avoid writing large intermediate matrices back to HBM.
4. Dataflow, stationary weights and computation in memory
In spatial dataflow, we lay pieces of the computation graph out on physical resources. Data move from neighbor to neighbor as dependencies are satisfied. Hardware can control the transfers, or software can lay out an explicit pipeline with DMA engines and small helper processors. Either way, a central memory needn’t supply every instruction and operand in turn.
Systolic arrays let neighbors reuse a value
The classic example is a systolic array, a regular grid of small processing elements (PEs), each with registers and a MAC. Feed a number in at the edge and one neighbor can pass it to the next on each clock tick. We save a trip to distant memory for every multiply that reuses it. Jouppi and colleagues describe how Google used this idea in its first commercial TPU.
In an output-stationary arrangement, a running sum stays in its PE and two streams of operands pass each other at right angles. One clock tick does the following.
Stagger the inputs at the edge of an array and a reduction of length takes about cycles, including filling and draining the pipeline. With a short , quite a bit of our time goes into getting the array started and emptying it again.
In a weight-stationary array, how long can a weight stay put?
We can swap the roles. Pin a weight in each PE, send activations along rows and let partial sums travel down columns. That’s weight-stationary dataflow.
Get the timing right and the bottom of a column produces .
Consider the sizes. A vector of 8,192 BF16 activations weighs just 16 KiB. The weights of a 70B model at one byte each weigh 70 GB. I’d much sooner send that activation vector between tiles. The question is how long the weights can actually stay put. Keeping a tile resident for a multiply saves traffic inside a layer. Eliminating repeated external weight reads between tokens would require enough local SRAM to keep all layers resident. Activations, partial sums and KV data would still travel. With an explicit scratchpad the compiler can schedule the pipeline down to the cycle, provided it accounts for bank conflicts and traffic on the NoC.
PIM and CIM move computation near memory or into its cells
If taking data out of memory costs that much, why not take the computation to the data? Digital processing-in-memory (PIM) puts arithmetic units near DRAM banks or on the logic layer of a 3D stack. They can use the banks’ considerable internal parallelism before the data reach a narrow external bus.
Analog compute-in-memory (CIM) goes further. A crossbar uses ordinary circuit laws to perform a matrix multiplication. Encode a weight as the conductance of a cell. Apply an input voltage , generated by a digital-to-analog converter (DAC). By Ohm’s law the current at an intersection is . By Kirchhoff’s current law the currents add along a column,
and an analog-to-digital converter (ADC) turns that sum back into a number. One way to represent a negative weight is by a difference between two columns. IBM built a 64-core demonstrator using phase-change memory (PCM).
On paper the whole matrix multiply happens as the circuit settles. On silicon, large matrices have to be split among smaller arrays. Parasitic capacitance, voltage drops along wires, thermal noise and cell drift limit precision. The ADCs and DACs can take a substantial share of the silicon area and energy we thought we’d saved.
5. The silicon paradox of 6T SRAM and 1T1C DRAM
This is usually where somebody asks the obvious question. If local SRAM is so fast and energy-efficient, why can’t I buy a card with 80 GB of it? Start with one bit on the silicon.
A conventional 6T SRAM cell uses two cross-coupled inverters and two access transistors. That’s six transistors per bit. A 1T1C DRAM cell holds a charge in a tiny capacitor behind a single transistor. It needs periodic refresh, but you can pack the cells much more densely. Let’s count just the cell transistors for 80 decimal gigabytes of 6T SRAM.
Nearly four trillion transistors for the bits alone. We haven’t added address decoders, sense amplifiers, wires or a single compute unit. For a quick sensitivity calculation, assume an effective SRAM density of .
Even if a newer process packed in four times as many megabytes per square millimeter, we’d still need 80,000 mm² of silicon. For scale, a large GPU die typically measures a few hundred mm².
Two answers in silicon, GroqChip and Cerebras WSE-3
One answer fits into a PCIe slot. The GroqCard datasheet for GroqChip lists up to 80 TB/s of internal bandwidth, with 230 MB of SRAM. If I want an 80,000 MB model to live entirely in that memory, division gives me a lower bound of
chips. That calculation gives the weights every byte, before buffers, graph-partitioning overhead or communication between racks.
The other answer is to use nearly the whole wafer. The Cerebras CS-3 specification gives its WSE-3 an area of 46,225 mm², four trillion transistors, 900,000 cores, 44 GB of SRAM and 21 PB/s of aggregate memory bandwidth. Redundant connections route around manufacturing defects on the wafer. Cerebras also describes its WSE-3 Turbo and CS-4. I’ve used the CS-3 datasheet for the figures here.
For both designs, that remarkable SRAM bandwidth is at its most useful when the weights we need can stay on chip from one token to the next. What stands between a home workstation and tens of gigabytes of SRAM on a cheap expansion card is the geometry of a six-transistor bit cell.
6. What dense models and Mixture of Experts ask of memory
The model itself changes the economics. In a dense model, almost the entire set of weights participates in each token ( in our estimate). In the Mixture of Experts architecture described by Shazeer et al., a router selects only out of experts per token. Shared layers still run each time, but the active fraction can be much smaller than the complete model.
Think about what that means on two different machines.
- On a cluster built around expensive SRAM, a small batch can make MoE an awkward fit. We pay for enough silicon to house every expert while a single token wakes only a few. Dynamic routing adds imbalance and network traffic. Under heavier server load, different tokens can put different experts to work at the same time.
- On a workstation with roomy but slower DRAM, this looks much more attractive. We can afford to store the full model. Only the active slice of weights has to cross the narrow bus for one decode step,
where is the bandwidth we actually achieve after overhead. Increase the batch of conversations and more distinct experts can become active on the same step. For a complete decode step we can bound the time from below by the slower of the compute path and the path for all the bytes that have to move,
then account for what the scheduler couldn’t overlap, including synchronization and kernel launches. And before choosing between dense and MoE, I’d still compare the answers on the same task.
In practice — count all the experts, then the active ones
For a MoE model on your own machine, keep two numbers side by side. Total parameters help tell you whether you can store the model. Active parameters per token give you a first estimate of the ceiling on writing speed.
7. How does Tenstorrent Blackhole differ from a GPU?
Tenstorrent Blackhole caught my attention because it pairs explicit dataflow across a grid of cores with fairly ordinary, inexpensive external GDDR6. The card documentation lists 120 active Tensix cores and 180 MB of local SRAM on both the p100a and the p150a. The p100a has 28 GB of GDDR6 at 448 GB/s. The p150a has 32 GB at 512 GB/s. The manufacturer’s store listed the bare cards at USD 999 and USD 1,399 respectively. I’ll come back to the cost of the rest of the machine, including the cables.
What can we actually do with those 180 MB? They make a very fast workspace for tiles and circular buffers. The weights of a model with tens of billions of parameters still live in external GDDR6. For single-stream decode on a p150a, the same 512 GB/s Roofline limit applies. The interesting opportunity for Tensix is what happens after data arrive on chip. A tile can go through a chain of operations on neighboring cores before anything has to make the trip back to DRAM.
Five small RISC-V controllers and local L1 in a Tensix core
The Tensix programming model gives data transport and computation to separate little processors on each tile. Here’s how the work is divided.
| Core component | Role |
|---|---|
| Local SRAM, called L1 | Explicitly managed tiles, circular buffers and other data |
| BRISC / NCRISC | Data-movement programs, NoC requests and synchronization |
| TRISC0 — unpack | Controls operand delivery to the compute engine |
| TRISC1 — math | Controls the matrix unit and vector SFPU |
| TRISC2 — pack | Controls result formatting and writes |
Two RISC-V cores, BRISC and NCRISC, move tiles and handle synchronization. Three more, TRISC0–2, direct unpacking, math and packing. The math stage has a matrix engine and a vector special-function unit (SFPU) that helps implement operations such as softmax, SiLU, RMSNorm and RoPE. Across the grid, tiles can run their own programs (MIMD). Inside a tile are specialized matrix units and vector units that operate on multiple elements at once (SIMD).
The network-on-chip and an explicit address
Two independent torus networks connect the tiles. Down at the hardware level, a NoC address can be written . Tenstorrent’s memory guide for kernel developers shows how to specify the tile’s coordinates and an offset in its local L1 SRAM. You can tell where the data actually live from the address.
One core can put a computed tile straight into its neighbor’s circular buffer. The neighbor waits for a ready signal, then starts its stage of the pipeline. As long as intermediate results fit in the 1.5 MB of L1 per core, they can skip GDDR6 entirely. Run out of space or stall the schedule and data may spill to external memory, where the KV cache is already competing for bandwidth. Explicit local memory gives the software a scheduling job that hardware cache control would otherwise take on.
What a kernel looks like in TT-Metalium and CUDA
I find that division easiest to see when I look at an actual TT-Metalium kernel alongside a CUDA one. In TT-Metalium you declare circular buffers and write three small programs, a reader, a compute kernel with unpack, math and pack stages, and a writer. The official eltwise_binary example is short enough to follow the tiles all the way through.
It feels a little like passing messages between small network nodes that happen to share a piece of silicon. You keep track of room in the buffer and the order of the packets. CUDA starts you off with threads and blocks. Tuning a GPU kernel can still take you down to explicit shared memory, barriers and asynchronous copies. Both give you control over locality. They divide the responsibility between programmer, compiler and hardware at different points.
The cost and precision of a shared exponent in Block Floating Point
To fit more weights and simplify the multipliers, Tenstorrent makes extensive use of Block Floating Point (BFP). A group of 16 values shares a one-byte exponent,
or, in integer notation, , where the shared scale sets the grid spacing for the block. In BFP8 each of the 16 values gets a byte for its sign and mantissa. In BFP4 it gets half a byte. Include the exponent and the real storage per weight is
Now put one unusually large weight among those sixteen. It forces a large shared exponent. The fifteen smaller values lose mantissa precision. BFP8 is a lossy format. I’d check answer quality against BF16 and record the math fidelity setting, which determines the number of passes used to multiply the mantissas in the core.
The X280 application cores
Blackhole also has 16 SiFive X280 RISC-V application cores on the same silicon. There’s a demonstration of Linux running on the card itself. In principle, some control logic could move off the host CPU and onto the accelerator, saving calls over PCIe. How much that buys depends on driver and runtime support.
8. With several cards, bandwidth is only half the equation
As long as a whole model fits on one card, more effective memory bandwidth raises the ceiling on decode speed. Splitting the model is where it gets interesting. With pipeline parallelism, successive groups of layers live on successive cards. One token visits them in order, leaving much of the hardware idle unless other jobs fill the pipeline. With tensor parallelism, the cards work on slices of the same matrix simultaneously. That can reduce time per token, at the price of repeatedly exchanging partial results.
Where do 160 reductions per token come from?
In tensor parallelism, cards compute their pieces of a product and then have to agree on a sum through a collective operation called All-Reduce. If four cards produce 2, 3, 5 and 7 for one coordinate, each needs to have 17 before it can proceed. The classic Megatron-LM partition does this twice per Transformer block, after attention and after the MLP. For 80 layers (), each token requires
collective operations. A ring All-Reduce over cards takes reduce-scatter steps, in which each card accumulates the complete sum for its slice, and all-gather steps, which distribute the finished slices to everyone. In a simple – model, one reduction of an activation vector containing bytes takes
where is the fixed startup latency for a protocol hop and is the link’s usable bandwidth. A different graph partition or operation fusion can change that count of 160. Let’s use cards and a vector of 8,192 BF16 values, or (16 KiB), and try three illustrative sets of numbers.
| Assumed | Assumed | One Ring All-Reduce | 160 reductions |
|---|---|---|---|
| 5 µs | 25 GB/s | 30.98 µs | 4.96 ms |
| 15 µs | 12 GB/s | 92.05 µs | 14.73 ms |
| 1 µs | 100 GB/s | 6.25 µs | 1.00 ms |
Look at the latency term alone, . With between 5 and 15 µs, starting the small messages costs 4.8–14.4 ms for every token generated, however much bandwidth you buy. For a 16 KiB vector I’d pay close attention to hop latency and the topology. A tree, for example, has a different hop pattern from a ring.
PCIe depends on the board topology and peer-to-peer support
In a machine with consumer GPUs and no NVLink bridges, those messages travel over PCIe. With motherboard, processor and driver support for peer-to-peer (P2P) access, one card can transfer data directly to another via a PCIe switch or root complex. If the topology spans NUMA sockets or ACS isolation redirects the traffic, direct transfers may be unavailable and the data may need to go through host RAM. That extra trip drives up .
Blackhole has direct card-to-card links
This is where the four QSFP-DD 800G connectors on the p150a/p150b bracket start to make sense. The connectivity documentation describes using them to connect Blackhole cards directly. Converting the labels from bits to bytes gives
or a nominal 100 GB/s on one port and 400 GB/s across four, before accounting for line encoding, protocol overhead and transmit/receive counting conventions. The attraction for me is that the motherboard can come out of the critical path. The chips can pass tiles between their NoCs over their own cables, provided the runtime supports the chosen topology.
Memory budgets and the cost of the cards
Let’s put capacities and prices together. The weights, context cache and runtime overhead all need a home.
I’m using decimal units here, so 32 GB means bytes. The SRAM is separate on-chip workspace. Adding it to GDDR6 capacity would overstate the space available for weights.
| Configuration | Card-only price | GDDR6; local SRAM | Sum of rated GDDR6 bandwidths |
|---|---|---|---|
| 1 × p100a | USD 999 | 28 GB; 180 MB | 448 GB/s |
| 1 × p150a | USD 1,399 | 32 GB; 180 MB | 512 GB/s |
| 2 × p150a | USD 2,798 | 64 GB; 360 MB | 1024 GB/s |
| 4 × p150a | USD 5,596 | 128 GB; 720 MB | 2048 GB/s |
Set aside an illustrative 4 GB per card for KV cache and runtime buffers. For a uniformly quantized dense model the parameter ceiling is . Here’s what that leaves.
| Configuration | Assumed KV + runtime reserve | Dense BF16 ceiling | Dense BFP8 ceiling | Dense BFP4 ceiling |
|---|---|---|---|---|
| 1 × p100a | 4 GB | 12.0B | 22.6B | 42.7B |
| 1 × p150a | 4 GB | 14.0B | 26.4B | 49.8B |
| 2 × p150a | 8 GB | 28.0B | 52.7B | 99.6B |
| 4 × p150a | 16 GB | 56.0B | 105.4B | 199.1B |
A real shopping list also needs the motherboard, power supply, tax, shipping and the cables themselves. On October 22, 2026 the manufacturer’s store listed a half-meter QSFP-DD cable at USD 200 before discounts. The six cables for the four-card full mesh in figure 05 add USD 1,200 to the basket for cabling alone.
KV cache depends on layers, GQA heads and context length
Now replace that fixed reserve with a calculation for the context. In grouped-query attention (GQA), several query heads share key and value heads. What sets KV cache size is the number of KV heads, . We needn’t allocate a separate copy for every query head.
Use actual dimensions from NVIDIA’s Llama 3.3 70B configuration. There are layers and KV heads of dimension . Store the cache in BF16 ( bytes). One context token for one sequence uses
A thousand tokens take 327.68 MB. In the chart below, 32k means 32,768 tokens. That’s 10,737,418,240 bytes, exactly 10 GiB, or about 10.74 decimal GB. At 16k the figures halve to 5 GiB or about 5.37 GB.
In figure 06 I’ve separated KV from runtime and allowed 4 GB of runtime workspace for the entire four-card system, for example 1 GB per card. That replaces the previous blanket 16 GB reserve. It explains how a hypothetical 110B BFP8 model with 16k context can just fit into 128 GB when the previous table gave a ceiling of 105.4B.
Here are the figures behind each bar in figure 06, in decimal GB with .
| Scenario | Weights | KV | Runtime | Remaining from 128 GB |
|---|---|---|---|---|
| 70B BF16, 32k | 140.000 | 10.737 | 4.000 | −26.737 |
| 70B BFP8, 32k | 74.375 | 10.737 | 4.000 | 38.888 |
| 110B BFP8, 16k, hypothetical GQA as above | 116.875 | 5.369 | 4.000 | 1.756 |
| 180B BFP4, assumed 20 GB KV | 101.250 | 20.000 | 4.000 | 2.750 |
When I do this for an actual checkpoint, I look in its metadata. A “70B” model can have slightly more than 70 billion parameters, and some layers may still be BF16 or FP32. There’s also a condition the total bar can’t show. Each card has to fit its own share. Try putting 40 + 30 + 30 + 25 GB onto four 32 GB cards. The total looks safe at 125 GB. The first card runs out of memory immediately.
In practice — check the memory split and time the exchange
Before buying a second or third card for one large model, work out where the layers and buffers go on each device. Then time the exchange of a single activation vector of the size the model uses. That measurement can cool my enthusiasm rather faster than the total VRAM figure.
9. Beyond discrete PCIe cards, from unified memory to custom silicon
Dividing a model across PCIe cards costs us synchronization time and cables. Outside the world of expansion cards there are two quite different ways to approach the problem.
Unified memory keeps the model in one pool
One is to give the CPU and GPU a large common pool of memory on the same board or package. The Apple M3 Ultra can be configured with up to 512 GB of unified memory at over 800 GB/s. The AMD Ryzen AI Max+ 395 / Ryzen AI Halo platform offers up to 128 GB at 256 GB/s.
Look at that through the Roofline from chapter 2. What I’m buying first is capacity and simplicity. A large model can live in one address space without partitioning it or paying for those 160 inter-card reductions per token. The speed of one answer still depends on that shared bandwidth, whether it’s 256 or 800 GB/s. The operating system needs some of the pool, too. Outgrow one box and the relatively slow network between machines becomes a problem again.
An ASIC for an architecture or an ASIC for one model?
The other approach is to build an application-specific integrated circuit (ASIC) for just one kind of work, going straight after the energy-per-token equation from chapter 3. Even here there are degrees of specialization. Etched designs silicon for the Transformer architecture. Taalas describes going a step further and encoding a particular model in the chip masks themselves.
A Transformer-specific chip can still load new weights if a better model comes out in six months. Hardwiring the model can cut control and weight movement to a minimum, but a substantial change to the weights or architecture requires new silicon. Either way, the bill in a server room also includes I/O, long-context KV handling and cooling.
10. Matching the architecture to the task and running the numbers for your own machine
Put the pieces together, from the Roofline and Horowitz’s picojoules to the size of a 6T cell and the wait for 160 reductions, and it’s easy to see why GPUs have remained the default for so long. High HBM or GDDR bandwidth, tensor units, local SRAM and mature software come in one general-purpose package. The alternatives make different physical tradeoffs. SRAM on a wafer or across a cluster gives priority to latency. Unified RAM can hold a large model without splitting its graph. Direct links can carry a pipeline from one card to the next.
In practice, I split the hardware decision into three cases.
- The model fits on one card. I look at achievable memory bandwidth, support for the chosen quantization in engines such as llama.cpp or vLLM, measured tokens per second and prefill time. Peak TFLOP/s stay on the box if the kernels can’t use them.
- I want the shortest wait for one sequence. Keeping the weights close to the arithmetic matters. To compare a local machine with a cloud endpoint backed by fast SRAM, I’d use the same task and record time for the whole answer and cost per million tokens.
- The model spans several cards. I check capacity per card, the cost of reading the KV cache and the latency of the links between devices.
Four steps for a calculation of your own
I work through the same four steps to turn a datasheet into numbers I can use for my machine.
- From the model metadata, record total and active parameters (especially for MoE), actual quantized size and GQA layout for the KV cache. Choose the target context and batch.
- Measure achievable memory bandwidth and All-Reduce time for the small activation vectors this model actually uses.
- On the running engine, compare time to first token, the interval between tokens and throughput under concurrent requests.
- After quantization, check answer quality on a fixed set of tasks.
The Roofline calculation gives me a physical ceiling. A benchmark tells me how much of it the software delivers. The gap between those two numbers is usually the part I most want to investigate. Whatever logo is on the card, I end up back at the same question. Where are the data, how many times do we move them, and what exactly is holding up the next token?
11. Research papers and further reading
- Williams, Waterman and Patterson, Roofline: An Insightful Visual Performance Model for Multicore Architectures (2008 report, CACM 2009) relate data movement to attainable compute performance.
- Horowitz, Computing’s Energy Problem (and What We Can Do About It) (ISSCC 2014) compares arithmetic and memory access costs in a 45 nm process (presentation slides).
- Jouppi et al., In-Datacenter Performance Analysis of a Tensor Processing Unit (2017) describe the systolic array and measurements of Google’s first TPU.
- Dao et al., FlashAttention (2022) reorganize exact attention to reduce traffic between SRAM and HBM.
- Le Gallo et al., A 64-core mixed-signal in-memory compute chip based on phase-change memory for deep neural network inference (2023) describe physical PCM hardware combining analog crossbar multiplication with digital logic.
- Shoeybi et al., Megatron-LM (2019) describe tensor-parallel Transformer layers and the All-Reduce operations they require.
The hardware specifications and prices linked in the text come from the manufacturers’ own material (Tenstorrent, Groq, Cerebras, NVIDIA, Apple, AMD, Etched and Taalas). I use them as a starting point for independent measurements of the complete system.