# Budget a sharded model Specify the number of parameters, worker count, zero-based rank, ZeRO stage, and bytes per parameter for weights, gradients and optimizer state. Stage 1 partitions optimizer state, stage 2 also partitions gradients, and stage 3 also partitions weights. Remainders go to the lowest ranks. The minimum-rank search budgets the largest rank. At 512 ranks the model-state share is 68,719,476,736 bytes (64 GiB). An 80 GiB device with a 16 GiB reserve admits this share. The example returns 512 as the smallest number of ranks within the specified bound. [Native commands and compiler installation](https://github.com/Rahulchaube1/blyx-albatross/blob/v0.2.0/SCALE.md)