Vivek's Field Notes

What to read today

Updated daily. Last update: Mon, 26 Oct 2026 · Day 1 · Week 1 · Phase 1 of 4: Resume + proof (Nov–Dec) · Next checkpoint: AI-infra resume done by 30 Nov

Today: Day 1, Mon 26 Oct

Theme: why decode is memory-bound and prefill is compute-bound.

🏢 Office

Already over today. From tomorrow, this slot is for reading and watching only.

🌙 Evening (~1 h, it’s a late start)

TimeTask
0:00–0:40Read Inference Engineering Ch 2 (models and bottlenecks), up to and including prefill vs decode. Stop there.
0:40–1:00Code. A small Python script for Llama-3-8B: FLOPs and bytes moved per token for prefill and for decode, arithmetic intensity (FLOPs ÷ bytes) for each, compared with your machine’s compute-to-bandwidth ratio.
1:00–1:05Notes. 2–3 lines: the key idea, one question, how it maps to DB / distributed systems ideas.

Done when: the script prints both intensities and shows decode is memory-bound.


This week (Week 1: 26 Oct – 1 Nov)

Day🏢 Office (read / watch)🌙 Evening (build)
Mon 26—Book Ch 2 (first half) + arithmetic-intensity script
Tue 27kipply, Transformer Inference Arithmetic1 LeetCode · 6.5840: check where MapReduce / Raft 3A stand, continue
Wed 28How to Scale Your Model: the rooflines chapter1 LeetCode · Book Ch 2 (rest) · start GPT-2 inference from scratch: load the real weights into your own PyTorch model, check outputs match Hugging Face
Thu 29Horace He, Making Deep Learning Go Brrrr1 LeetCode · 6.5840 lab
Fri 30CMU 15-445 Lecture 1 at 1.5xGPT-2: add a KV cache (15-445 labs wait until Raft is done)
Sat 31—1 LeetCode · 5–6 h: GPT-2 benchmark: tokens/sec and memory with vs without KV cache, across batch sizes · or 6.5840 catch-up
Sun 1LightWeekly contest · Resume pass 1: list every bullet missing a number (p99, throughput, users, hours saved) and collect the numbers from work · first weekly notes post

Roadmap (Oct 2026 – Sep 2027)

PhaseWhenFocus
1. Resume + proofNov – Dec 2026AI-infra resume with numbers · GPT-2 + KV cache benchmark · Narad benchmarks · Raft 3A–3B · LeetCode 5–6/week · DDIA Ch 5, 8, 9
2. Interview prepJan – Mar 2027LeetCode daily · system design (classic + ML system design) · project deep-dive stories · behavioral · mock interviews · mini inference engine
3. ApplicationsApr – Jun 2027Referrals, applications in waves, interviews
4. Offer + moveJul – Sep 2027Negotiate, paperwork, move

Checkpoints

ByCheckpointStatus
30 Nov 2026AI-infra resume variant done, every bullet has a number⬜
31 Dec 2026GPT-2 + KV cache benchmark published · Raft 3B passes⬜
31 Jan 202730 LeetCode in Jan · ML system design notes for 3 designs⬜
28 Feb 20276 mock interviews · mini inference engine runs⬜
31 Mar 2027Deep-dive stories ready · contest rating 2000+⬜
30 Jun 2027Offer signed⬜

Reading queue (Phase 1)

DDIA: learn by doing

Each chapter read at the office gets one build that week, in the normal evening slots.

ChReadBuild (prove it)Size
5ReplicationPostgres primary + async replica in Docker Compose: measure replication lag under load, kill the primary mid-write and count lost writes, show a read-your-writes violation1 evening
8Trouble with distributed systemsLast-write-wins with skewed clocks: two Go nodes, one clock +200 ms, show silently lost writes. Then add network partitions with toxiproxy1 evening
9Consistency and consensusRaft 3B/3C is the build. Extra: run 6.5840’s porcupine linearizability checker against a deliberately broken KV store and read the failing history1 evening
3Storage and retrievalMini LSM-tree KV store in Go: WAL → memtable → SSTables → compaction → bloom filter. Benchmark against bbolt (B+tree): write amp, read latency2–3 Saturdays, after Raft 3B (portfolio piece)
7TransactionsTwo psql sessions: reproduce lost update, write skew and phantoms under READ COMMITTED / REPEATABLE READ / SERIALIZABLE, and record which level stops which anomaly1 evening
6PartitioningConsistent-hashing router in Go with virtual nodes: measure keys moved when a node joins/leaves vs mod-N hashing. Connects to llm-d cache-aware routing1 evening

Reading expert code

After each build, read how experts wrote the same thing.

After you build…Read the expert versionStart with
Arithmetic-intensity script, GPT-2 + KV cachegpt-fast (PyTorch team, ~1k lines: KV cache, int8/int4, speculative decoding)model.py, generate.py
Mini inference engine (Phase 2)nano-vllm (~1.2k lines of vLLM ideas), then vLLM itselfnano-vllm engine/; vLLM v1/core/sched/scheduler.py, v1/core/kv_cache_manager.py
Raft 3A–3Cetcd-io/raft (the Raft used by etcd, K8s, CockroachDB)raft.go, log.go, node.go
Mini LSM KV storeLevelDB (Jeff Dean & Sanjay Ghemawat, small and clean C++), then Pebble (CockroachDB’s LSM in Go)LevelDB db/db_impl.cc, table/; Pebble compaction.go
15-445 buffer poolPostgres buffer manager (clock-sweep eviction, maps to PagedAttention)src/backend/storage/buffer/bufmgr.c, freelist.c
15-445 B+Treebbolt (small Go B+tree), SQLite (heavily commented)bbolt node.go, cursor.go; SQLite btree.c
Go services at workGo standard librarynet/http/server.go, sync/mutex.go, context/

How to read it: build your own version first, then read theirs and list 3 things they did differently and why. Trace one request or operation end to end instead of reading files top to bottom. Read the tests, which show what the authors were worried about. Use git blame and the linked PRs to find out why the code is shaped that way. Code reading counts as office reading time.

Rules

Log

DayDatePlannedDone
1Mon 26 OctBook Ch 2 (first half) · intensity script(pending)