Skip to content

docs(ezpz): split the three append-only files into monthly records - #15

Closed
saforem2 wants to merge 46 commits into
ezpzfrom
docs/reorg-lifecycle
Closed

saforem2 wants to merge 46 commits into
ezpzfrom
docs/reorg-lifecycle

Conversation

@saforem2

@saforem2 saforem2 commented Aug 23, 2026 •

Copy link
Copy Markdown
Owner

Step 1 of docs/notes/docs-reorg-plan.md, on a new branch. The plan calls this "highest value, no risk, do it first -- if only one step ever happens, make it this one," and it is the only step with zero link risk by construction.

journal.md 288K, 85 sections -> records/journal/YYYY-MM.md (5)
upstream-sync.md 187K, 84 sections -> records/upstream-sync/YYYY-MM.md (5)
agpt-sync.md 73K, 7 sections -> meeting-notes/agpt-sync/YYYY-MM.md (4)

All three original paths REMAIN as index files, so the ~127 inbound links -- including from code, scripts and CLAUDE.md -- keep resolving untouched. That is what makes this step safe to do while production docs are live.

The splitter refuses rather than guesses: it aborts if any section heading lacks a YYYY-MM, instead of silently dropping it into an arbitrary bucket. That guard fired on upstream-sync.md, which has two NON-dated sections ("HEADS-UP for the 80th sync: full_dtensor.py is deleted upstream" and "How to use this document"). Those are standing guidance, not history, so they stay in the index where a reader looking for current advice will actually find them -- handled explicitly in a second pass rather than by loosening the guard.

Verified nothing was lost, per file: the sorted set of '## ' headings before (from git) is IDENTICAL to the set after (across the split files), 85/85 for journal and 7/7 for agpt-sync; upstream-sync reconciles 82 dated + 2 standing =
84. Every link in the three new indexes resolves to a real file (0 broken).

Not done here, deliberately -- steps 2-4 (canonical-home banners, the directory moves one commit each, and the link checker) carry real link risk and the plan says production/ moves LAST and only during a quiet window.

Summary by Sourcery

Reorganize the append-only documentation into monthly records while preserving legacy entry points and validating link integrity.

New Features:

  • Split the development journal, upstream sync log, and AGPT meeting notes into monthly records while retaining their original paths as index pages.
  • Add a known-bugs catalogue index and canonical-record metadata to key documentation pages.
  • Add a documentation link checker covering Markdown references and code or script references.

Bug Fixes:

  • Preserve and repair internal links after reorganizing documentation directories and relocating evaluation, summary, scaling, competition, and upstream-issue records.
  • Keep standing guidance in the upstream sync index while separating dated history into monthly records.

Enhancements:

  • Reorganize documentation into records, reference, and outbound sections with updated navigation and cross-references.
  • Update documentation refresh and chart-generation tooling to use the reorganized record locations.

Documentation:

  • Reorganize append-only documentation into monthly records and update indexes, navigation, and cross-references without breaking existing inbound paths.

Tests:

  • Verify that monthly splits preserve all journal, meeting-note, and upstream-sync headings, and that links resolve across the reorganized documentation.

Step 1 of docs/notes/docs-reorg-plan.md, on a new branch. The plan calls this
"highest value, no risk, do it first -- if only one step ever happens, make it
this one," and it is the only step with zero link risk by construction.

  journal.md          288K, 85 sections -> records/journal/YYYY-MM.md      (5)
  upstream-sync.md    187K, 84 sections -> records/upstream-sync/YYYY-MM.md (5)
  agpt-sync.md         73K,  7 sections -> meeting-notes/agpt-sync/YYYY-MM.md (4)

All three original paths REMAIN as index files, so the ~127 inbound links --
including from code, scripts and CLAUDE.md -- keep resolving untouched. That is
what makes this step safe to do while production docs are live.

