week09_accelerate.ipynb

Download .ipynb · Deliverables hub

Open in Jupyter from repo: jupyter notebook mmc/notebooks/week09_accelerate.ipynb

Cell 1 · markdown

# Week 9 — Accelerate / GPU memory notes

**MMC / DeepMind track** — show-work notebook.

### How to run

- **Local (Anaconda):** from repo root  
  `conda activate controlsift-mmc` then `powershell -File scripts/start_mmc_jupyter.ps1`  
  or open this file in JupyterLab and use kernel **Python (controlsift-mmc)**.
- **GitHub Pages cannot execute notebooks** (static hosting only). After the repo is on GitHub, use **Open in Colab** / Binder links on the deliverables hub, or clone and run locally.

## Official DeepMind labs (checkbox)

- `vendor/ai-foundations/course_7/gdm_lab_7_4_estimate_gpu_memory.ipynb`
- `vendor/ai-foundations/course_7/gdm_lab_7_5_fine_tune_a_model_with_bfloat16.ipynb`
- `vendor/ai-foundations/course_7/gdm_lab_7_6_apply_gradient_accumulation.ipynb`

Full map: `mmc/GDM_LAB_MAP.md`. Upstream clone: `vendor/ai-foundations/`.

## ControlSift exceed path

Run the cells below to regenerate **this repo's** graded artifacts under `mmc/deliverables/outputs/`.
Do not invent Gemma metrics; leave GPU rows null until a real HF/Kaggle run.

Cell 2 · code

from pathlib import Path
import os
import sys

# Resolve repo root whether Jupyter cwd is repo root or mmc/notebooks/
here = Path.cwd().resolve()
root = None
for candidate in [here, *here.parents]:
    if (candidate / "mmc" / "labs").is_dir() and (candidate / "mmc" / "notebooks").is_dir():
        root = candidate
        break
if root is None:
    raise RuntimeError("Could not find ControlSift repo root (expected mmc/labs/). Open Jupyter from the repo.")
os.chdir(root)
if str(root) not in sys.path:
    sys.path.insert(0, str(root))
print("cwd:", Path.cwd())
print("python:", sys.executable)

Cell 3 · markdown

Course 7 labs are the official accelerate checkbox. ControlSift packaging: `notebooks/KAGGLE_SAFE_RUN.md` + `notebooks/kaggle_runner.ipynb`. Open the GDM notebooks under `vendor/ai-foundations/course_7/` in Jupyter/Colab, then fill memory numbers into `mmc/deliverables/week09_accelerate.md` after a real GPU run.