1/11
Learn

A sharding sheet, the way the Anthropic session asks

A candidate reports an Anthropic session that estimated compute, memory and network costs for different ways to shard a model, in a tool like a spreadsheet (1 source). This lesson's practice problem builds that sheet as code, in three levels:

  1. train_bytes_per_gpu(params, tp, pp, dp, zero) and serve_bytes_per_gpu(...): what each GPU holds to train and to serve.
  2. allreduce_seconds(size, n, bandwidth), dp_sync_seconds(...) and tp_seconds_per_layer(...): the time each split spends on the network.
  3. bubble(pp, microbatches) and plans(params, gpus, per_node, memory): a pipeline's idle time, and every split of a cluster that fits.
CallReturns
train_bytes_per_gpu(70e9, 1, 1, 64, zero=3)17.5 GB
allreduce_seconds(1e9, 8, 50e9)0.035 s
bubble(16, 32)0.47 of the ideal time
plans(70e9, 64, 8, 80e9)(8, 1, 8) first: tensor parallel 8, inside one node

The lesson follows the outdoor shop's move to a 70-billion-parameter model, to serve and to fine-tune: memory per parameter, ZeRO, tensor and pipeline parallelism, serving, and the sheet itself. Five steps end with a small task in the editor.