A convolution is a matrix multiply in disguise

Convolutional networks look like image processing and compute like linear algebra. Unrolled, a convolution layer is a matrix multiplication, and one ordinary layer turns 37 thousand weights into 116 million multiply-accumulates. That ratio is the reason specialised inference hardware exists at all, and it is the number our architecture is built around.

21 November 2026CurrentNot yet4 references

The claim

A convolutional network looks like image processing and computes like linear algebra. Unroll a convolution layer and it is a matrix multiplication — the same operation a fully connected layer performs, arranged differently.

That is not a simplification for a general audience. It is the fact that makes specialised inference hardware possible. If the expensive part of a network were a hundred different operations, there would be nothing to build. It is one operation, repeated an enormous number of times, and the whole discipline follows from that.

This post exists because the rest of our material assumes it. When we say the array performs a multiply-accumulate, this is the multiply-accumulate we mean.

What a convolution computes

A small grid of weights — the kernel, typically 3×3 — slides across the input. At every position it multiplies each of its weights by the input value underneath and adds the results into a single output number. Move one step, repeat. The grid of outputs is a feature map.

Two details matter for everything below.

The kernel has depth. An image has three colour channels; a layer in the middle of a network has dozens or hundreds. A 3×3 kernel over 64 input channels is 3 × 3 × 64 = 576 weights, and each output value is the sum of 576 products.

There are many kernels per layer. Each produces its own feature map. A layer with 64 output channels runs 64 separate kernels over the same input.

The architecture in this form dates to LeCun and colleagues in the 1990s [1], and became the dominant approach to vision after it was shown to win at scale [2].

Why this is not just a fully connected layer

A fully connected layer gives every output its own weight for every input. For a 56×56×64 input that is roughly 200,000 inputs, and a layer with as many outputs would need forty billion weights. Nobody builds that.

A convolution makes two assumptions and both pay enormous dividends. Locality: an output depends only on a small neighbourhood of the input, so a kernel is 3×3 rather than 56×56. Weight sharing: the same kernel is used at every position, because an edge in the top-left of an image is the same thing as an edge in the bottom-right.

Weight sharing is the one to hold on to. It means a convolution layer has very few weights and does a very large amount of arithmetic with them.

One ordinary layer, counted

Take a layer from the middle of a standard residual network [3]: a 56×56 feature map with 64 channels, a 3×3 kernel, 64 output channels, stride 1, padding 1. The output is 56×56×64.

Weights: 3 × 3 × 64 × 64 = 36,864.

Multiply-accumulates: every one of the 56 × 56 × 64 = 200,704 output values is a sum of 3 × 3 × 64 = 576 products. That is 200,704 × 576 = 115,605,504 multiply-accumulates.

So each weight is used 3,136 times — once per output position, which is 56 × 56.

Figure 1One convolution layer: weights, activations, arithmetic
One convolution layer: weights, activations, arithmeticThe asymmetry that shapes inference hardware. A layer holds thirty-seven thousand weights and performs a hundred and sixteen million operations with them — a reuse factor of 3,136. Note the logarithmic axis: the arithmetic bar is three thousand times the weight bar.10000100000100000010000000100000000COUNT, LOGARITHMIC (values or operations)Weights3×3 kernel, 64 in, 64 out36864Activations in56 × 56 × 64200704Multiply-accumulates200,704 outputs × 576 products115605504
modelled

The asymmetry that shapes inference hardware. A layer holds thirty-seven thousand weights and performs a hundred and sixteen million operations with them — a reuse factor of 3,136. Note the logarithmic axis: the arithmetic bar is three thousand times the weight bar.

Measured: Nothing. No hardware was measured for this figure. Modelled: All three bars, computed directly from the layer's dimensions. The arithmetic is in the text and can be checked by hand.

Hold those three numbers side by side. The weights are small enough to keep anywhere. The arithmetic is large enough to dominate everything. That gap is the entire argument for inference accelerators, and it is why a part that stores weights permanently and cheaply, and performs multiply-accumulates in place, is worth building.

The unrolling

