Repository navigation
Add a reproducible TorchTitan checking workload with exact state evidence - #159
Merged
Merged
Conversation
Essoz
marked this pull request as ready for review
October 30, 2026 07:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checking-overhead measurements need a fresh native TorchTitan workload that verifies training behavior and records what instrumentation actually executed. This adds plain, explicitly API-only reference, subclass-reference, and invariant-guided selective modes for the pinned 6,163,712-parameter Llama debug model. It measures synchronized native steps and records parameter/gradient/buffer byte digests, DTensor metadata, losses and RNG evidence. Selective options go through the production JSON-loading boundary; required fields and unsupported cases fail explicitly.
DTensor evidence is limited to one rank. Subclass tracking rejects FSDP-owned DTensors before modifying them. API-only collection reports model tracking disabled. Setup, state verification, queue drain and shutdown stay separate from step timing.
Verified H100 results
Three fresh order-controlled pairs, seed 42, 10 steps, sequence 256, batch 1, sampling_interval=1, warm_up_steps=0; one H100 80GB, Torch 2.16.0.dev20261012+cu130. Corrected selective job 55325270 uses composed source c2233f1 and the unchanged 722 inferred rules.
Median paired slowdown is 22.64x (+2164% relative to plain), range 22.62–22.67x. The seed 43/20-step holdout is 22.77x. All three pairs and the holdout have matching initial/final tensor-byte digests, DTensor metadata, losses and RNG evidence. This tiny, every-step-instrumented workload does not establish larger-model or interval-10 overhead.
Both validated cohorts have 718 active passes, 1 active violation, 3 dormant rules. Complete observed/direct CheckerResult parity is 722/722, with report inputs matched to audited trace/invariant hashes. The remaining CUDA stream-handle portability violation and literal thread-ID dormancy are retained. All four selective traces have complete, unique call pairs and raw/parsed-row parity.
Selective produces 416,364 records /143,453,745 bytes per 10-step trace, versus 442,918 /255,365,856 for the earlier full-API reference. Record count falls only 6.0%; bytes fall 43.8%. The separate single full-API pair measured 44.570 ms plain vs 5,079.953 ms traced. That cross-job comparison is not a repeated optimization result. Earlier incomplete-policy selective timings are invalid and superseded.
Direct offline checking takes 29.980 s for 10 steps and 54.520 s for 20 steps, separately from training. Concurrent live checking and FSDP model tracking remain unvalidated; no result for either is claimed.
Validation and provenance
Full measurements, limitations, hashes and reproduction details. Downloaded source/manifests/traces/results are under
outputs/checking-overhead-20261027/in the experiment owner's checkout; remote copies and exact commands are listed in the report. Large artifacts are excluded from Git; cluster scratch is retention-limited. The corrected component profile is complete; its diagnostic results and limitations follow.Component profiling completed
H100 job 55325428, same frozen source/policy/control files, steps 3–10, main thread only. A targeted
sys.setprofilecollector passed thread-isolation tests on allocated Python 3.12.3: 20 background markers executed, 0 profiled. Its complete state/RNG/loss evidence and per-step/API/event counts and bytes match ordinary controls.These are not ordinary-overhead shares or promised speedups. Profiling expands the selective window 7.961 s→42.005 s (5.28x) and plain 0.354 s→0.712 s (2.01x); callback overhead remains included. It covers 133,440 main-thread records and excludes 105,472 records from the other traced worker, plus writer-thread CPU. All categories reconcile to the full diagnostic window.
Actionable work: 1,243,312 attribute reads and warning contexts over 8 steps (155,414 per step); integer positional keys predictably reject the first orjson attempt; and 34,104 separate JSON compatibility probes. Prefer reducing repeated metadata/warning work, preserving its behavior, then avoiding predictable fallback exceptions and eligible primitive probes. Changing encoders must preserve NaN/Infinity, large-integer and error behavior. No production optimization or speedup is claimed here.
The prior cProfile job 55325378 is retained as rejected timing attribution because CPython 3.12 captured background threads and mixed caller accounting. Its percentages are not used. The corrected profile, raw traces, runtime self-test, typed analysis tools and reproducible commands are saved under
outputs/checking-overhead-20261027/job-55325428and the full report. Analysis-helper strict typing/lint/format and eight raw/owner audit fixtures pass. This PR update is a signed documentation-only checkpoint.