The splitter refuses rather than guesses: it aborts if any section heading
lacks a YYYY-MM, instead of silently dropping it into an arbitrary bucket. That
guard fired on upstream-sync.md, which has two NON-dated sections ("HEADS-UP
for the 80th sync: full_dtensor.py is deleted upstream" and "How to use this
document"). Those are standing guidance, not history, so they stay in the index
where a reader looking for current advice will actually find them -- handled
explicitly in a second pass rather than by loosening the guard.

Verified nothing was lost, per file: the sorted set of '## ' headings before
(from git) is IDENTICAL to the set after (across the split files), 85/85 for
journal and 7/7 for agpt-sync; upstream-sync reconciles 82 dated + 2 standing =
84. Every link in the three new indexes resolves to a real file (0 broken).

Not done here, deliberately -- steps 2-4 (canonical-home banners, the directory
moves one commit each, and the link checker) carry real link risk and the plan
says production/ moves LAST and only during a quiet window.
Step 4 of docs-reorg-plan.md, done BEFORE step 3 because the plan says step 3
is only safe with it in place. It immediately proved its worth by catching a
regression I had introduced and declared clean.

WHAT I GOT WRONG. The step-1 commit claimed "zero link risk by construction"
because the three original paths survive as indexes. That is true for INBOUND
links and false for the ones INSIDE the moved content: a section written at
docs/journal.md saying `](guides/foo.md)` now lives at
docs/records/journal/2026-06.md, two levels deeper, so every relative link in
the moved text was wrong. My verification only checked that the new index
links resolved -- it never checked the content I had moved.

Measured: 34 dangling references before the split, 150 after. 116 broken by me.
Now back to 34, and the set of dead targets is IDENTICAL to pre-split (12
distinct, `comm -13` empty), so nothing new is broken. The 34 that remain are
pre-existing -- dead `rl/` and `production/grpo/` paths, plus one link into a
Sunspot home directory -- and are left for a separate pass rather than folded
into this one.

The checker goes beyond the plan's version, which only walked docs -> docs. It
also resolves every `experiments/ezpz/docs/...md` path named from a .py or .sh.
That direction matters more in practice: the pinned production clones pull
separately, so a docs move that breaks a scripted path is invisible until that
script runs at scale.

Two rewrite passes were needed because the first only fixed links whose target
existed after prefixing; links that were relative-to-parent needed a second,
deeper prefix. Both are mechanical and verified by the checker rather than by
inspection.
Step 2 of docs-reorg-plan.md: zero risk, nothing moves. One banner at the top
of each recurring-topic page saying what it owns, so a writer adding status
knows where it belongs. This is the fix for the plan's P2 -- umbrella 8756070
currently appears in six files across three directories with nothing declaring
which is authoritative, and the plan's author notes they added a dispatch-log
row and a ticket before noticing the per-umbrella report convention existed.

Banners on: production/dispatch-log.md (cross-umbrella taxonomy),
production/README.md (live chain status), journal.md and upstream-sync.md (now
indexes), summaries/README.md, evals/README.md.

guides/known-bugs/ had NO index -- 24 bug pages and no way in. Added one, with
a title and one-line hook per page extracted from the pages themselves rather
than written from memory. That directory is exactly where an index earns its
keep: several of these failure modes took multiple sessions to isolate and
presented as something else entirely, so the value is in recognizing a symptom
you have seen before.

Link checker still reports 34 dangling -- unchanged, all pre-existing.
First directory move of step 3, chosen because it is least-linked (1 inbound
md link, 1 code reference) -- a cheap test of the mover before it touches
anything that matters.

The mover rewrites both directions the link checker knows about. For docs->docs
it RESOLVES each relative link and re-derives the path from the referring
file's own location rather than string-swapping: a relative link is only
correct relative to its source, so 'docs/foo.md -> ../baselines/x.md' and
'docs/a/b/foo.md -> ../../baselines/x.md' need DIFFERENT rewrites for the same
target. A string swap fixes one and breaks the other.

Link checker: 34 dangling before, 34 after -- unchanged, all pre-existing.
A record: dated competition results, immutable once written.

Note this move exposed a gap in the mover, now fixed: it rewrote references TO
the moved directory but not relative links INSIDE it pointing OUT. The tree
changed depth, so those '../' counts were wrong -- the same defect that broke
116 links in step 1. The pre-commit link check caught it (34 -> 35) and refused
the commit rather than letting one dangling link through.

Link checker: 34 dangling before, 34 after -- no new breakage.
Reference: durable config documentation, corrected in place rather than dated.

Link checker: 34 dangling before, 34 after -- no new breakage.
Reference: measured scaling baselines. Durable -- corrected when re-measured,
not superseded by date.

Link checker: 34 dangling before, 34 after -- no new breakage.
A record: dated retrospectives, immutable once written.

Link checker: 34 dangling before, 34 after -- no new breakage.
Outbound: material that leaves the repo (upstream PR drafts and repros).

Link checker: 34 dangling before, 34 after -- no new breakage.
A record: dated evaluation results per model.

Link checker: 34 dangling before, 34 after -- no new breakage.
A record: dated meeting notes, immutable once written. Includes the agpt-sync/
monthly split from step 1.

Link checker: 34 dangling before, 34 after -- no new breakage.
A record: dated per-run experiment reports, immutable once written.

150 files moved. Link repair used a new path-resolving mover
(scripts/oneoff/reorg_move.py) rather than a sed sweep, because the directory
name "experiments" also appears in the repo path torchtitan/experiments/ezpz --
a string substitution would have rewritten real code paths. The mover resolves
each relative link against its containing file and rewrites only links whose
resolved target actually moved, which also repairs links INSIDE the moved tree
(the bug class that required a follow-up patch on the summaries move).

82 markdown files rewritten, plus 13 code references and 2 CLAUDE.md mentions.

Link checker: 34 dangling before, 34 after -- no new breakage.
Reference: durable failure taxonomy, corrected in place, never dated.

Moved first (ahead of the rest of guides/) because known-bugs/ is the one
subtree with a different destination -- promoting it to reference/known-bugs/
rather than reference/guides/known-bugs/ matches the plan's mapping and leaves
guides/ as a clean 1:1 move.

25 files moved, 35 markdown files relinked, 26 code/CLAUDE.md references
updated. One extensionless directory link (../../../../guides/known-bugs) was
outside the mover's ](*.md) pattern and was fixed by hand.

Link checker: 34 dangling before, 34 after -- no new breakage.
Reference: durable how-to and status pages, corrected in place, never dated.
Includes guides/training/, which the plan maps to reference/guides/training/.

11 files moved, 40 markdown files relinked, 22 code/README/CLAUDE.md
references updated. One extensionless directory link in notes/ was outside the
mover's ](*.md) pattern and was fixed by hand.

Link checker: 34 dangling before, 33 after. The one that disappeared is a real
fix, not a masked break: guides/spmd-backend-status.md linked
../../production/agpt/30b-exp/exp08-convergence.md, which from docs/guides/
escaped above docs/ and dangled. From docs/reference/guides/ the same relative
path resolves to the file, which does exist. Set-diff of the dangling lists
confirms nothing new appeared.
Generated by refresh_all.sh from the trajectories.py manifest:
=== 0 leaf field(s), 0 rollup row(s) changed, 0 warning(s) ===
=== summary: 0 up-to-date, 0 stale, 0 missing-README ===
…nts[N]

Three plot scripts computed the repo root by counting parent directories.
Moving a script between directory levels silently changes what parents[N]
resolves to, and these scripts then find no input and render an EMPTY chart
rather than failing -- so nothing catches it.

That already happened twice:
- scaling/yeet_env/plot_yeet_env_scaling.py broke when scaling/ moved to
  reference/scaling/ (parents[6] went from the repo root to torchtitan/).
- the two evals/agpt/{2b,20b}/plot_eval_overview.py broke when evals/ moved to
  records/evals/ (parents[7] likewise).

Replaced with a _repo_root() helper that walks up looking for the pyproject.toml
+ torchtitan/ pair, so the path survives any future move. The link checker only
validates markdown links, so it could not have caught this class of breakage.

Also restores both eval_overview.svg files, which the refresh_all auto-commit
had overwritten with axes-only renders. The eval JSON these read from lives on
the cluster and is not present locally, so running the plotters here produces an
empty chart regardless of the path fix -- the committed SVGs are the good ones
and must be regenerated cluster-side. Verified by color count: 2b went 5 -> 2
and 20b 6 -> 3 in the auto-commit, and both are back to the full set.

The other four SVGs in that auto-commit regenerated correctly (4 -> 4, 5 -> 5)
and are left as refreshed.
…move)

