Repository navigation
CROSS 3.0.0
This release brings the public repository up to the v3 tree (jaxite_word.__version__ == "3.0.0") in one release commit on top of v2.0.0 (69c46d2), plus the fixes from a full validation pass on an eight-chip TPU v6e host. It supersedes the reverted #2.
Scope
Only the library, demos, documentation and test configuration are included: jaxite_word/ (library, tests, perf tests, artifact scripts, API_REFERENCE.md), demos/ (the canonical pipeline, the four demos, trainers and tests), README.md, profile_analysis/, pytest.ini and .gitignore. Eight v2 modules superseded by the reorganized kernels are removed (add, sub, matvec, ciphertext and their tests). Not included, to keep the PR to the logic changes: the reference OpenFHE sources and security probe (openfhe_ref_code/), and the notebook and figure updates under figure_drawer/ (the notebook had grown to 5.5 MB of embedded outputs).
What v3 adds over v2
- Compiler-style deployment path. A model enters once as an ordinary
torch.nn.Moduleand crosses four owners:nn.vectorize(torch.fx trace, one vectorization template per layer, polynomial activation),packing.pack(global slot-layout reconciliation, the PP-op DAG with its constants, and a 128-bit-secureRingConfigderived from the program's own slot demand and depth),Mapping(levels, scales, noise, BSGS plans, keys, controls, device placement, one AOT-compiled executable) andCKKSContext(codec, primitives, operators). Serving ismapping.infer(x)ormapping.execute(ciphertext). - Device-parallel batches inside one executable. A global batch
BonDchips is splitB/Dper chip; the public ciphertext boundary stays a rank-5Polynomial. - New Montgomery reduction support. Montgomery reduction is now a first-class backend across the stack, selectable per operator beside Barrett:
MontgomeryContextfor modular arithmetic,NTTCiphertextMontgomeryContextfor the NTT,BConvMontgomeryand the Montgomery-BAT basis conversion, and Montgomery paths for HEAdd/HESub, PtCt multiply, Rescale, HEMul and HERot. Ciphertexts stay in the backend's representation during evaluation, with explicit exactly-once conversions at encryption, ModRaise, key setup and decryption. On TPU v6e it is the faster backend for every operator measured (HEMul 3.99 ms vs 4.69 ms Barrett; Rescale 607 µs vs 774 µs; HEAdd 36 µs vs 69 µs; modular multiply over 51 moduli 74 µs vs 87 µs), andbootstrapping_montgomery_test.pygates bit-canonical parity of a full N=256 bootstrap between the two backends. - Reorganized HE kernels and operators with per-level operator caches and CKKS bootstrapping matched to OpenFHE (N=256 parity gates, opt-in larger rings).
- Four encrypted demos on the canonical path (LoLA, LeNet, AlexNetTiny, AlexNetFull) with an asset script that downloads MNIST/CIFAR-10 and trains the checkpoints, plus HPCA'26 artifact scripts (
tabV,tabVI,tabVII,tabIX) and a Barrett-vs-Montgomery bootstrap parity gate.
Fixes from the TPUv6e-8 validation pass (from the CROSS_dev branch v3.0.0-release-fixes)
Mapping.release(): a materialized Mapping kept its HBM after its Python reference was dropped, because JAX's tracing caches hold the compiled program's closure and, through it, the Mapping with its captured keys and constants.release()drops the executable and bindings, evicts theid(ctx)-keyed codec caches (ckks_ctx.evict_context_caches), clears the JAX caches and marks the Mapping unusable; a build that fails part-way now discards its traced program.CanonicalDemo.release()and the demo adapters delegate to it.LeNetRegressionTestkeeps one resident model at a time (three resident models plus a build exhausted the 32 GiB HBM of one chip); the LoLA, LeNet and AlexNet performance gates release their models when done.nn_test.pyandmapping_compile_test.pyfailed at import when launched the documented way from insidejaxite_word/; both now put the repository root onsys.path.profiler.write_resultsmerges results on the union of columns instead of appending rows under a stale header.tabVII.pyskips sharded NTT batches that cannot fit 32 GiB HBM with a printed reason instead of a swallowedRESOURCE_EXHAUSTED;tabV.pyre-enables its vectorized baseline (BAT 1.63× at 2048³, no gain at launch-bound small shapes).- Release hygiene from a pre-publication audit: the demos import the library through a
sys.pathshim so every demo and test runs fromdemos/with noPYTHONPATHas documented; README install and API samples match the code (torch for the demos, rank-5Polynomialboundary,rescale(), two-argument plaintextmul, real test-file names,source tabVIII.sh); demos README commands name existing test classes and its pre-unification tables are marked historical; a straycursesimport and two leftover comments are gone; accidental executable bits cleared; the MIT LICENSE is tracked.
Validation on TPU v6e-8 (8 × TPU v6 lite, JAX 0.11.1, Python 3.13)
Every *_test.py and *_perf_test.py in the tree was executed serially, one process on the slice at a time.
| suite | files | cases | result |
|---|---|---|---|
| library functional tests | 29 | 654 | all pass (4 opt-in skips) |
| demo functional tests | 10 | 271 | all pass (3 opt-in skips) |
| kernel performance tests | 11 | 70 | all pass |
| artifact scripts (tabV, tabVI, tabVII, tabIX, bootstrap sweep) | 5 | 187 | all pass |
| encrypted model gates (LoLA, LeNet, AlexNetTiny; B=1, B=8, B=32, B=64) | 8 runs | — | all pass after the fixes |
Headline numbers, warm, 128-bit rings:
| workload | result |
|---|---|
| LoLA B=1 / B=32 (8 chips × 4) | 566 ms / 397 ms per image, all argmax match cleartext |
| LeNet B=1 / B=32 / B=64 (8 × 8), trained MNIST weights | 714 / 475 / 475 ms per image, 200/200 HE argmax = cleartext |
| AlexNetTiny B=1 / B=32 / B=8-on-8 | 662 / 463 / 458 ms per image |
| HEMul (degree 65536, 51 limbs) | 3.99 ms one chip; per-shard 3.91 ms with a batch of 8 over 8 chips (7.6× throughput) |
| NTT degree 65536, 48 limbs, batch 8 | 1.88 ms one chip → 318 µs sharded over 8 |
| BAT basis conversion | fastest in 9 of 10 configurations, up to 7.6× over the default path |
Known, documented gaps: the PtCt BAT path is ~2,400× slower than the VPU path (the VPU path is what Mapping uses); AlexNetFull has no TPU inference entrypoint at degree 65536; N=4096/N=8192 bootstrap gates remain opt-in.
Suggested release steps after merge
- Tag
v3.0.0onmainand publish a GitHub release (previous releases:v2.0.0,v1.0.1); the earlierv3.0.0tag that pointed at the reverted merge was removed. - Delete the
release-v3.0.0branch.