The matrix-multiply claim is now straightforward to see.

Build a matrix whose every row is one patch of the input, flattened — all 576 values a single output position needs. For our layer that is a 200,704 × 576 matrix. Build a second matrix whose columns are the kernels, flattened: 576 × 64. Multiply them and you get 200,704 × 64, which is the output feature map.

The convolution has become one matrix-matrix product, and this restructuring is standard practice in essentially every deep learning framework. It costs memory — each input value appears in several patches, so the first matrix is larger than the input it came from — and it buys the ability to use a single highly optimised routine for a layer type that otherwise needs its own.

Two consequences follow, and they are the reason this post exists:

Hardware never has to understand convolution. It needs to multiply a vector by a matrix of weights quickly and cheaply. Convolution, fully connected layers and the projections inside attention all reduce to that one operation. Building hardware for a matrix-vector product means building hardware for almost all of deep learning.

Weight reuse determines where the weights should live. If a weight is used 3,136 times in a layer, fetching it 3,136 times from external memory is absurd, and fetching it once and keeping it close is obviously right. Most accelerators pursue that with caches. The approach we take is to put the weights physically inside the array that multiplies by them, permanently, so they are never fetched at all. That is the subject of the crossbar post.

Where this stops being the whole story

Three honest limits, because a post that only tells you the convenient half is advertising.

Not every layer has this reuse profile. Depthwise convolutions, used precisely because they are cheap, apply one kernel per channel rather than mixing channels. They do far less arithmetic per weight, which means they are limited by moving data rather than by computing, and an array built for high reuse fills poorly. Our model selector reports which models map badly for this reason, rather than showing only the flattering ones.

Achieved throughput is well below peak. Layer shapes do not tile perfectly onto a fixed array, and the gap between operations a part could do and operations it does is where most accelerator performance is won or lost [4].

Attention is a different shape. In a transformer the dominant matrices are built from the input at run time rather than held as fixed weights, so the reuse argument above does not apply in the same way. That needs its own treatment, in the attention post.

What to take from this

One sentence: a convolution is a matrix multiply, and one layer turns thirty-seven thousand weights into a hundred and sixteen million operations.

Everything our architecture does follows from the second half of that sentence. The weights are small and reused thousands of times, so storing them in place and never moving them is worth real engineering. The arithmetic is enormous and identical, so doing it in the memory array rather than fetching operands to a separate unit is worth more.

References

  1. Y. LeCun, L. Bottou, Y. Bengio and P. Haffner, “Gradient-based learning applied to document recognition,” Proceedings of the IEEE, vol. 86, pp. 2278–2324, 1998. doi:10.1109/5.726791reviewThe paper that established the convolutional architecture in the form still used. Volume and pages confirmed from Semantic Scholar; the issue number is corroborated only by a third-party reference list, so it is omitted here rather than stated as checked.
  2. A. Krizhevsky, I. Sutskever and G. E. Hinton, “ImageNet classification with deep convolutional neural networks,” Communications of the ACM, vol. 60, no. 6, pp. 84–90, 2017. doi:10.1145/3065386measured siliconThe CACM reprint of the NIPS 2012 paper, cited here because it is the version with a DOI. Record confirmed against both Crossref and Semantic Scholar.
  3. K. He, X. Zhang, S. Ren and J. Sun, “Deep residual learning for image recognition,” Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778, 2016. doi:10.1109/CVPR.2016.90measured siliconResidual connections, which made depth practical. Cited for the layer shapes the worked example is drawn from. Confirmed on Semantic Scholar; the Crossref cross-check was rate-limited.
  4. V. Sze, Y.-H. Chen, T.-J. Yang and J. S. Emer, “Efficient processing of deep neural networks: a tutorial and survey,” Proceedings of the IEEE, vol. 105, no. 12, pp. 2295–2329, 2017. doi:10.1109/JPROC.2017.2761740reviewThe standard treatment of dataflow, reuse and why achieved throughput falls short of peak.

Corrections. If a figure here is wrong, or a citation does not support the sentence it is attached to, tell us. The post gets corrected in place and says what changed.

All research notes