Same class of latent breakage fixed in 5354c94, applied ahead of the move
rather than after it. Five plotters under docs/production/ compute the repo
root by counting parents (parents[7], [10], [11]). All five resolve correctly
today and would silently resolve elsewhere once production/ moves under
live/ + reference/ + records/proposals/ -- producing empty charts that
refresh_all.sh would then auto-commit over good ones.

Behavior-preserving: verified each _repo_root() walk lands on the identical
directory the old index returned. Also dropped the now-wrong "repo root is 7
up" depth claims from adjacent comments.

Doing this as its own commit keeps the production/ move reviewable as a pure
rename + link rewrite, with no interleaved logic changes.
…ecker

The checker validated markdown links only, so it reported a clean 34 -> 34
across two moves that each silently broke a plotter: scaling/ ->
reference/scaling/ and evals/ -> records/evals/. A script that computes its
root as Path(__file__).resolve().parents[N] keeps working until it changes
directory depth, then resolves elsewhere, loads nothing, and renders an EMPTY
figure that refresh_all.sh auto-commits over the good one. Nothing exits
non-zero anywhere in that chain.

Check 3 now walks every .py under docs/ and flags the parents[N] pattern,
pointing at the marker-anchored _repo_root() walk as the fix.

Verified by negative test: reintroducing parents[7] in plot_ceiling.py moves
the count 33 -> 34 and names the file; reverting returns it to 33. Current
tree is clean -- all eight occurrences were converted in 5354c94 and
ffbc9c7.
production/ is the only directory holding all four lifecycle kinds, so it does
not move as one rename. Scoped it rather than started it, because the plan
requires a quiet window and two umbrellas are queued.

Two corrections to the earlier estimate:
- 94 code references, not 44. The lower figure came from a grep that missed
  several tooling files. The referencing code includes the LIVE dashboard
  (prod_dash.py, trajectories.py, check_dashboard_drift.py, refresh_all.sh),
  which is precisely why this waits for a window.
- metrics/ (11 ground-truth CSVs + manifest.json) is absent from the original
  plan. It decays with the chains, so it belongs in live/ beside figures/.

Also records an ordering constraint the mapping alone does not imply:
agpt/30b-exp/ must move to records/proposals/ BEFORE agpt/ moves to
live/chains/agpt/, or it lands in the wrong tree and has to move twice.

Pre-flight is already complete (ffbc9c7, a9ff2f2).
…ifecycle

Two root files with no generators and near-zero inbound links, so they move
without waiting for a quiet window:
  TREE.md            -> reference/TREE.md    (durable structural map)
  claude-sessions.md -> records/claude-sessions.md  (dated log)

TREE.md also needed a content rewrite, not just a move: every path in its
table pointed at a directory that no longer exists (experiments/, guides/,
evals/, summaries/, meeting-notes/, baselines/, configs/, scaling/,
competitions/, upstream-issues/ -- all 10 moved in earlier commits). Its "full
tree" section was staler still, describing chain states from around April: it
had the 2B 512N canonical chain at "step 13,279, loss 2.79", which finished at
step 46,429.

Rewrote it around the lifecycle split and GENERATED the tree from disk rather
than hand-maintaining it, so the next move updates it by re-running rather
than by remembering. production/ is listed explicitly as "mixed -- not yet
split" with a pointer to its move plan, so the one un-migrated tree is visible
rather than absent.

