Skip to content

Integrate faithful CPU execution: packed kernels and trained FP semantic exit - #27

Open
tugrapaydiner wants to merge 25 commits into
mainfrom
perf/integrated-final-runtime
Open

tugrapaydiner wants to merge 25 commits into
mainfrom
perf/integrated-final-runtime

Conversation

@tugrapaydiner

@tugrapaydiner tugrapaydiner commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Status: implemented and fully checked; not merged

Head: b28e01b85bd95b78f291e466c25c13bfa2fc5b46
Source tree: 0d00d6e01c5aca76e60bc6651a9d5ffdc90c00f7 — 578 files
All 10 final-head workflows pass. Main remains 9fd6682345b34e992b3cab7e55750e9ef4b04e87.

The final source, CI, performance, failure and delivery receipt records exact run IDs, artifact hashes, counts and limitations. No main merge, release publication, permissions change or unrelated branch retirement is performed.

What changes

This PR contains two separate, opt-in efficiency improvements. Their model formats and speedups must not be conflated or multiplied.

Trained FP execution: PreparedFPSudoku owns a snapshot of the accepted CPU FP32, n=T=1, 4x4 Sudoku graph and dispatches the same ATen native MHA, RMSNorm, linear, exact GELU and ordered residual operations from C++. Only immutable weights and input-independent positions are prepared. Each solve creates a fresh exact checker and zero recurrent state, retains every recurrent step and per-step validity check, and stops on the same answer/depth. This is reduced Python dispatch/setup overhead, not a new GEMM/attention algorithm, quantization or model training result. Unsupported module classes/overrides/hooks, nonfinite or unfrozen weights, dtype/shape/budget mismatches, autocast and incompatible attention dispatch are rejected. The internal ATen dependency is explicitly scoped to PyTorch 2.10.x.

Earlier packed execution: compose final-only output with historical checked, validated-owned and four-vector-blocked packed runtimes while preserving ordered FP32 accumulation. Arbitrary runtime subclasses remain rejected. The original diagnostic forward and historical operators remain available. Packaging-only edits no longer attempt republication of an existing version; 11 tests exercise the actual version-transition guard against disposable Git histories.

Trained-model result

Two existing accepted FP checkpoints (seeds 1401/2402), 256 distinct ordinary/shifted development puzzles, 512 model/puzzle cases. The performance experiment uses previously observed development inputs, not new confirmation/reserve cases. No checkpoint is retrained, quantized, replaced or selected using the new outcomes.

Measurement Prepared / existing native ratio Speedup Prepared / matched-preparation eager ratio Speedup
Local EPYC 9V74, Python 3.13.5 0.586054 1.71x 0.641995 1.56x
CI EPYC 7763, Python 3.11.16 0.513490 1.95x 0.569079 1.76x
CI EPYC 7763, Python 3.13.15 0.532800 1.88x 0.590297 1.69x

Ratios use sums of per-case medians. Every declared primary gate passes; conditional problem-cluster intervals, all strata and all raw observations are in the final receipt/artifacts. Warm complete solve begins with a pretokenized tensor and includes fresh checker/state, embeddings, recurrence, decoding/checking and returned work. JIT/model preparation/input-tensor construction and the extra external audit are separately scoped.

The stronger eager control also owns copied weights and precomputes positions without repeated eval setup. It isolates the additional dispatch benefit rather than comparing only against a weak setup-heavy reference. The primary protocol was committed before implementation/measurement at 3cb7073; the ablation was separately declared in comment 5648284600 before implementation/measurement.

All neural paths preserve 478/512 valid outcomes, every answer, depth and work record. These FP models already achieved those outcomes. This is not an accuracy increase from the earlier packed fixtures' zero-valid result. The symbolic solver still solves 512/512 and is faster. Local total charged time per verified output, including failed attempts: 0.845 ms native / 0.507 ms prepared / 0.104 ms symbolic.

Each environment retains 14,336 four-arm timing observations plus 7,168 two-arm control observations. Seven repeats are not independent new tasks. No case-median regressions occur; local empirical case-P95 regressions remain 12 primary / 23 control, and one CI control case also regresses. No production-tail guarantee is made.

