[PR #1676] [MERGED] fix(lab11): correct Part E Tiling Dividend answer key from option C to option D #14582

Closed
opened 2026-05-17 18:23:06 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/harvard-edge/cs249r_book/pull/1676
Author: @Shashank-Tripathi-07
Created: 5/5/2026
Status: Merged
Merged: 5/7/2026
Merged by: @profvjreddi

Base: devHead: fix/lab11-part-e-tiling-answer


📝 Commits (1)

  • a1172cc fix(lab11): correct Part E answer key from option C to D (10x tiling speedup)

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 labs/vol1/lab_11_hw_accel.py (+1 -1)

📄 Description

Summary

In Lab 11 Part E (The Tiling Dividend), the answer key marks option C (~2-4x) as correct when the formula in the same cell computes a ~10x speedup -- matching option D.

Root cause

Lines 900-909 compute the FlashAttention tiling speedup at defaults (seq_len=4096, tile=256, d=128):

_std_bytes   = 2 * 4096 * 4096 * 2  ≈ 67 MB
_tiled_bytes = 2 * 16 * 256 * 128 * 2 + 4096 * 128 * 2  ≈ 3.3 MB
_speedup     = 67 / 3.3 ≈ 20x  -->  capped to 10x  (line 909)

The displayed {_speedup:.1f}x stat card therefore shows 10x, but the answer key at line 959 checked pE_pred.value == "2_4" (option C), so selecting the answer that matches the computed and displayed value would incorrectly show the "wrong answer" callout.

Fix

# Before (line 959)
if pE_pred.value == "2_4":

# After
if pE_pred.value == "10x":

One line change -- no formula or option text modified.

Verification

At seq_len=4096 with tile=256: select option D (~10x) -- green "Correct" callout now fires. All other options correctly show the "wrong answer" callout.


🔄 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/1676 **Author:** [@Shashank-Tripathi-07](https://github.com/Shashank-Tripathi-07) **Created:** 5/5/2026 **Status:** ✅ Merged **Merged:** 5/7/2026 **Merged by:** [@profvjreddi](https://github.com/profvjreddi) **Base:** `dev` ← **Head:** `fix/lab11-part-e-tiling-answer` --- ### 📝 Commits (1) - [`a1172cc`](https://github.com/harvard-edge/cs249r_book/commit/a1172cc06444161afca9e85572742844f8dee83c) fix(lab11): correct Part E answer key from option C to D (10x tiling speedup) ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `labs/vol1/lab_11_hw_accel.py` (+1 -1) </details> ### 📄 Description ## Summary In Lab 11 Part E (The Tiling Dividend), the answer key marks **option C (~2-4x)** as correct when the formula in the same cell computes a ~10x speedup -- matching **option D**. ## Root cause Lines 900-909 compute the FlashAttention tiling speedup at defaults (seq_len=4096, tile=256, d=128): ``` _std_bytes = 2 * 4096 * 4096 * 2 ≈ 67 MB _tiled_bytes = 2 * 16 * 256 * 128 * 2 + 4096 * 128 * 2 ≈ 3.3 MB _speedup = 67 / 3.3 ≈ 20x --> capped to 10x (line 909) ``` The displayed `{_speedup:.1f}x` stat card therefore shows **10x**, but the answer key at line 959 checked `pE_pred.value == "2_4"` (option C), so selecting the answer that matches the computed and displayed value would incorrectly show the "wrong answer" callout. ## Fix ```python # Before (line 959) if pE_pred.value == "2_4": # After if pE_pred.value == "10x": ``` One line change -- no formula or option text modified. ## Verification At seq_len=4096 with tile=256: select option D (~10x) -- green "Correct" callout now fires. All other options correctly show the "wrong answer" callout. --- <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-17 18:23:06 -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#14582