Add CPU correctness gates + CI + Apache-2.0 license - #1
Merged
Conversation
The engine's load-bearing claims all fail silently: a broken all-reduce still
trains, a non-circular pad still converges, a regularizer blind to dimensional
collapse still logs a healthy loss. Until now they were verified by hand on a
pod and written up in prose. Gate them instead.
tests/ (41 tests, CPU-only, ~11s, torch is the only dependency):
- test_distributed_sigreg: world=2 x batch-B == world=1 x batch-2B over gloo,
the CPU twin of `src/sigreg.py --verify` (NCCL, 2 GPUs), plus a
process-group-free check of the shard-additivity algebra it relies on.
- test_anticollapse: the collapse_resolution finding as an executable claim --
on a rank-2-of-64 batch with per-dim std 1.00, |grad sigreg| = 2.3e-4 vs
|grad cov| = 0.25 (~1000x). Also pins the participation-ratio detector.
- test_conv_stem: pytest port of scripts/test_conv_stem.py (kept as the
standalone demo) -- token-grid match, bit-identical linear path, legacy
checkpoint keys, circular equivariance.
- test_sigreg / test_masking / test_jepa: objective properties, mask
partition structure, and per-mode teacher/stop-grad wiring.
CI runs the suite on ubuntu-latest x py3.10/3.12 against the CPU torch wheel,
with the distributed gate called out as its own step.
LICENSE: Apache-2.0. The repo is meant to be read and reused; without a license
it was legally unusable.
One test skips on Windows, where gloo cannot create a device.
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.
Turns the repo's verified-by-hand claims into gates that run on every push, and makes the code legally reusable.
What's here
tests/— 41 tests, CPU-only, ~11s,torchis the only dependency. No transformers, no video codecs, no CAMELS download, so it stays runnable on a bare runner.test_distributed_sigreg.pyworld=2 × batch-B ≡ world=1 × batch-2Bover gloo on CPU — the twin ofsrc/sigreg.py --verify(NCCL, 2 GPUs), which CI can't run. Plus a process-group-free check of the shard-additivity algebra the collective depends on.test_anticollapse.pycollapse_resolution.mdfinding as an executable claim: on a rank-2-of-64 batch whose per-dim std is a healthy 1.00,‖∇sigreg‖ = 2.3e-4vs‖∇cov‖ = 0.25(~1000×). Also pins the participation-ratio detector against known-rank inputs.test_conv_stem.pyscripts/test_conv_stem.py(kept as the standalone demo): token-grid match, bit-identical linear path, legacy checkpoint keys, circular equivariance to 8e-7.test_sigreg.pytest_masking.pytest_jepa.pystop_gradreally severs the target, detectors in range.CI —
ubuntu-latest× py3.10/3.12 against the CPU torch wheel. The distributed gate is its own step because it's the load-bearing correctness claim.LICENSE — Apache-2.0 (explicit patent grant). The repo is meant to be read and reused; without a license it was legally unusable.
Why these tests
Each targets a failure that does not raise. A broken all-reduce still trains. A non-circular pad still converges. A regularizer blind to dimensional collapse still logs a healthy loss — that one already cost a run, and
eff_rankis the reason it was caught.Note
One test skips on Windows (gloo cannot create a device there); it runs on the Linux matrix.