Validation and preservation

  • 1,532 fast tests pass locally and in both full CPU CI environments; 16 historical slow tests are excluded, not counted as passes. The 136 new runtime/evidence tests are included.
  • Both trained-FP CI archives: 136 focused passes, 11 dependency-free actual installed-wheel checks, fresh native compilation and installed-runtime bit contracts.
  • Per environment: 2,048 primary arm execution replays, 2,048 full-budget recurrent-state/logit step replays, and 1,024 stronger-control execution replays, all exact within the matched environment.
  • Historical checks retain 11,520 checked answers and 3,840 checkpoint comparisons with zero mismatches; full CI also preserves fixed-pool/restart/controller/SAT audits without reversing failed scientific gates.
  • Independent standard-library delivery audits recompute full coverage/order, every original-clue answer, full repeated work records, strict counter types, median ratios and charged time without importing benchmark analysis.
  • Downloaded archives pass CRC/GitHub SHA256 checks; all 578 source bytes match the exact tested tree. The final wheel matches 126 packaged source members.

Compared with preceding branch head 8c1abb3, 565/567 files are byte-identical. Only two navigation guides change; eleven files are added. All old research implementations, configurations, tests and raw evidence remain unchanged. Earlier development/pre-audit measurements and their exact source snapshots remain retained. An initially incomplete later-round work-record audit was fixed, adversarially tested and followed by a separately frozen final run, not an overwrite of old observations.

Important retained limitations

Cross-host bits: both CI environments pass their own strict replay, but their stored internal-state hashes fail strict replay on local EPYC9V74. A complete diagnostic finds candidate/reference bit equality locally on all 512 cases/2,048 steps; against each CI archive, all trajectory hashes differ but all 2,048 complete-arm answers, validity flags and work records agree. Failed strict logs remain retained; no verifier is weakened and no cross-hardware bitwise guarantee is claimed.

Startup/storage: fresh compilation plus preparation takes 49.84 seconds locally and about 41.22/41.25 seconds in CI. The separate cached-library setup break-even is approximately 1,193 local calls, not a cold-compiler or first-call gain. Each runtime owns 206,620 bytes of tensor payload; source retention duplicates storage. Payload bytes are not peak RSS. No memory or energy reduction is established.

Earlier packed result: the retained packed fixture comparison reports 2.47x local and 2.66x/2.19x earlier CI gains, but every fixture output is invalid. A separate dense FP control is faster but nonbitwise; earlier packed cross-hardware strict failures are also retained. None of that evidence is relabeled as trained FP solving.

This is useful existing trained execution becoming cheaper, not new learned reasoning, broader generalization, superiority to classical solvers or a hiring claim. See docs/TRAINED_FP_GUIDE.md, docs/TRAINED_FP_PROTOCOL.md and the separate docs/RUNTIME_GUIDE.md for interfaces and reproduction. The final receipt links exact evidence and the accompanying ChatGPT delivery; no new GitHub release is claimed.

Copy link
Copy Markdown
Owner Author

Final-head CI and follow-up audit receipt

Head remains 7ca85b5af823fa7c5ed1af01ed3124a4e903c494; source tree 78b61552ac4e011d73194974f701cb3a2913a990. All nine PR workflows completed successfully: repository audit, public package, native contract, task-data contract, CPU regression contracts, indexed efficiency, cached residuals, SAT workload admission, and the new integrated-runtime matrix. This does not merge or publish a release.

New runtime CI artifacts inspected

Both downloaded archives passed CRC and matched GitHub's artifact SHA256. Their recorded source trees exactly match the local tested tree. Each contains 228 focused passing tests, 11 dependency-free installed-wheel checks, six installed-native runtime arms, 1,344 measurements, and 192 successful within-CI execution replays.

Environment Blocked-final / best non-blocked ratio Case-median regressions
Python 3.11.16, Intel Xeon 6973P-C, GCC 13.3 0.2517347163 (~3.97x faster) 0/32
Python 3.13.15, Intel Xeon Platinum 8370C, GCC 13.3 0.2645601113 (~3.78x faster) 0/32

Artifact IDs: 10303239499 and 10303990690 from run 34712421361. These are separate environment-specific observations, not a universal speed multiplier. All fixture validity outcomes remain false.

Portability limit uncovered rather than hidden

Additional strict replay of the Intel CI recordings on the local AMD environment fails bitwise matching, even using the unchanged historical checked runtime. For each CI archive, 156/192 execution-output hash comparisons differ across environments, including 26/32 historical checked-trace cases. A complete diagnostic establishes zero disagreements between the six runtimes within the local environment, zero cross-environment decoded-answer differences, and zero validity differences in these fixtures. Both CI environments independently passed their own exact six-arm checks and replays.

Therefore the result is bitwise preservation relative to the historical runtime within the same environment, not a promise of cross-hardware/Python-environment bitwise floating-point portability. The strict replay failures and full diagnostic are retained. The verifier was not weakened, and these failed cross-environment replays are not counted as passes.

Stronger alternative control

A separate exploratory full-trace comparison expands the same packed artifacts into dense FP32 weights and uses PyTorch linear operations. Across the same 32 cases / 448 calls, its ratio of summed case medians versus blocked tracing is 0.3080402493 (~3.25x faster still). It changes logit bit patterns in all 32 cases; maximum observed absolute logit difference is 0.0015380383. Decoded answers happened to agree in this small fixture set. For the dim64 fixture, additional expanded weight payload is 197,888 bytes versus 14,712 bytes of owned blocked payload; neither is peak RSS.

This alternative has different reduction arithmetic and memory tradeoffs and was not silently added to the exact public API. Its script, all raw observations, and outputs are retained separately from the frozen six-arm experiment in the delivery bundle. The new packed kernel does not establish superiority over optimized dense libraries. Useful trained-task performance and an explicit numerical/memory tradeoff study remain the next decision-changing work.

Copy link
Copy Markdown
Owner Author

Delivery receipt — final source, artifacts, and current checks

Final head 8c1abb32895490f6b9e6892a116b6e73b2d5233a; exact local/uploaded source tree 6180a5e7ed800b9e6ab51b5dffcf36207024b3f6. Main remains unchanged at 9fd6682; this PR is not merged and no release is published.

The full local suite was rerun once more after the final documentation changes, with the exact final tree recorded before testing: 1,396 passed, 16 slow tests deselected, two historical warnings. The final wheel was rebuilt from its source distribution and passed all 11 dependency-free installed-package checks. All 567 source-archive member bytes match the final source tree.

At the delivery check, eight final-head workflows have completed successfully: repository audit, public package, native contract, task-data contract, indexed efficiency, cached residuals, SAT workload admission, and integrated runtime. The broader CPU regression workflow (34713482769) is still in progress, not counted as a ninth pass. Both full-fast-suite steps and the historical checkpoint/fixed-pool/restart replay steps have passed there; the subsequent controller refits/audits/upload are still running. Earlier all-green heads are not substituted for final-head completion.

Final integrated-runtime run 34713482722 is complete. Its Python 3.11/3.13 archives were downloaded, CRC-checked, matched to GitHub SHA256 and the final source tree, and independently analyzed. Each has 228 focused passing tests, 11 public-install checks, six fresh-build installed-native arms, 1,344 measured calls, and 192 within-environment execution replays. Final speedups versus the strongest non-blocked control per case are 2.66x and 2.19x, alongside the independent local 2.47x observation. All fixture task-validity outcomes remain false.

Tail disclosure

No case-median regressions occur in the fixed local or either final CI matrix. However, two local cases have worse empirical P95 values against the median-selected comparator, with ratios 1.25074 and 1.00296. Seven samples per arm/case support only descriptive quantiles, not stable production-tail claims. All observations remain retained. The faster-but-non-bitwise dense control and failed cross-environment bitwise replays also remain disclosed and preserved.

Delivered archive

SPECTRA_PR27_source_and_evidence.zip is supplied in the accompanying ChatGPT delivery (not claimed as an uploaded GitHub release). It contains the complete final source, patch, original and final measurements/fixtures, initial and final CI archives, local test/install/replay receipts, failures and diagnostics, implementation report and point-in-time CI status. ZIP CRC and every delivered member SHA256 were independently checked.

Bundle size: 64,585,512 bytes.
Bundle SHA256: d8544d18c32c3b90b7c1c202cd37bba1fafe106bbaf8375c92f2cb27fc6e9d8e.
Complete final source archive SHA256: c190cdb5160b21a78e9b55a5ac6c50d5553d08e08b3008331c9bcecfc251e11f.

Implementation is complete on this branch. The pending workflow is reported honestly; no automatic merge, permissions change, or scientific-claim expansion is requested by this receipt.

Copy link
Copy Markdown
Owner Author

Continuation checkpoint: all nine workflows on 8c1abb3 are now successful. Main remains unchanged. Trained FP protocol is committed at 3cb7073.

The initial local development matrix has 14,336 observations, 512 model/input cases, exact answer/depth/work agreement, and 478 verified outcomes for each neural arm. Prepared/native ratio 0.571750, problem-bootstrap interval [0.567691, 0.575769]; all four strata pass the declared development gate. The existing symbolic solver still solves all 512 outcomes faster. All observations, 20 descriptive per-case P95 regressions, and the executable snapshot are retained; these are development observations, not final-head CI evidence.