Link checker: 33 before, 33 after. One transient break was caught and fixed en
route -- TREE.md's ](./README.md) resolved to reference/README.md after the
move and needed ](../README.md).
The code->docs check only matched the full 'experiments/ezpz/docs/...'
spelling, but most comments write the bare 'docs/...' form -- so it was blind
to the majority of code references and reported clean through every move.
It also only matched paths ending in .md, missing directory references, which
are worse: a stale directory in a WRITER (a plot script's output dir) silently
recreates the old tree instead of erroring.

Widened to both spellings and to directory paths. That surfaced 12 stale
references the earlier sweeps missed:

  8 broken by the moves, now fixed:
    docs/evals/          x5 (2 of them WRITE paths in eval plotters)
    docs/scaling/        x1
    docs/upstream-issues/ x2 (one in trainer.py)

  4 pre-existing, unrelated to the reorg:
    grpo-lora-agpt2b-repro.md   -> had moved under rl/history/
    sft/aurora2b/...            -> restructured to sft/agpt/2b-mds/ in f9dc033
    training-dtype-bf16-norm-freeze.md -> the comment said known-bugs/, but the
      file has always been in guides/. My known-bugs sweep faithfully rewrote a
      path that was already wrong; verified against ca1d2e8~1.
    distill-cot-mix/            -> never existed. The real dir is
      b3-instruct-cot-mix and no report covers the distill_cot_mix recipe, so
      the three comments naming it are marked TODO rather than pointed at a
      lookalike.

Verified: `grep -rn "docs/<old>/"` across .py/.sh is empty for all ten moved
directories, every docs/*.py parses, and no parents[N] remains.
Brings the reorg branch current (was 112 commits behind) before the final
production/ split. Moving 187 files on a stale branch would have made the
merge-back unresolvable, so this lands first.

Conflicts, all mechanical:

- Five files added on ezpz inside directories this branch renamed. Git
  proposed the reorg destination for each; accepted as proposed
  (guides/ -> reference/, experiments/ -> records/experiments/).

- docs/experiments/optimizer-comparison/ arrived after the experiments/
  move and had no reorg twin. Relocated to records/experiments/ and its
  one inbound reference (agpt/config_registry.py:1109) updated.

- journal.md: the reorg turned it into an index while ezpz appended two
  entries inline. Kept the index note, moved the new 2026-08-23 polaris
  entry into records/journal/2026-08.md above the 08-19 one (reverse
  chronological), and corrected the contents count 10 -> 11. The 08-19
  entry was already in the monthly file -- checked before inserting so
  the merge did not duplicate it.

- eval/plot_evals_combined.py: took the ezpz side. Its OUT_PATH resolver
  (19d259c) exists precisely for this merge -- it probes for the
  README.md that embeds the chart, so it resolves to records/evals/ on
  this branch and docs/evals/ on ezpz with no per-branch edit. Verified
  resolving to records/evals/figures/ here.

Also fixes a stale link the merge surfaced: production/polaris/README.md
still pointed at guides/known-bugs/ for the blind-rotation writeup.

check_doc_links.sh gains a line-level `docs-link-check: ignore` opt-out.
The resolver above names both the pre- and post-move path by design, and
comments explaining a move necessarily name the retired one -- flagging
those trains people to ignore the checker, which costs more than an
explicit, greppable opt-out. Hits now report a line number.

Verified on the merged tree: 15/16 chart scripts pass (the one failure is
plot_evals_combined refusing to write an empty chart, correct -- the eval
JSON is cluster-side); zero color loss across 63 SVGs beyond the two eval
overviews that need Aurora data; dangling references back to the same 33
pre-existing, none introduced.
A design proposal, not a running chain: records/. Moved BEFORE production/agpt/
so it does not land in live/chains/agpt/ and need moving twice.

reorg_move.py now rewrites .py/.sh string literals too, not just markdown
links. Those are real filesystem paths -- output dirs and dashboard sources --
and missing one does not raise: the writer recreates the retired directory,
writes there, and exits 0.
production/ was the only directory holding all four lifecycle kinds at once,
so it does not rename as one tree. 187 files across 8 subtrees plus 6 root
files, per docs/notes/production-move-plan.md:

  production/agpt|cpt|moe|polaris|rl|sft/  -> live/chains/<kind>/
  production/figures|metrics/              -> live/figures|metrics/
  production/agpt/30b-exp/                 -> records/proposals/30b-exp/
  production/README.md                     -> live/dashboard.md
  production/{dispatch-log,loss-dashboard,queue-wait-analysis}.md -> live/
  production/POST-TRAINING-2B.md           -> live/chains/agpt/2b/post-training.md
  production/scaling-performance.md        -> reference/scaling/performance.md

30b-exp moved FIRST: it is a design proposal, not a running chain, and moving
it after production/agpt/ would have landed it in live/chains/ and required
moving it twice.

reorg_move.py gained two fixes this needed:

- It rewrote markdown links only. But 60 .py/.sh files name docs paths as
  STRING LITERALS -- output dirs and dashboard sources, including the live
  dashboard (prod_dash.py, trajectories.py, check_dashboard_drift.py,
  fill_trajectory_fields.py, export_ground_truth.py). Missing those does not
  raise: the writer recreates the retired directory, writes there, exits 0,
  and the docs quietly stop updating. The code pass is a string substitution,
  safe only because it anchors on the full "docs/<src>" prefix and requires a
  path-terminating character after it -- never a bare directory name.

- Code files INSIDE a moved tree are already at their new home by the time the
  rewrite runs (git mv goes first), so writing the pre-move path raised
  FileNotFoundError and aborted mid-run -- the tree moved, the literals did
  not. Caught on the sft pass; writes now route through the same moved-map the
  markdown pass uses. The sft literals were completed by hand.

The six root files are renames, which reorg_move.py does not handle (it takes
a directory). Moved with git mv plus two resolver passes: one repairing
inbound links from elsewhere in the corpus (36 links, 20 files), one repairing
the relocated files' OWN outbound links (23 links), which were wrong by depth
-- post-training.md landed three levels deeper than it started.

Link check: 31 dangling, down from 33 pre-move. Three pre-existing breaks were
repaired in passing; the one entry that reads as new
(rl/history/...desync.md -> ../grpo-on-xpu-status.md) is byte-identical to its
pre-move text -- a target that has been dead since 2026-07-06 and only becomes
visible now that the same file's other stale refs are gone.

check_doc_links.sh: reorg_move.py's own explanatory comments are opted out with
`docs-link-check: ignore` -- a tool that describes moving a path necessarily
names the retired one.
The production/ split left three plotters still writing to the retired tree,
and the mtimes are the tell: production/agpt/2b/n256/figures/*.svg came back
NEWER (07:55) than the live/ twin the docs actually embed (07:42). A full
chart run had silently rebuilt the old tree.

Cause: those output dirs are assembled segment by segment --

    DOCS_BASE / "production" / "agpt" / model_name / f"n{nodes}" / "figures"

-- so no "docs/production" substring exists to match. reorg_move.py's code
pass is deliberately anchored on the full "docs/<src>" prefix (a bare
directory name like "production" appears throughout the prose and cannot be
substituted safely), which makes a pathlib chain invisible to it by
construction. mkdir(parents=True) then does the rest: no error, no exit code,
just figures accumulating where nobody reads them.

Rewrote all three (plot_production_wandb.py, plot_production.py,
plot_polaris_20b.py) to live/chains/.

check_doc_links.sh gains check 3 for the class: a quoted path segment naming a
directory that no longer exists directly under docs/. Anchored on a docs base
(DOCS_BASE, "docs") -- without that it fires on outputs/evals/... too, a data
directory that merely shares a name with a retired docs one. Scoped to names
that USED to be real, which is exactly the post-move window where it matters.

It immediately found a second, older instance: plot_production.py:272 still
pointed COMBINED_OUTPUT at docs/experiments/agpt/aurora/figures/ -- stale since
the experiments/ -> records/experiments/ move, missed by every sweep since.
Fixed.

Verified: moved docs/production/ aside, ran update_all_charts.sh (15/16, the
one failure is plot_evals_combined correctly refusing to write an empty chart
without cluster-side eval JSON), and confirmed the directory was NOT recreated.
Dangling references 31, down from 33 pre-move.
Three silent failure modes, none of which raised or set a non-zero exit: the
mover only rewrote markdown; code inside a moved tree had already relocated
when its rewrite ran; and piecewise pathlib chains are invisible to any string
scan. The last was caught only because the stale figures had a newer mtime
than the live ones -- verify the artifact, not the exit code.
Two loose ends from docs-reorg-plan.md, both of which the production/ split
made worth closing.

Step 4 -- the link checker -- was written but never called. It was listed in
the plan as what makes step 3 "safe to repeat", and the last two days proved
the point (three silent path failures, each caught only by running it by
hand). Now runs as stage 3b of refresh_all.sh, AFTER the charts, because a
chart run can itself write a figure to a path a doc references.

ADVISORY, not fatal. There is a standing backlog of 31 dangling references
(dead rl/ paths, a Sunspot home path) predating this work; failing the whole
refresh on those would mean refresh_all.sh never exits 0, and a check that
always fails is a check nobody reads. It reports the count so the operator can
compare the DELTA, which is the number that actually means something. Gate on
it in CI once the backlog is cleared.

Root files: four of the seven had a declared home and were still at the root.

  TODO.md                      -> live/TODO.md            (plan line 107)
  SESSION-RESUME-2026-08-21.md -> notes/session-resume-2026-08-21.md
  upstream-sync-79.md          -> records/upstream-sync/2026-08-19-79th.md
  upstream-sync-80th-status.md -> records/upstream-sync/2026-08-21-80th-status.md

The two sync files are dated, immutable write-ups sitting beside the
records/upstream-sync/YYYY-MM.md series they belong to; renamed to that
convention. journal.md, README.md and upstream-sync.md stay at the root -- the
plan keeps those three as canonical indexes.

Same two-pass repair the production/ split needed: inbound links from the
corpus (5 links, 5 files; 2 string refs in code), then the moved files' OWN
outbound links, which break by depth (2 in TODO.md). Dangling count 31 before
and after -- nothing introduced.

Also: check_doc_links.sh was matching its own comment, since the piecewise
check's explanation names an example retired segment. Opted out.
31 -> 0. The backlog was the reason stage 3b had to be advisory, and an
advisory check on a permanently-failing corpus is a check nobody reads.

Almost none of it was unfixable -- it was one dead file cited many times plus
pre-reorg paths:

- 17 links resolved by basename: the target exists, the link just named a
  pre-reorg path (rl/history/*, known-bugs/*). Basename resolution is safe
  here because each of those names is unique across the corpus.
- 11 more by directory: ../rl/README.md and ../production/grpo/**/README.md
  could not go by basename (README.md is 59-way ambiguous), so those matched
  on the directory prefix that moved.
- 5 to grpo-on-xpu-status.md, which is not missing -- it was consolidated into
  the RL README hub in a20404e. Repointed to its successor.

7 were genuinely unresolvable and stay that way: 5 name a Sunspot
~/.claude/.../memory/ path that has never been in this repo, and 2 name a
smoke report that was cited but never committed. They live in dated records/,
which are immutable by convention -- rewriting their history to point at
something real would be a lie. Demoted to inline code, so they still name what
they reference but no longer claim to be navigation. The last hit was prose in
the reorg plan describing link syntax.

With 0 standing, stage 3b is now FATAL and also blocks the auto-commit. That
second part matters more than the exit code: auto-committing over a broken
reference is exactly how the empty eval charts reached the branch on
2026-08-16.
Three location conflicts, all resolved to the reorg destination. The
perlmutter guide needed a correction to git's proposal: it offered
reference/, but guides live at reference/guides/ post-reorg.

The now-fatal link check earned itself immediately. Two scripts that arrived
in this merge write into the retired docs/experiments/ tree:

  plot_optcmp.py:90      docs/experiments/optimizer-comparison/figures
  plot_lrfind_30b.py:81  docs/experiments/lr-finder/agpt/figures

Both were written against pre-reorg paths on ezpz, and plot_optcmp.py had
already recreated the directory and written four figures into it during
verification -- silently, exit 0, exactly the failure mode the checker exists
for. Fixed both; confirmed a full chart run no longer recreates the tree.

Note the checker caught these as ordinary check-2 hits. I first tried widening
it to scan adjacent string literals joined (the paths are split across two
lines, so no single line holds the whole path), but that produced 393 false
positives -- the pattern also matches "docs/../../records/..." and a `..`
traversal makes any prefix resolve nowhere. Reverted; the plain per-line scan
already flags the "docs/experiments/" fragment on its own, which is enough.
One modify/delete conflict: the 2026-08-24 sync entry landed on ezpz at
docs/meeting-notes/agpt-sync.md, which this branch moved to
records/meeting-notes/. Took the ezpz content at the reorg path.

The file merged in carrying links written from its OLD depth, so 47 of them
needed repointing -- both for the extra directory level and for targets that
moved in the production/ split. One more (grpo-on-xpu-status.md) went to the
RL README that absorbed it in a20404e.

The fatal link check also caught prod_dash.py:525 still naming docs/evals/ in
a docstring. Fixed. 0 dangling.
The 08-24 sync entry merged in naming ../production/dispatch-log.md, which on
this branch is live/dispatch-log.md. Caught by the now-fatal link check.
One content conflict in the sync entry: the rewrite touched the same paragraph
this branch had already repointed to live/dispatch-log.md. Kept the new prose
at the reorg path.
…ly file

Three things wrong in the docs tree, all mine, all from this week.

1. `docs/experiments-20260824-114830/` and `docs/production-20260824-080311/`
   were TRACKED -- 58 files. Those are `backup` copies I made while verifying
   the production/ split (moving a tree aside to prove nothing recreated it).
   I made them inside `docs/`, then `git add -A` swept them in. The
   production- one is a stale duplicate of live/chains/; its figures differ
   from the live ones only because they predate a regen. Removed from git and
   moved out of the tree.

2. `docs/experiments/optimizer-comparison/figures/` held the four optcmp
   figures, but the README that embeds them lives at
   `records/experiments/optimizer-comparison/README.md` and refers to them as
   `figures/*.svg` -- i.e. beside itself. They were in neither place it looked.
   Moved under records/ and the directory the earlier move should have emptied
   is now gone.

3. The 79th and 80th upstream syncs were separate files
   (`2026-08-19-79th.md`, `2026-08-21-80th-status.md`) sitting next to
   `2026-08.md`, which already holds syncs 73-78 as `##` sections. I created
   that inconsistency this morning when clearing the docs root -- I moved them
   from `docs/` into `records/upstream-sync/` without noticing the file they
   belonged INSIDE. Folded in as sections (headings demoted one level),
   newest-first, and the two files removed. The month now has all eight.

Fallout the above exposed:

- `TREE.md` was stale in every row: it still described `production/` as "not
  yet split", listed root files that have moved, and pointed upstream-sync at
  `outbound/`. Regenerated from disk, with a note to keep doing that rather
  than hand-editing counts.
- `experiments/ezpz/README.md`'s folder table had SIX of nine rows pointing at
  retired directories, plus dead links to `docs/TREE.md` and
  `docs/evals/README.md`. No check caught this because check 1 only walks
  `docs/` -- and the landing page lives one level up. Added check 1b for any
  `.md` under experiments/ezpz outside docs/, which immediately found two more
  (competition/README.md, synthetic/README.md).

Verified: 0 dangling, 15/16 charts pass, and a full chart run does not
recreate `docs/experiments/` or `docs/production/`.
…a check for them

You were right not to trust the "verified" on this. I audited the whole reorg
properly instead of re-asserting it, and found real breakage my checks were
structurally blind to.

Conservation first, since that is the thing that would be unrecoverable:
mapped all 485 docs files from ezpz through the move map and confirmed every
one exists at its destination. One outlier -- guides/checkpoint-on-signal.md
sat at reference/ instead of reference/guides/, byte-identical, from a merge
where I accepted git's proposed location without correcting it (same slip as
the perlmutter guide, which I did catch). Moved. Nothing was lost.

