Skip to content

Opus pre-flight: selective-TTT patch + experiment specs + pod scripts - #2

Merged
GodlyDonuts merged 1 commit into
mainfrom
claude/busy-thompson-9c94f9
Apr 27, 2026
Merged

GodlyDonuts merged 1 commit into
mainfrom
claude/busy-thompson-9c94f9

Conversation

@GodlyDonuts

Copy link
Copy Markdown
Owner

Summary

Pre-flight work for the Day 1 leaderboard run, all done on CPU before any RunPod compute is spent. Builds on the Opus folder merged in #1.

What changed

Code (Opus/code/)

Experiments (Opus/experiments/) — 6 specs, each with hypothesis / commands / decision criteria

  • 001 — SOTA reproduction (gating; nothing else runs until this matches within ±0.005)
  • 002 — TTT param-filter sweep (the primary hypothesis: scales vs all)
  • 003 — TTT LR × epochs sweep on the winner
  • 004 — TTT chunk-size sweep on the winning config
  • 005 — 3-seed validation on 8×H100 with explicit p<0.01 acceptance bar
  • 010 — mixed-bit GPTQ (fallback if TTT angle dies on Day 2)

Notes (Opus/notes/)

  • selective_ttt_patch.md — patch design, parameter accounting, risks

Scripts (Opus/scripts/)

  • setup_pod.sh — idempotent fresh-pod bootstrap (clone, deps, dataset, sanity)
  • run_repro.sh — one-command Experiment 001
  • validate_param_filter.py — local CPU unit test for the new filter logic (assertions all pass on Python 3.11)

Why

The hypothesis I'm betting compute on: SOTA TTT trains every parameter (~34M floats) on each chunk, including the int6-quantized matrices that just came off a careful GPTQ rate-distortion fit — every TTT step pulls them off the grid for marginal data signal. Restricting TTT to the ~38K-float fp32 control surface (q_gain, attn_scale, mlp_scale, resid_mix, skip_weights, skip_gates) should give cleaner adaptation per chunk. See Opus/notes/selective_ttt_patch.md for the parameter accounting.

Reviewer notes

Test plan

CPU-only prep ahead of RunPod access. Everything we can do without
spending GPU credits.

Code:
  - train_gpt_base.py:  decompressed PR openai#1493 SOTA (read-only reference)
  - train_gpt_v1.py:    base + TTT_PARAM_FILTER hyperparameter and
                        _select_ttt_params helper. Default 'all' preserves
                        baseline behavior. Filters: scales, scales+embed,
                        last_n_layers:K, attn_only, mlp_only.

Notes:
  - selective_ttt_patch.md:  patch design + parameter accounting + risks

Experiments (6 specs ready to run):
  001  baseline reproduction (seed=42 on 1xH100)
  002  TTT param-filter sweep
  003  TTT LR x epochs sweep on winning filter
  004  TTT chunk-size sweep on winning config
  005  3-seed validation on 8xH100
  010  mixed-bit GPTQ (fallback if TTT angle fails)

Scripts:
  setup_pod.sh:              fresh-pod bootstrap (idempotent)
  run_repro.sh:              one-command Experiment 001
  validate_param_filter.py:  filter assertions, runs locally on CPU

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@GodlyDonuts
GodlyDonuts merged commit a4d1411 into main Apr 27, 2026
GodlyDonuts added a commit that referenced this pull request Apr 28, 2026
Synthesis of (a) deep records-folder pass, (b) modded-nanogpt record openai#80
gold standard, (c) FP8 / CUDA Graphs / distillation literature.

Key findings:
1. Leaderboard converged on gradient-quality + quantization tricks while
   leaving raw throughput largely unexplored. Modded-nanogpt has absorbed
   multiple compute-maxing techniques that haven't crossed into PG.
2. NEVER-TRIED on the leaderboard (open territory):
   - CUDA Graphs (record openai#80 of modded-nanogpt uses heavily)
   - Multiple parallel training rounds in unused VRAM
   - Multiple EMAs / Polyak averaging
   - Distillation initialization
   - Larger GPTQ calibration set (>64 batches)
   - Sequence-length warmup
3. Top-8 ranked actionable items (CUDA Graphs #1, batch-size sweep #2,
   FP8 head openai#3, multi-EMA openai#4). Cost estimates and confidence per item.
4. Modded-nanogpt techniques NOT in our SOTA: FP8 head + asymmetric
   rescale, fused softcapped CE, Cautious Weight Decay, "Adam every other
   step", paired-head Q/K orthogonalization, attention window warmup, MTP.
5. TRIED-AND-DROPPED on PG (don't waste compute): seq_len=4096, parallel
   residual MLP-skip, 3-loop mini-recurrence, ternary, YaRN, NeoMuon,
   hash embeddings, etc. Verbatim quotes from records folder for each.
6. FP8 honest analysis: 1.6x typical training speedup (not 3x), with
   documented loss-spike instability. FP8 only on lm_head + tok_emb is
   the right initial bet (small surface, well-conditioned matmuls).

Decision rules tied to Phase 3 outcome:
- Phase 2 mean > 1.0780: prioritize throughput stack (CUDA Graphs +
  batch sweep + FP8 head) plus Newton-Muon as gradient-quality lever.
- Phase 2 mean 1.0760-1.0780: just CUDA Graphs + LR follow-on +
  Newton-Muon.
- Phase 2 mean clears 1.0760: ship; none of this matters this cycle.

Still-research items: torch.compile(mode='reduce-overhead'), MTP
re-test, qTTT paper body, Cautious WD diff from modded-nanogpt.
None spend GPU.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant