ContentsThe library

What It Costs to Run a Model

What a Million Words Actually Costs

Last timeTwo Phases, Two Bottlenecks

Everything in this course assembles into a single number, a price per million words, and that number ranks the available changes honestly.

Everything in this course has been a term in one calculation. This lesson runs

it, and then uses it to put the available changes in order.

FIG 1From bytes per pass to dollars per million words
what the machine costs for an hour, which for eight chips is in the region of twenty-four dollars
the seconds one pass takes, which is the bytes moved divided by the memory bandwidth
how many requests are grouped, since one pass produces one word for each of them
seconds in an hour, converting the hourly price into a price per second
scaling the answer up to a million words, which is the unit prices are usually quoted in
the cost of producing a million words, before anything is marked up
Nothing in this needs measuring. The bytes come from the model and the group, the bandwidth and the price come from the hardware, and the result is a floor that a real system will land above.

The four steps

Take the machine this course has been using throughout: a hundred and forty

gigabytes of weights, three thousand gigabytes a second of memory bandwidth,

sixty-four conversations grouped, each holding one and a third gigabytes. One

pass moves two hundred and twenty-six gigabytes and takes seventy-five

milliseconds, producing sixty-four words. That is eight hundred and fifty words a

second, three million words an hour, and at twenty-four dollars an hour it comes

to about eight dollars a million words.

It is worth pausing on how little that calculation needed. No profiler, no

benchmark run, no access to the machine. Four numbers about the model, two about

the hardware and one about the group, and the result is within a small factor of

what a well-run service will actually achieve. That is unusual in computing, and

it is a consequence of the whole system being limited by one resource whose rate

is published on a specification sheet.

FIG 2What a single pass is actually reading
At a group of sixty-four the two are already comparable. Grow the group further and the second slice overtakes the first, which is the point at which adding requests stops being nearly free.
FIG 3Four configurations of the same machine
stepgigabytes moved per passmilliseconds per passwords per seconddollars per million wordswhat happened
1226758537.8The starting point: two bytes a number, summaries shared eight ways, sixty-four grouped.
211337.716983.9One byte a number instead of two. Both the weights and the stores halve, so the whole pass halves.
348316115904.2Back to two bytes but with two hundred and fifty-six grouped. Each pass is much slower and produces four times as many words.
424280.731722.1Both changes at once. They multiply rather than overlapping, because one shrinks the bytes and the other spreads them.
4 steps
The last row costs a quarter of the first. No new hardware was bought and the model is the same model, slightly less accurate in its arithmetic and reaching the same answers.
FIG 4The changes, ranked by what they do to the bill
throughput against the sdollars per million word
one byte a number instea2.003.90
group of two hundred and1.864.20
summaries shared sixty-f1.495.20
half the conversation le1.236.30
the starting point1.007.80
The order is stable across model sizes, because every entry is a statement about bytes moved per word and nothing else. What changes between deployments is which ones are available.

What each one is paid for with

The ranking above is only half an answer, because the column it leaves out is

what you give up.

The lesson stops here

2 more paragraphs to go

You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.

The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.

See the planThe contents

This is the reading half

Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.

The contents

The rest of this course

  1. 01The Two Kinds of Work
  2. 02Paying for Precisionopening only
  3. 03The Ceiling You Cannot Code Aroundopening only
  4. 04What the Model Holds On Toopening only
  5. 05The Length at Which Everything Changesopening only
  6. 06The One Trick That Actually Worksopening only
  7. 07Reading and Writing Are Different Jobsopening only
  8. 08What a Million Words Actually Costsyou are here

Read alongside