Then content: compared all 236 moved .md files with link TARGETS stripped, to
see if any prose changed. 68 differ, all explainable -- inline path text,
Last-updated bumps, canonical-record banners from step 2.

That 68 is where the real bug was. The link targets were rewritten by path
resolution, but the VISIBLE TEXT beside them still named the old location.
147 such mentions across 61 files. Worse, my production/ sweep had rewritten
`production/agpt` -> `live/agpt` when the actual destination is
`live/chains/agpt` -- so 66 of them pointed at a path that never existed, in
prose that reads authoritative.

No check could see any of this: 1 and 1b need a markdown link, 2 needs a
resolvable string reference, and these are neither. Added check 2b for bare
docs/ path mentions in prose and comments, gated on the first segment naming a
real or once-real docs directory so external URLs stay quiet. It immediately
found five more, including three `live/chains/agpt/30b-exp` mentions that
should be `records/proposals/30b-exp` -- my sweep had sent them to the chains
tree.

Four remaining hits are benign and now marked: a planned-but-unwritten README
the plan says CREATE, two line-wrapped paths, and an --output-dir created on
demand.

Verified after: 0 dangling across all five checks, 485/485 files accounted for,
15/16 charts pass, no retired directory recreated by a full chart run, and
nothing staged outside experiments/ezpz.
The reorg left README.md.bak-20260724-205104 and
README.md.bak-20260724-202703-20260724-222432 tracked in docs/. The second is a
backup OF a backup -- the doubled timestamp is the tell.

