Skip to content
Public template

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

9 Commits

Folders and files

Repository files navigation

ACAB-X: Adaptive Cellular Asynchronous Backpropagation

ACAB-X is a hardware-native, highly optimized training engine designed to train, fine-tune, or adapter-train massive large language models (7B to 120B+ parameters) on commodity consumer devices, workstations, and decentralized P2P clusters.


⚑ Core Innovations & Success Metrics

  • Weight Compression (Target: ≀ 1.6 bits): Implements block quantization achieving 1.125 bits/weight for Binary and 1.728 bits/weight for Ternary configurations.
  • Constant Activation Memory ($O(1)$): Replaces global backpropagation with Cellular Local Error Learning, immediately evicting intermediate activation graphs to guarantee flat memory growth regardless of model depth.
  • 8x Optimizer Compression: Saves 87.5% of state RAM by quantizing momentum and variance states to 4-bit (INT4) format in CompressedAdamW or using 0-state 1-bit SignSGD.
  • Dynamic Dual-Backend Dispatch: Automatically queries system accelerators. Runs custom compiled Rust SIMD/AVX kernels (CPU), vectorized PyTorch fallbacks, or native CUDA/Triton templates (e.g. for ASUS ROG Z13 GeForce GPU).
  • P2P Mesh Pipelining: Integrates with the Hyperspace Pods framework to pool distributed consumer compute shards and aggregate updates asynchronously using DiLoCo-style weight delta syncing.
  • Long-Context RoPE Scaling: Incorporates Linear and Dynamic NTK-aware position interpolation to extend context windows safely without retraining.

πŸ“‚ Project Structure

/ACAB-X
β”œβ”€β”€ runtime/
β”‚   β”œβ”€β”€ hardware_detector.py   # Accelerator, package, and compiler detection
β”‚   β”œβ”€β”€ backend_selector.py    # Runtime backend dispatch logic
β”‚   β”œβ”€β”€ quantizers.py          # Vectorized PyTorch/Rust fallback quantizers
β”‚   β”œβ”€β”€ cellular_layer.py      # Local learning & activation eviction wrapper
β”‚   └── hyperspace_bridge.py   # P2P Hyperspace Pod cluster sync client
β”œβ”€β”€ optimizers/
β”‚   └── compressed_optimizers.py # 4-bit CompressedAdamW & 1-bit SignSGD
β”œβ”€β”€ configs/
β”‚   β”œβ”€β”€ model_configs.py       # Modular profiles (7B - 120B) & memory estimates
β”‚   └── rope_scaling.py        # Long-context window RoPE scaler
β”œβ”€β”€ kernels/
β”‚   β”œβ”€β”€ src/lib.rs             # High-performance Rust CPU SIMD quantizers
β”‚   β”œβ”€β”€ cuda_kernels.cu        # CUDA template kernels (ASUS ROG Z13 target)
β”‚   └── Cargo.toml             # Cargo configuration (cdylib target)
β”œβ”€β”€ benchmarks/
β”‚   └── profile_engine.py      # Speed, memory, and scaling benchmark suite
└── tests/                     # Integrity unit tests

πŸš€ Quick Start

1. Detect System Hardware & Select Backend

Query your local device capabilities and automatically load the optimal compilation/runtime backend:

python -m runtime.backend_selector

2. Run Engine Performance Profile

Measure local quantization speeds, compute throughput, and visualize memory footprint projections for 7B-120B models:

python -m benchmarks.profile_engine

3. Run the Test Suites

Validate quantization precision, optimizer updates, context scaling, and P2P connection fallbacks:

python -m unittest discover tests/

πŸ”¬ Memory Scaling Projections

Below are the memory consumption requirements calculated by the engine for various scaling configurations:

Model Scale Weight Memory (GB) Std Optimizer (GB) Compressed Opt (GB) Std Activations (GB) Cellular Activations (GB)
7B 1.34 GB 53.60 GB 6.70 GB 2.15 GB 0.07 GB
13B 2.60 GB 104.00 GB 13.00 GB 3.36 GB 0.08 GB
34B 6.76 GB 270.40 GB 33.80 GB 6.44 GB 0.13 GB
70B 13.96 GB 558.40 GB 69.80 GB 10.74 GB 0.13 GB
120B 24.04 GB 961.60 GB 120.20 GB 16.78 GB 0.17 GB

Tip

By combining 1.6-bit weight quantization, 4-bit optimizers, and cellular activation eviction, a 120B parameter model requires only ~144.4 GB total memory during training (down from 1000+ GB standard), making training locally on unified memory consumer systems or small clusters fully feasible.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages