The ultimate hardware rebellion. Train heavy 1.58-bit models fast on consumer CPUs with microscopic RAM budgets. Break the VRAM crisis and high-end hardware monopoly.
NexaQuant isn't just an engine. It's a technological coup led by Nexa1nc.
While standard AI training requires enterprise-grade GPUs (A100/H100) and hundreds of gigabytes of RAM, NexaQuant v3.0 completely redefines the game. We make training and fine-tuning highly intelligent ternary (1.58-bit) networks fully possible and blazing fast on standard consumer CPUs and extremely small RAM budgets (down to 128MB or less!).
+-----------------------------------------------------------------------------------+
| NEXAQUANT CORE |
+----------------------------------------+------------------------------------------+
| TRAINING ENGINE (v3.0) | INFERENCE ENGINE (v2.0) |
+----------------------------------------+------------------------------------------+
| - Stochastic Integer Accumulators | - M3 VRAM Memory Virtualization |
| - Cache-Conscious 32x32 Tiled GEMM | - Compile-Free Dynamic OpenCL Engine |
| - 80% RAM Saved via Checkpointing | - Zero-Branching Ternary GPU Kernel |
| - Microscopic Bit-Level Sign-SGD | - Seamless AVX2/FMA CPU Fallback |
+----------------------------------------+------------------------------------------+
- The Problem: Traditional ternary training still requires keeping high-precision FP32 weights (4 bytes per parameter) in RAM to accumulate tiny decimal gradient steps.
-
Our Revolution: We eliminate FP32 latent weights completely! NexaQuant maintains 16-bit integer accumulators (
int16_t) to track gradient directions. Pesi ternari ($\pm 1, 0$ ) trigger only when accumulators cross dynamic thresholds. - Impact: 50-75% weight memory reduction in RAM, trading expensive floating-point arithmetic for ultra-fast integer math!
- The Problem: Modern CPUs waste up to 90% of execution time waiting for data to travel from slow system RAM (memory latency bottleneck).
-
Our Revolution: Forward and backward pass matrix multiplications are divided into micro-tasselli (Tiled blocks of
$32 \times 32$ ). Active blocks reside fully inside the ultra-fast L1/L2 cache of the target physical CPU core. - Impact: 3x to 5x computation speedup, saturating FMA CPU pipelines.
- Our Revolution: Discards intermediate activation tensors during the forward pass and recomputes them locally on-the-fly during the backward pass.
- Impact: Reduces peak activation RAM consumption by up to 80%!
- Our Revolution: Tracks optimizer momentum at the single-bit sign level, reducing optimizer state overhead by up to 95% compared to traditional FP32 Adam.
NexaQuant includes a rigorous, compile-free automated verification suite (tests.cpp) to prove the mathematical correctness of our training and inference engines.
It automatically verifies:
-
AVX2/FMA Math Precision: Computes and compares optimized SIMD GEMM against raw sequential C++ float math (delivers down to a
$10^{-6}$ precision delta). - M3 LRU Cache Eviction: Mocks memory limits and asserts that layer swapping operates successfully.
- v3.0 Stochastic Training Convergence: Mocks a deep ternary network and asserts that losses steadily decrease using integer accumulators.
To run the automated tests:
bash build_and_test.shEnsure you have C++ compilation tools installed:
sudo apt update
sudo apt install build-essential python3Execute the build and run script:
bash build_and_test.shCompile using MinGW-w64 (GCC) with AVX2 instruction flags enabled:
g++ -O3 -mavx2 -mfma main.cpp -o nexa_bench.exe -lpthreadRuns a live demonstration training session of a 3-layer deep ternary network, displaying epoch logs, Dynamic Weight Distribution, and memory savings:
./nexa_bench --trainBenchmark multi-model concurrent inference within a strict VRAM budget (e.g., 10MB VRAM):
python3 create_test_suite.py
./nexa_benchRun prompt-response inference on any downloaded GGUF file:
./nexa_bench --v1 model.gguf- Thread Allocation: Set threads to match physical cores instead of hyperthreaded logical cores to avoid cache thrashing.
- GPU Activation (Inference): Install standard OpenCL ICD loaders on Linux to activate dynamic GPU compilation:
sudo apt install ocl-icd-libopencl1
NexaQuant is licensed under the GNU AGPL v3.
- Why AGPL? We believe in AI democracy. If you build upon NexaQuant or serve it on the cloud, you must contribute your improvements back to the community under the same open conditions.
- Commercial Licensing: If you need corporate integration or private commercial licenses to bypass AGPL limits, private licenses are available. Contact Nexa1nc for custom integration, corporate support, and custom licensing terms.
Developed by Nexa1nc with the philosophy of extreme, hardware-level optimization.