Verified they are superseded, not unique, before removing. Both differ from
their live twins, so a blind delete was not safe:
  * the 80B TP=2 15.5% MFU rows are present in the live twin itself, reworded
  * the tulu_math_uc_mix SFT entry survives in four live pages
    (live/chains/agpt/2b/post-training.md and three under live/chains/rl/)

Copies moved to /tmp/reorg-bak-20260827/ rather than deleted.

This is the same class of thing as the timestamped directories that made the
user distrust this branch. Those are gone; these were the remainder.
143 commits of ezpz brought forward. 18 conflicts, resolved by category:

  5 file-location: known-bugs docs written on ezpz landed in docs/guides/,
    which the reorg renamed to docs/reference/. Took the ezpz content at the
    reorg path (blendcorpus-fold-batch-dim, moe-mla-not-ported-to-4121-fold,
    moe-tp2-wo-placement, polaris-failover-detect-machine-fqdn,
    sophiag-stochastic-divergence-30b) and dropped the old directory.

  4 SVG: same figures at pre-reorg paths. Verified they are the same charts by
    distinct-colour count (4 vs 4) before taking the reorg copies -- the
    empty-figure failure mode does not announce itself.

  5 timestamp-only: `> Last updated:` collisions from refresh_all. Kept the
    later date. Two of them use a bolded spelling my first pass missed.

  journal.md: the reorg made this an INDEX with entries in
    records/journal/YYYY-MM.md, while ezpz appended two new day entries to the
    old monolithic file. Pasting them back would have undone the split, so the
    index keeps its note and the two 2026-08-25 entries were inserted into
    records/journal/2026-08.md above the shared 08-23 entry.

  docs/README.md: the generated index table. Took the reorg side (correct
    ./reference/ paths).

Audit before merging, since this branch had lost the user's confidence:
  * 485 -> 505 docs files, nothing dropped
  * no timestamped directories remain (the original complaint)
  * two committed .bak files removed in 01b44f6, after checking their unique
    rows survive elsewhere

KNOWN GAP: docs/README.md does not yet list the five relocated known-bugs
docs. It is generated by utils/refresh_docs_readme_table.py, which needs
torch; this laptop has none. Run scripts/refresh_all.sh on a machine with the
env before treating that index as current.
…chain in the live table

Two gaps after the docs/reorg-lifecycle merge:

1. The cross-link I added to the FQDN known-bug doc still pointed at
   guides/known-bugs/. The reorg rewrote the links it knew about, but
   mine landed mid-reorg so it was left behind and resolved to nothing.
   Now ../../../reference/known-bugs/; all four relative links from the
   polaris chain README verified to resolve.

2. The Polaris 20B chain was missing from "Production Training (live)"
   -- the table whose stated job is "what's training right now". It is
   the only non-Aurora live chain, so nothing else in that section
   covers it.

