[PR #1786] fix(labs-vol2): correct numerical bugs in labs 08, 09, 11, 14 #15737

Open
opened 2026-05-20 14:05:05 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/harvard-edge/cs249r_book/pull/1786
Author: @Shashank-Tripathi-07
Created: 5/18/2026
Status: 🔄 Open

Base: devHead: fix/labs-vol2-lab07-16-audit


📝 Commits (5)

  • fbb3f3d fix(site): add nav-footer and dropdown-menu dark mode selectors
  • 0bbda9d fix(lab-08): correct Part A serving cost crossover from ~6 weeks to ~3-4 weeks
  • 6a33df1 fix(lab-09): correct FlashAttention savings ratio from 256x/1024x to 128x/512x
  • ee6733a fix(lab-11): correct 3-sigma alert fatigue count from 864 to 778/day
  • 429973a fix(lab-14): correct 2^21.2 energy deficit approximation from 195,000x to 2,400,000x

📊 Changes

6 files changed (+61 additions, -27 deletions)

View changed files

📝 labs/vol2/lab_08_inference.py (+2 -2)
📝 labs/vol2/lab_09_perf_engineering.py (+6 -6)
📝 labs/vol2/lab_11_ops_scale.py (+7 -7)
📝 labs/vol2/lab_14_sustainable_ai.py (+8 -8)
📝 shared/config/footer-site.yml (+1 -1)
📝 shared/styles/_site-dark.scss (+37 -3)

📄 Description

Summary

Four numerical correctness bugs found during audit of labs/vol2/ labs 07-16:

  • lab-08: Part A option C label said '~6 weeks' but the formula directly above it computes crossover at 100 QPS / $0.01/query as 23 days = ~3.3 weeks. Fixed to '~3-4 weeks' in option label and file header comment.
  • lab-09: FlashAttention savings ratio formula N/(2d) with HEAD_DIM=128 gives 128x at 32K tokens and 512x at 128K tokens. Synthesis text, header badge, incoming-message callout, and design-ledger hardcode all stated 256x/1024x (exactly 2x inflated). Fixed in all 5 locations.
  • lab-11: Alert fatigue formula 100100.0027*(1440/5) = 777.6, not 864. Fixed in file header, header badge, Part E description, design-ledger hardcode, synthesis text, and self-assessment question. Hierarchical 10x reduction updated from ~86/day to ~78/day.
  • lab-14: 2^21.2 = 2,097,152 * 1.149 = ~2,400,000, not 195,000. Fixed in file header, header badge, learning objectives, Part A intro, both answer-reveal callouts, synthesis takeaway, and MathPeek LaTeX formula.

Labs 07, 10, 12, 13, 15, 16 had no numerical correctness bugs. All fixes were verified against the in-file simulator formulas.

Test plan

  • Open lab_08_inference.py in marimo -- Part A concept intro shows ~23 days; option C now matches at ~3-4 weeks
  • Open lab_09_perf_engineering.py in marimo -- Part C simulator card shows 128x at 32K; synthesis text, badge, and ledger now match
  • Open lab_11_ops_scale.py in marimo -- Part E simulator with default sliders (100 models, 10 metrics, 3-sigma, 5-min checks) shows 777.6/day; all text now says 778
  • Open lab_14_sustainable_ai.py in marimo -- Part A MathPeek formula now reads 2^21.2 ≈ 2,400,000x; all badges and synthesis text match

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/harvard-edge/cs249r_book/pull/1786 **Author:** [@Shashank-Tripathi-07](https://github.com/Shashank-Tripathi-07) **Created:** 5/18/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `fix/labs-vol2-lab07-16-audit` --- ### 📝 Commits (5) - [`fbb3f3d`](https://github.com/harvard-edge/cs249r_book/commit/fbb3f3d1638fd7b123d885c9cbcd1cbd7e8257cc) fix(site): add nav-footer and dropdown-menu dark mode selectors - [`0bbda9d`](https://github.com/harvard-edge/cs249r_book/commit/0bbda9dfea22d1069a45cff4d5601a559fe21109) fix(lab-08): correct Part A serving cost crossover from ~6 weeks to ~3-4 weeks - [`6a33df1`](https://github.com/harvard-edge/cs249r_book/commit/6a33df18883bb766dcbe245a8bd06acabb7a6c77) fix(lab-09): correct FlashAttention savings ratio from 256x/1024x to 128x/512x - [`ee6733a`](https://github.com/harvard-edge/cs249r_book/commit/ee6733ae27ae85bcc26ca9598323e8aa50019fdd) fix(lab-11): correct 3-sigma alert fatigue count from 864 to 778/day - [`429973a`](https://github.com/harvard-edge/cs249r_book/commit/429973acc05c1ef99b6e200b5c39eb21ad35f9e8) fix(lab-14): correct 2^21.2 energy deficit approximation from 195,000x to 2,400,000x ### 📊 Changes **6 files changed** (+61 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `labs/vol2/lab_08_inference.py` (+2 -2) 📝 `labs/vol2/lab_09_perf_engineering.py` (+6 -6) 📝 `labs/vol2/lab_11_ops_scale.py` (+7 -7) 📝 `labs/vol2/lab_14_sustainable_ai.py` (+8 -8) 📝 `shared/config/footer-site.yml` (+1 -1) 📝 `shared/styles/_site-dark.scss` (+37 -3) </details> ### 📄 Description ## Summary Four numerical correctness bugs found during audit of labs/vol2/ labs 07-16: - **lab-08**: Part A option C label said '~6 weeks' but the formula directly above it computes crossover at 100 QPS / \$0.01/query as 23 days = ~3.3 weeks. Fixed to '~3-4 weeks' in option label and file header comment. - **lab-09**: FlashAttention savings ratio formula N/(2d) with HEAD_DIM=128 gives 128x at 32K tokens and 512x at 128K tokens. Synthesis text, header badge, incoming-message callout, and design-ledger hardcode all stated 256x/1024x (exactly 2x inflated). Fixed in all 5 locations. - **lab-11**: Alert fatigue formula 100*10*0.0027*(1440/5) = 777.6, not 864. Fixed in file header, header badge, Part E description, design-ledger hardcode, synthesis text, and self-assessment question. Hierarchical 10x reduction updated from ~86/day to ~78/day. - **lab-14**: 2^21.2 = 2,097,152 * 1.149 = ~2,400,000, not 195,000. Fixed in file header, header badge, learning objectives, Part A intro, both answer-reveal callouts, synthesis takeaway, and MathPeek LaTeX formula. Labs 07, 10, 12, 13, 15, 16 had no numerical correctness bugs. All fixes were verified against the in-file simulator formulas. ## Test plan - [x] Open lab_08_inference.py in marimo -- Part A concept intro shows ~23 days; option C now matches at ~3-4 weeks - [x] Open lab_09_perf_engineering.py in marimo -- Part C simulator card shows 128x at 32K; synthesis text, badge, and ledger now match - [x] Open lab_11_ops_scale.py in marimo -- Part E simulator with default sliders (100 models, 10 metrics, 3-sigma, 5-min checks) shows 777.6/day; all text now says 778 - [x] Open lab_14_sustainable_ai.py in marimo -- Part A MathPeek formula now reads 2^21.2 ≈ 2,400,000x; all badges and synthesis text match --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-20 14:05:05 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#15737