Skip to content

Add new exercises: RMS Norm, data loading, sliding window bonus + fix BPE - #34

Merged
Exorust merged 5 commits into
Exorust:mainfrom
mathieu-charbonnel:contribution
Oct 21, 2026
Merged

Exorust merged 5 commits into
Exorust:mainfrom
mathieu-charbonnel:contribution

Conversation

@mathieu-charbonnel

@mathieu-charbonnel mathieu-charbonnel commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • RMS Norm: Full auto-graded exercise — question notebook with stubs, solution notebook, Python grader (6 checks), updated problem.toml (tier B→A)
  • Byte Pair Encoding fixes: Fixed wrong problem statement (described a Transformer instead of BPE), fixed "Byte Pain Encoder" typo, fixed truncated test cell, rewrote merge_vocab to use index-walking, aligned end-of-word marker to </w> across Q and SOLN
  • Sliding Window Attention bonus: Added an unfold-based follow-up exercise achieving genuine O(n·w) compute without the n×n score matrix
  • 4 Data Loading exercises (new v3/data-loading/ section):
    • Preloaded Map-Style Dataset (easy)
    • Streaming IterableDataset with yield + multi-worker sharding (medium)
    • Shuffle Buffer for streaming data (medium)
    • Simulated DistributedSampler for data-parallel training (medium)
  • Updated README.md and PROBLEMS.md with new links and graded status

Test plan

  • RMS Norm grader passes all 6 checks against reference solution
  • Run all notebooks end-to-end in Colab
  • Verify python3 scripts/generate.py check passes with the new manifests

RMS Norm:
- Rewrite rms-norm.ipynb as a proper exercise with stubs
- Add rms-norm_SOLN.ipynb with complete solution
- Add rms_norm.py grader (6 checks: module type, shape, learnable scale,
  reference match, gradient flow, numerical stability)
- Update problem.toml: grading tier B→A, add entries and hints

Byte Pair Encoding:
- Fix problem statement in both Q and SOLN notebooks (was describing a
  Transformer model instead of BPE)
- Fix "Byte Pain Encoder" typo in solution
- Fix truncated test cell in question notebook
- Rewrite merge_vocab to use index-walking instead of fragile string replace
- Align end-of-word marker to </w> across Q and SOLN notebooks
- Remove debug print statements from solution
Add a follow-up exercise to sliding window attention that uses
torch.Tensor.unfold to achieve genuine O(n·w) compute without
building the full n×n score matrix. Includes problem statement,
step-by-step TODOs in the question notebook, complete solution,
and validation tests.
1. Preloaded Dataset (easy) — map-style Dataset with all data in memory,
   DataLoader batching/shuffling, multi-worker loading
2. Streaming Dataset (medium) — IterableDataset with yield, line-by-line
   file reading, multi-worker sharding via get_worker_info()
3. Buffered Loading (medium) — shuffle buffer wrapping an IterableDataset,
   O(buffer_size) memory, approximate shuffling
4. Data Parallel Loading (medium) — DistributedSampler from scratch,
   rank sharding, deterministic seeded shuffling, padding

Each exercise includes question notebook with TODOs, solution notebook,
and problem.toml manifest.
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

@mathieu-charbonnel is attempting to deploy a commit to the exorust's projects Team on Vercel.

A member of the Team first needs to authorize it.

num_workers > 0 causes pickle errors in Jupyter notebooks since
classes defined in notebook cells can't be serialized for multiprocessing.
Replace multi-worker tests with shuffle verification (preloaded) and
code inspection (streaming).
@Exorust
Exorust merged commit db170f0 into Exorust:main Oct 21, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants