Make Week 2 follow measured bottlenecks - #157
Draft
skyzh wants to merge 7 commits into
Draft
Conversation
A single dispatch can leave Xcode without enough replay work for Pipeline Statistics. Capture a small repeated steady-state workload while keeping the same Qwen3-4B shape and kernel. Assisted-by: Codex
The course now connects Xcode pipeline limiters to the exact masked W4 source lines, while preserving the measured streaming-memory floor in the performance appendix. Assisted-by: Codex
Students can now reproduce the limiter tables and source-cost graph instead of treating the checked-in screenshots as unexplained evidence. Assisted-by: Codex
Move fused model kernels before decode attention and make the cumulative checkpoints, tests, benchmark labels, and Week 3 prerequisites follow the same order. Assisted-by: Codex
Operator benchmarks, kernel-group attribution, and GPU captures can now select tiny_llm directly and restrict operator work to the chapter a student has completed. Assisted-by: Codex
Assisted-by: Codex
Assisted-by: Codex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Week 2 is meant to teach an evidence loop, but the chapters need more than an end-to-end number to justify each next step. The earlier operator runner measured implementations in fixed blocks, so GPU performance-state drift could consistently favor whichever implementation ran later. It also hid two dispatch decisions that did not survive a matched operator comparison.
This balances every readable, course, and MLX operator order and rotates kernel-group order before rerunning the complete progression. Each chapter from Day 2 onward now ends with the model throughput, operator latency, attribution profile, and selective Xcode evidence needed to choose the next bottleneck. Day 2 also teaches students how to capture the same counter tables and Shader Cost Graph for their own implementation.
The paired evidence changes two retained choices. Fused decode attention wins through context 128 but loses beyond that measured crossover, so the dispatch guard follows the data. Direct quantized embedding is slower than the readable packed row lookup at this checkpoint, so Week 2 drops it while Week 3 retains and tests it where the serving path uses the fused operator.
On the balanced M4 Pro run, the final 128-token Week 2 checkpoint reaches 95.4% of MLX prefill, 84.4% of MLX decode, and 85.3% of MLX output throughput. Split-K improves complete 32-token prefill by 11.9% and remains neutral at 128 tokens. The appendix attaches those fresh-process samples beside projection microbenchmarks, dependency-aware attribution, dispatch geometry, and the source-enabled Xcode matvec profile.
AI-assisted: Codex.