The row carries the warning with it: the chain is in neither
trajectories.py nor update_all_charts.sh, so refresh_all.sh exits 0
without regenerating its figures. Someone reading the live table should
not have to discover that from a stale chart. Links the handoff notes
too, matching the convention that root-level HANDOFF-*.md are reached
from a chain page rather than the auto-generated index (the sibling
aurora handoff is unindexed the same way).
The ezpz->reorg merge brought forward docs whose links still pointed at
docs/guides/ and docs/production/, which the reorg split into reference/ and
live/. check_doc_links.sh flagged 8; 7 were real:

  README.md (x2)                          guides/ -> reference/guides/
  HANDOFF-aurora-2026-08-26.md            guides/known-bugs/ -> reference/known-bugs/
  records/experiments/optimizer-comparison/README.md   ../../ -> ../../../reference/
  records/meeting-notes/agpt-sync.md      ../guides/ -> ../../reference/
  records/meeting-notes/agpt-sync.md      ../production/dispatch-log.md -> ../../live/

My first pass got three of those depths wrong -- files under records/<subdir>/
need one more level than I assumed. The fixer verifies each new target
resolves from the referring file BEFORE writing, so the wrong ones failed loud
instead of landing as fresh dangling links. Depths recomputed with
os.path.relpath.

The 8th is a FALSE POSITIVE and stays: plot_production_combined.py:61 points at
docs/live/chains/agpt/2b-mds/loss_data/train_metrics.csv, which is deliberately
gitignored (loss_data/.gitignore: *.csv) -- MDS data is pulled locally from
its own W&B project and was never tracked. The checker treats a data path like
a doc link.

Left the plotter unguarded on purpose: open() raises FileNotFoundError, so the
script dies loudly rather than rendering an empty figure that refresh_all would
auto-commit. That silent-empty-chart mode has cost us before; a hard failure is
the better behaviour here.
refresh_all.sh ran the index generator as
`python -m torchtitan.experiments.ezpz.utils.refresh_docs_readme_table`. The -m
form walks the package chain, and ezpz/__init__.py imports local_device_compat
which imports torch -- so regenerating a markdown table required a full
training environment.

The generator is stdlib-only (re, subprocess, sys, pathlib). Its single
trajectories import at line 186 is already try/except-guarded with a fallback.
Running it as a plain script skips the package __init__ entirely.

Ran it: 29 rows updated. The five known-bugs docs the ezpz->reorg merge
relocated are now indexed (moe-tp2-wo-placement, blendcorpus-fold-batch-dim,
sophiag-stochastic-divergence-30b, moe-mla-not-ported-to-4121-fold,
polaris-failover-detect-machine-fqdn) and zero stale ./guides/ paths remain.

This closes the KNOWN GAP recorded in the 6872a9a merge commit.
local_map failing to convert has exactly three exits, and all three return the
unwrapped forward with NO error:

  module.py:280  self._sharding_config is None  -> module never parallelized
  module.py:430  sharding_config.local_map None -> no local_map installed
  module.py:479  resolved_mesh is None          -> raw forward, DTensors flow in

The third matches what was measured: the config IS installed (traversal is
unconditional) yet the wrapper receives DTensors.

Six hypotheses eliminated by reading, recorded so they are not re-checked:
both models pin partial_dtensor; both call their sharding setter from
Config.update_from_config; both pass self and iterate config.layers; moe's
sharding matches upstream deepseek_v3 assignment-for-assignment; positional arg
names are identical; the head-dim asymmetry is irrelevant since agpt reshapes
correctly at head_dim 16.

One live lead: attention_activation_placement returns two structurally
different layouts depending on cp. The q path (cp=S(0)) gets
{DP:V, CP:V, TP:V} WITH a partition_spec; the k/v paths (cp=R and cp=P) get
{DP:S(0), CP:cp, TP:S(1)} with none. set_gqa_inner_attention_local_map mixes
all three in one boundary, and resolve_shared_mesh resolves them together.

NOT verified -- spmd_types is not installed on this laptop, so the layouts
could not be evaluated. The doc carries the three-line check to run first; it
needs no GPU, just an env with spmd_types.
…d on a laptop

Built both configs and called update_from_config the way the trainer does, at
tensor_parallel_degree=2. No GPU, no cluster -- torch, spmd_types, ezpz and
sentencepiece all install fine outside a training env, which makes this whole
class of question answerable without a queue slot. I had claimed twice that it
needed the cluster; that was wrong.

  moe   inner.sharding_config = ShardingConfig   local_map = LocalMapConfig
  agpt  inner.sharding_config = ShardingConfig   local_map = LocalMapConfig

So exits 1 and 2 are out. And the declared axes are byte-identical -- in
q/k/v, out, and all three grad entries are ['cp','dp','tp'] on BOTH models --
so resolve_shared_mesh gets identical input and exit 3 cannot distinguish them
either.

Also identical: parallelize_moe and parallelize_llama take the same
partial_dtensor branch and both call model.parallelize when TP is enabled.

Eleven hypotheses are now dead, tabulated in the doc so none is re-walked.
Nothing static differs: config population, layout axes, arg names, parallelize
branch. Whatever diverges does so at RUNTIME during parallelize, on state that
only exists once a real mesh is built.

Next step genuinely needs ranks: instrument _apply_local_map to report whether
it returns the wrapped or unwrapped fn, and what resolved_mesh came back as.
Everything cheaper has been tried.
Session monitors do not survive a restart. Records what was armed, the
re-arm commands verbatim, which ones are dead and should NOT come back,
and the state to check first on resume: whether bad_nodes.txt column 2
reads 'scraped' (watchdog fix 8592d20 engaged) or 'blind' (it did
not). That is the first live trial of that fix -- leg 7567541 is hung
right now on x3111c0s37b1n0, the third consecutive job to land on that
zombie node.
saforem2 added a commit that referenced this pull request Sep 16, 2026
The native-DDP preflight could never run. Two independent defects, both
on the same call path, both from f5f6ee6:

