S14 Machine learning · Practice
Running neural networks on hardware
Problems dealt one at a time, with new numbers every time. The kinds you miss come back more often, and you can keep going as long as you like.
0 solved
0 in a row
0 of 10 kinds solid
Check
A dense layer maps 1024 inputs to 256 outputs for a batch of 32. How many FLOPs does it take?
Check
A model has 7 × 10⁹ parameters stored at 4 bits each. How many gigabytes do its weights take?
Check
A 7 × 10⁹-parameter model with 4-bit weights generates text at batch size 1 on a device with 3000 GB/s of memory bandwidth. What's the upper limit on tokens per second?
Check
A chip peaks at 100 TFLOP/s with 0.5 TB/s of memory bandwidth. What performance can a kernel with arithmetic intensity 300 FLOP/byte reach, in TFLOP/s?
Check
Weights up to ±0.5 are quantized symmetrically with 127 positive levels. What's the RMS rounding error?
Check
An inference does 1 × 10⁷ multiplies at 0.2 pJ each and reads 1 × 10⁸ values from DRAM at 640 pJ each. How much energy does it take?
Write units the way you normally would: 1.5 J, 1500 mJ and 0.0015 kJ are the same answer.
Check
A 7-billion-parameter model with 4-bit weights runs on a chip with 1000 TFLOP/s and 3 TB/s.
(a)
At what batch size does it become compute-bound?
(b)
What throughput does it reach once compute-bound?
Check
FLOPs: D = 64, H = 64, B = 512?
Check
Tokens/s bound: 1 × 10⁸ parameters, 4 bits, 8000 GB/s?
Check
Roofline: F = 1, W = 0.1, I = 1000?
A kind of problem counts as solid once you've got it right on the first try twice in a row. Back to the lesson · Practice every topic in S14