Skip to content
StackDecode
System Design
19. AI System Design and LLM InfrastructureAnimated

Model Sharding

Splitting model weights across devices.

The idea

Each device holds a shard; requests flow across them.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

Model weightsGPU 1 (layers 1…GPU 2 (layers 9…GPU 3 (layers 1…Output
  • client
  • gateway / proxy
  • service
  • cache
  • data store
  • queue / stream

The model is too big for one GPU, so split the weights.

step:
1/4
at:
Model weights
1/9

The green dot is a request moving through the system.

Step by step

  1. 1Partition the weights
  2. 2Load shards on devices
  3. 3Route computation
  4. 4Gather the results

Where it is used

Models too big for one GPU.

Watch out for

Network overhead.

Related