Before adding or measuring another control, declare this addendum: run a separately labelled matched-preparation eager control on the identical 512 cases and two frozen checkpoints. It will own a copied eval-mode model, precompute only input-independent positions, cache the native checker class, and retain the historical Python recurrent graph. Compare it against prepared native dispatch over seven seeded interleaved rounds, checking every answer, validity and work dictionary. Retain complete rows and separately report the candidate/eager ratio, paired problem-cluster interval and regressions. This ablation must not replace or redefine the already declared four-arm primary; it tests whether dispatch elimination adds value beyond simply hoisting eval/position setup. No new trained capability, classical-solver superiority, or memory/energy claim is introduced.

…te-solve evidence

Own and validate the audited FP32 n=T=1 4x4 TRM graph; dispatch the same ATen operators from a C++ context without changing weights, recurrence, per-step semantic checks or the historical implementations. Explicit PyTorch 2.10.x environment and graph constraints; snapshot ownership, input validation, trace and concurrency contracts.

Two existing hash-bound checkpoints, 256 previously observed development puzzles, 512 model/input cases. Separate four-arm primary (14,336 observations) and predeclared matched-preparation eager ablation (7,168 observations). Preserve 478/512 neural valid outcomes, every answer and work record, and 2,048 full-budget recurrent state/logit steps. The exact symbolic control remains faster and solves all 512 cases.

Final local source tree matches this tree. 1,532 fast tests pass, 16 historical slow tests excluded. Actual sdist-built wheel passes 11 public installation checks and fresh native execution outside checkout. Primary ratio 0.586054 [0.583107,0.588916]; matched-preparation eager ratio 0.641995 [0.637490,0.646411]. No case-median regressions, but 12/23 descriptive case-P95 regressions remain visible. Preparation/cold compilation and copied-weight storage are separate; no memory, energy, learned-generalization or external-solver-superiority claim.

Historical 11,520-answer verification and 3,840 checkpoint comparisons pass. Earlier development and pre-audit measurements remain retained; final raw evidence is generated/replayed by the new two-version trained-FP workflow. Local validation is not final-head CI completion. No main merge or release publication.
@tugrapaydiner tugrapaydiner changed the title Integrate final-only CPU execution with validated weights and ordered vector blocking Integrate faithful CPU execution: packed kernels and trained FP semantic exit Sep 12, 2026

Copy link
Copy Markdown
Owner Author

Final trained-FP delivery receipt — all ten workflows pass

Head: b28e01b85bd95b78f291e466c25c13bfa2fc5b46
Exact source tree: 0d00d6e01c5aca76e60bc6651a9d5ffdc90c00f7
Main: unchanged at 9fd6682345b34e992b3cab7e55750e9ef4b04e87; PR27 remains open and unmerged. No release or permissions change.

All 10 final-head workflows completed successfully: repository audit 34716324253, task-data 34716324259, CNF workload admission 34716324258, cached residuals 34716324283, public package 34716324271, native contracts 34716324260, trained FP 34716324295, earlier integrated runtime 34716324287, indexed efficiency 34716324255, and full CPU regression 34716324257. Earlier green heads are not being substituted.

Trained-task result and stronger control

Two existing accepted FP32 checkpoints, 256 distinct puzzle arrays from previously observed ordinary/shifted DEVELOPMENT surfaces, 512 model/puzzle cases. The new performance experiment does not execute confirmation/reserve surfaces; unchanged historical validation may replay previously recorded confirmation evidence without generating/selecting a new result.

Environment Prepared / existing native median ratio Speedup Prepared / matched-preparation eager ratio Speedup
Local EPYC 9V74 / Python 3.13.5 0.586054 [0.583107, 0.588916] 1.71x 0.641995 [0.637490, 0.646411] 1.56x
CI EPYC 7763 / Python 3.11.16 0.513490 [0.511877, 0.515025] 1.95x 0.569079 [0.567408, 0.570905] 1.76x
CI EPYC 7763 / Python 3.13.15 0.532800 [0.530976, 0.534534] 1.88x 0.590297 [0.588140, 0.592519] 1.69x

Ratios are sums of per-case medians. Intervals are conditional paired problem-cluster bootstraps retaining both fixed checkpoints, not population-level or cross-host intervals. Warm complete solve starts from a pretokenized input; it includes fresh checker/state, input embedding, recurrence, decoding/checking and returned work. JIT loading/compilation, model preparation, input-tensor construction and the additional external audit are separate.

