Module resources

ML systems and interviews

Checked sources to go further than the lessons. Back to the module.

Recommended learning sequence

Work through these in order.

  1. ndcg_score (scikit-learn API reference) (opens in a new tab)

    scikit-learn2026Documentation

    Start with the scikit-learn page for ndcg_score. It applies a logarithmic discount, divides by the ideal score and averages tied predictions by default, which is what lesson 1 relies on and what its homework version leaves out.

  2. Fixing Gradient Accumulation (opens in a new tab)

    Hugging Face2024Article

    For lesson 2, the Hugging Face account of the accumulation mismatch in its Trainer. It shows why token-level losses are divided by the total number of non-padding tokens and not averaged per micro-batch.

  3. Automatic Mixed Precision package - torch.amp (opens in a new tab)

    PyTorch2026Documentation

    Then the torch.amp page: loss scaling against underflow, unscaling before the optimizer step, the GradScaler defaults and the warning about bf16-pretrained models in fp16. Read it beside the loss-scaling trace in the lesson.

  4. torch.distributed.fsdp.fully_shard (FSDP2) (opens in a new tab)

    PyTorch2026Documentation

    Next, the FSDP2 page for fully_shard, with per-parameter sharding and reshard_after_forward. Compare it with the FSDP1 strategies the lesson maps onto the ZeRO stages.

  5. Distributed Checkpoint - torch.distributed.checkpoint (opens in a new tab)

    PyTorch2026Documentation

    Then sharded checkpoints: saving from several ranks in parallel and resharding at load time, which is what lets a run resume on a different number of devices.

  6. KFold (opens in a new tab)

    scikit-learn2026Documentation

    For lesson 3, the KFold reference, with its default of no shuffling and the one-row-larger first folds that the homework splitter reproduces.

All resources

Official documentation

Research papers