1. trainer.py passed 6 of the 9 required keyword-only args. Missing:
   fault_tolerance_enabled, create_seed_checkpoint,
   optimizer_has_param_groups -- none of which have defaults. Any run
   with enable_data_parallel_native_ddp=true died with TypeError at
   trainer construction, before anything else was reached.

   All three are available at the callsite and now passed:
   config.fault_tolerance.enable, config.checkpoint.create_seed_checkpoint,
   and whether config.optimizer declares param_groups.

2. Even fixed, the validator read three fields that do not exist here:
   parallelism.enable_fsdp_async_all_reduce,
   pipeline_parallel_fsdp_overlap and pipeline_parallel_fsdp_overlap_policy.
   Those are on the upstream Aurora MoE branch's CORE ParallelismConfig;
   ours is EzpzParallelismConfig, which deliberately ports only the five
   fields our code reads, and core torchtitan never had them. Reading
   them on a slotted dataclass raised AttributeError, and they sit two
   gates before the final check, so they were always reached.

   Now read via getattr with the upstream default. Keeping the checks
   rather than deleting them means the rejection still fires if those
   fields are ever added; deleting would silently accept a combination
   the author explicitly rejected.

Verified by calling the validator against REAL objects -- a real
ParallelDims built from its own dataclass fields, a real TrainingConfig,
and a real EzpzParallelismConfig with the flag on. It now runs every
gate and returns a policy ValueError ("native DDP currently requires
standard CrossEntropyLoss") instead of TypeError or AttributeError.
That is the validator working.

Both found by /code-review on my own PR (#17), findings 1 and 2 of 15.
I shipped f5f6ee6 saying the hooks were wired and 73824cf saying the
flags made the path live. Neither was true, and no test I wrote would
have caught it -- they all exercise the expert backends instead.

Still open from that review: #3 (wrap_native_ddp runs on a meta-device
model before to_empty), #4 (a helper imports _NativeDDPPipelineStage from
core, where I moved it out of), and #15 (scale_native_ddp_loss defined
but never called, leaving gradients dp_degree x off).
saforem2 added a commit that referenced this pull request Sep 17, 2026
…(review #3, #4, #15)

Three remaining findings from /code-review on #17. With b2deeb2 this
closes all five blockers on the native-DDP path.

#3 -- wrap_native_ddp ran on a META-DEVICE model.

The model is built under torch.device("meta") and moved to the real
device by to_empty(). The wrap sat BEFORE that, so DDP read
next(model.parameters()).device, got device(type='meta') with .index
None, computed device_ids=[None], and built reduction buckets over meta
storage. to_empty() then reallocated every parameter, invalidating the
bucket views DDP had just built with gradient_as_bucket_view=True.

Moved after to_empty/init_states and before model.train(). Order is now
to_empty -> init_states -> wrap -> train.

#4 -- wrap_native_ddp_pipeline_stage imported _NativeDDPPipelineStage
from torchtitan.distributed.pipeline_parallel, where it does not exist.

ab24c5c moved that class into native_ddp.py as part of the dependency
inversion -- it is defined at line 853 of the same file that was
importing it from core. ImportError for any PP + native-DDP run, and the
isinstance check three lines later could never have matched. Only
unreached because the function has no callers. Import dropped; the
class resolves from module scope.

#15 -- scale_native_ddp_loss was defined and never called, leaving
gradients dp_degree x too small. This is the one that would have
TRAINED, not crashed.

Core's forward_backward_step states it: "The returned loss here is local
SUM loss / global_valid_tokens". global_valid_tokens is a cross-DP sum
(dist_sum over batch_mesh), so gradients are already globally normalized
before backward. DDP's reducer then divides by process_group.size()
again. FSDP hits the same thing and solves it with
disable_fsdp_gradient_division (agpt/parallelize.py); DDP exposes no
equivalent switch, so the compensation has to happen on the loss -- which
is precisely what scale_native_ddp_loss exists for.

Wired at self.loss_fn construction, which ezpz owns, so it lands before
every consumer without touching core's forward_backward_step. Guarded on
the flag and on dp_degree > 1.

Verified: gradient ratio exactly 4.0 at dp=4 and 8.0 at dp=8, loss VALUE
unchanged in both (so reported loss stays comparable across paths), and
dp=1 refuses rather than silently no-opping.

Not yet run end-to-end with the flag enabled on hardware. These fixes are
reasoned from the code plus unit-level verification of the scaling math;
the path still needs a real run before anyone should trust it, and that
is the next step rather than a claim this commit makes.
@saforem2
saforem2 force-pushed the ezpz branch 3 times, most recently from fff19c4 to 10bd786 Compare November 5, 2026 14:36
@saforem2

Copy link
Copy Markdown
Owner Author

Closing: 1503 commits behind ezpz with 188 conflicting paths, and the three append-only files have grown 1.3–1.9× since. The two pieces not on ezpz (MoE TP>1 diagnosis, check_doc_links.sh) are salvaged in #77. If the monthly split is still wanted, redo it fresh after the upstream sync rather than rebasing this branch.

@saforem2 saforem2 closed this Nov 11, 2026
saforem2 added a commit that referenced this pull request Nov 12, 2026
* docs(ezpz/moe): port TP>1 early-return diagnosis from #15

Applies 81ccd98 and 683acaf from docs/reorg-lifecycle to the current
guides/known-bugs/ path. The reorg branch is being closed; this text was
only on it.

* feat(ezpz/scripts): add check_doc_links.sh from #15

Checks docs->docs links, code->docs paths and depth-counted paths.
On current ezpz it reports 51 dangling references. Not wired into any
hook or CI yet.

* fix(ezpz): address review on #77

check_doc_links.sh: case-sensitive lookup, titled links ('', "", ()),
#fragment checked against GitHub heading slugs, unreadable dirs fail
the run, external URLs skipped in the path scans. Count on current
ezpz goes 51 -> 71; the 20 new ones are broken heading links.

moe-tp2-wo-placement.md: resolved_mesh exit is open, not eliminated
(only axis sets were compared). Snippet uses cfg.model and is marked
as a 2026-08 record; it no longer runs after the October sync.

* docs(ezpz): fix broken journal links and codespell in production READMEs
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