THE INVESTIGATION
Choose a complete checkpoint
Recover the latest training step whose full set of worker shards is present.
LLM ArchitectureML systems
What’s going wrong
Original LLM Architecture lab. Implement solve(data) using the Python standard library.
Given positive integer data["workers"] and data["shards"] objects with integer step and rank, return the greatest step with every rank from 0 through workers - 1 present, or null if no step is complete. Duplicate shard records do not fill missing ranks. Ignore ranks outside that range.
Expected behavior
Recover the latest training step whose full set of worker shards is present.
Reproduction
01 Case 1
{"workers": 2, "shards": [{"step": 1, "rank": 0}, {"step": 1, "rank": 1}, {"step": 2, "rank": 0}]}1
02 Case 2
{"workers": 2, "shards": [{"step": 1, "rank": 0}, {"step": 1, "rank": 0}]}null
03 Case 3
{"workers": 1, "shards": []}null
Before you begin
- Python lists and dictionaries
Need a nudge?
Reveal one investigation hint at a time. Try each clue before opening the next.
The bug is intentional. Run the starter code to see it fail, then work toward a fix. Difficulty is provisional.
Ready when you are
Every fix starts with a failing test.
Read the report, then sign in to start your investigation.