All neural paths preserve 478/512 valid outcomes, every answer, depth and work dictionary. These FP checkpoints already achieved those outcomes; this is NOT an accuracy increase from the earlier packed fixture benchmark. The packed and FP paths are different formats; their speedups do not multiply. The symbolic solver still achieves 512/512 and is faster. Local charged time per verified answer, including failed attempts: native 0.845 ms, prepared 0.507 ms, symbolic 0.104 ms.

Each final measurement environment retains 14,336 primary calls + 7,168 stronger-control calls, with 2,048 primary execution replays, 2,048 full-budget recurrent-step replays, and 1,024 stronger-control execution replays. Every within-environment check passes. No per-case median regressions occur. Local empirical P95 regressions remain 12 primary / 23 control; CI Python3.11 has 0 / 1, Python3.13 0 / 0. Seven repetitions do not establish production-tail guarantees. No failed row was removed.

Tests, installation, preservation and independent audits

The exact final tree passes 1,532 fast tests locally and in both full CPU CI environments. Sixteen historical slow tests are deselected, not counted as passes; the 136 new tests are included in the total. Each new trained-FP CI environment separately passes all 136 focused tests, 11 dependency-free installed-wheel checks, and fresh native compilation/execution from an isolated installed wheel. Final wheel source audit matches 126 packaged source members to the checkout, including all three new runtime/analysis/C++ members.

Both trained-FP CI ZIPs were downloaded and verified against their GitHub SHA256 values, ZIP CRC and all 578 source-member bytes. Their source trees equal the pushed final tree (CI synthetic merge commit 011762bb2536ddc0e446647f1b345140f9be639b). Full CPU CI artifacts were also downloaded/checked: both contain 1,532 passing test receipts, retained-answer checks, checkpoint/fixed-pool/restart/controller/SAT replays. Thirty controller refits and 8,192 complete follow-up comparisons pass on each host, without changing the prior failed failure-information gate.

The independent standard-library audit checks every original-clue answer, full case/arm/round/order coverage, strict counter types, complete repeated work records, median ratios and charged-time arithmetic without importing the benchmark analysis. Earlier development/pre-audit runs and frozen source snapshots remain retained. The full historical check still verifies 11,520 stored answers and 3,840 checkpoint comparisons with zero mismatches.

Relative to previous branch head 8c1abb3, 565/567 original files are byte-identical; only two documentation navigation files change and eleven new files are added. Historical implementations, configurations, tests and raw evidence remain unchanged.

Strict portability failure — retained, not waived

Both CI artifacts pass their own strict trajectory replay. Replaying their stored internal-state hashes on local EPYC9V74 fails strict bitwise matching. The complete separate diagnosis confirms candidate/reference equality within the local environment on all 512 cases/2,048 steps; against each CI archive all 512 trajectory hashes and 2,048 combined-step hashes differ, while embedding hashes match. Across 2,048 complete-arm comparisons per archive there are zero decoded-answer, validity or work differences. CI3.11 and CI3.13 trajectory hashes match each other. Both failed strict logs and the full diagnostic are retained; the verifier was not weakened. No cross-hardware bitwise guarantee or numerical-difference magnitude bound is claimed.

Setup and scope

Fresh native compilation plus preparation takes 49.84 seconds locally, about 41.22/41.25 seconds in CI. The separate cached-library preparation break-even is approximately 1,193 local calls, not a cold-compiler break-even or first-call speedup. Owned tensor payload is 206,620 bytes per model, not peak RSS; retained source models duplicate storage. No memory/energy advantage or new learned/generalization/classical-solver-superiority claim.

Delivered files

The accompanying ChatGPT delivery provides SPECTRA_trained_FP_b28e01b_source_and_evidence.zip and SPECTRA_trained_FP_b28e01b_REPORT.md. This is not a GitHub release. The bundle includes complete current source, delta patch, final and earlier measurements, original trained-FP CI ZIPs, selected full CPU validation receipts, installation logs, independent auditors, strict failures and diagnosis. Duplicate CPU source archives are byte-identical to the source members retained in the trained-FP ZIPs; deduplication receipts identify them. Disposable venvs/build caches are omitted, not scientific observations.

  • Bundle: 165,865,149 bytes; SHA256 1310cfe904fb368caef9d431c570b7041816ab3f73aaf9e44bb2282605a7f8c7.
  • Complete source archive SHA256: c224c294c5ab21a644ed065e2b878c0343631457fcacf47a5624460d2cf029d1.
  • Report SHA256: 0db5d4030d68b6eed0070fe4210533b13ad530b0a165d50bc77db7ef1eaa9f62.
  • ZIP CRC and every one of 213 delivered payload-member hashes/sizes pass verification.

The branch implementation and final-head validation are complete. Main is intentionally unchanged.

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