Check your starting point
Two devices see one and three valid examples. Should their mean gradients receive equal weight?
Compare your reasoning
No. Weight by valid example counts. Sum local gradient numerators and valid counts, then divide once. Padding and empty partitions must not silently change the denominator.
If this is unfamiliar, work through A sharded training step before attempting the project.
Build in stages
1. Verify placement and the global update
Inspect actual shard indices and compare each relevant output with an independent unpartitioned calculation, including padded and unequal partitions.
2. Connect communication and recovery
Inspect collectives without inferring network speed from payload size. Restore data position and optimizer state before comparing subsequent global steps. Continue to the 2x2 data/model mesh: predict parameter and momentum slices and per-device bytes, then compare one forward/backward/update with an unsharded NumPy oracle under uneven and empty valid counts.
Try a changed condition
Make a prediction before opening the reasoning. Keep your answer and the evidence you would collect.
Three shards have valid counts 2, 6 and 0 and local gradient sums 6, 6 and 0. Predict the global mean and the empty-shard contribution.
Compare an approach
Reduce sums and counts separately: the global mean is . The empty shard contributes a zero numerator and zero count; it must not compute . Reject a globally empty batch. Compare with an independent unsharded calculation.
Diagnose a likely failure
Symptom: The gradient grows with device count.
Check next: Check whether local means were summed without count normalization. Verify one complete update before interpreting a training curve.
Decide what is ready
Use sharded-training. Retain actual placements and collectives, independent uneven/empty-partition checks and full-state replay. Label logical CPU devices explicitly.
Where to put your project code
Write your code in: projects/sharded-training/my_model.py (copy projects/sharded-training/starter/model.py first: cp projects/sharded-training/starter/model.py projects/sharded-training/my_model.py).
Verify your implementation: python3 projects/sharded-training/tests/check.py --stage all --impl projects/sharded-training/my_model.py
Run the staged project checks on your implementation in projects/sharded-training/my_model.py and record your transfer experiment results in your portfolio.
What still needs further work
Real network collectives, multi-controller ingestion and host-loss recovery are unqualified. The optional launch instructions are preparation, not execution receipts.