Repository navigation
Conversation
This branch has not been deployed
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.
Selective instrumentation was omitting fields that its chosen invariants inspect. A fresh native TorchTitan trace produced 61 violated rules even after repairing a separate harness JSON-loading bug: 54 missing-return cases, 1 incomplete distinct-argument case, 5 positional-only/variadic selector cases, and 1 process-local CUDA stream-handle portability failure. Missing context-constructor inputs also made rules dormant.
This compiles the requirements into a union of needed evidence:
ConsistentOutputRelation.DistinctArgumentRelationand the existingInputOutputParamcontract, independent of rule order or narrower overlapping requirements.It preserves the invariant set, predicates, literal identity conditions and checker behavior. No rule or field is dropped to force a pass. FSDP/model-tracker compatibility and live-reader issues are outside this PR.
Measured correctness result
Final H100 job 55325270, composed source c2233f1, unchanged 722 rules, 6.2M Llama, one GPU, sequence 256/batch 1:
This is a correctness repair, not a speedup. Correct selective collection takes 22.64x plain steady-step time in this tiny every-step workload. Earlier lower numbers omitted required evidence and are not valid checking results. Full study and evidence provenance.
Engineering validation
Baseline main 6dccb47; this independent main-based PR contains four signed commits. 69 policy/constructor/trace-integrity tests pass on the independent branch. The test-discovery fixture repair also passes both unittest invocation styles locally (28 each); before repair discovery had 3 failures and 3 errors while qualified invocation passed. The composed local pytest selection passes 83 tests. Both invocation styles also pass 28/28 on labmach Python 3.11.4 / Torch 2.16.0.dev20261012+cpu, using the SHA256-verified updated fixture and single-thread settings.
New regressions use real wrappers, JSON policy/trace loading and actual checkers, including negative controls, inversion, literal-ID dormancy, order-independent unions, required-field failures and malformed types. Healthy output/distinct-input/unsupported-argument regressions fail before their respective fixes.
Configured Ruff, mypy, Black and isort hooks pass. New tests/helpers pass explicit stricter mypy. The stronger legacy collect_trace.py check improves 10 baseline findings to 5, with none added; this is not a repository-wide strictness migration.