|
Download README.md from eightb/README: direct link, hf CLI and curl.
- Browser
- Download file 5.49 kB
-
https://huggingface.co/spaces/eightb/README/resolve/main/README.md
- Command line
-
hf download hf://spaces/eightb/README/README.md
-
curl -L -o README.md https://huggingface.co/spaces/eightb/README/resolve/main/README.md
5.49 kB
| tags: | |
| - rust | |
| - quantization | |
| - ternary | |
| - bitnet | |
| - ggml | |
| - simd | |
| - lora | |
| - finetuning | |
| - edge-ai | |
| license: mit | |
| library_name: smart-tree | |
| # π§ eightb β Eight-Bit Intelligence Systems | |
| <p align="center"> | |
| <img src="https://img.shields.io/badge/rust-%23dea584.svg?logo=rust&logoColor=white"/> | |
| <img src="https://img.shields.io/badge/webassembly-654FF0?logo=webassembly&logoColor=white"/> | |
| <img src="https://img.shields.io/badge/mlx-ECEEF1?logo=apple&logoColor=black"/> | |
| </p> | |
| **Ultra-low precision neural networks β’ Quantization-native architectures β’ Edge-first inference** | |
| --- | |
| ## Philosophy | |
| Modern LLMs are bloated. We believe intelligence doesn't need FP32βor even FP16. By designing **from the ground up for ternary (-1, 0, +1) and low-bit representations**, we unlock: | |
| | Precision | Storage | MAC Energy | Typical Quality | | |
| |-----------|---------|------------|-----------------| | |
| | BF16 | 2Γ | 1Γ | Baseline | | |
| | INT8 | ΒΌΓ | ~β Γ | Near-baseline | | |
| | **INT2/I2_S** | **β Γ** | **~ΒΉβββΓ** | **Surprisingly good** | | |
| Our flagship: **BitNet 1.58-bit** β ternary weights trained straight-through estimator, no distillation tax. | |
| --- | |
| ## Repositories | |
| | Repo | Description | Status | | |
| |------|-------------|--------| | |
| | [`smart-tree`](https://huggingface.co/eightb/smart-tree) | SIMD-accelerated ternary inference engine (ARM NEON / AVX2 / WASM) | β Active | | |
| | [`enthea`](https://github.com/peterlodri-sec/enthea) | Pure-Rust quantized linear algebra: GEMM, attention, MoE routing | β Active | | |
| | [`felix-assembly`](https://github.com/peterlodri-sec/felix-assembly) | CPU-agnostic FELIX ISA for portable SIMD kernels | π¬ Experimental | | |
| | [`quantlab`](https://github.com/peterlodri-sec/quantlab) | Automated quantization search: Pareto-Q, KD pipelines, RL tuning | π§ Building | | |
| --- | |
| ## Quick Start: `smart-tree` Binary | |
| ```bash | |
| # Download latest release | |
| curl -LO https://huggingface.co/eightb/smart-tree/resolve/main/st | |
| chmod +x st | |
| # Validate GGUF I2_S (Falcon3-3B-I2_S compatible) | |
| ./st gguf validate | |
| # Convert BitNetWave64 β I2_S hex | |
| ./st gguf convert --wave DEADBEEFDEADBEEF:FEEDFACEFEEDFACE | |
| # Inspect GGUF for ternary tensors | |
| ./st gguf inspect --file falcon3-3b-i2s.gguf | |
| ``` | |
| ### As Library | |
| ```toml | |
| [dependencies] | |
| smart-tree = { git = "https://github.com/peterlodri-sec/smart-tree" } | |
| ``` | |
| ```rust | |
| use smart_tree::{BitNetWave64, gguf_interop::{I2SPacker, GgufI2SBridge}, | |
| simd_ternary::{simd_ternary_gemm_i2s, simd_backend}, | |
| lora_ternary::{lorat_qwen2_5_05b, LoraTTrainer, LoraTConfig}}; | |
| // Pack ternary weights to GGUF I2_S format | |
| let packed = I2SPacker::pack_trits(&[-1, 0, 1, 0, -1, 1]); | |
| // Full Wave64 β I2_S roundtrip | |
| let i2s_bytes = GgufI2SBridge::wave64_to_i2s(&wave)?; | |
| let recovered = GgufI2SBridge::i2s_to_wave64(&i2s_bytes)?; | |
| // SIMD-accelerated GEMM | |
| println!("Backend: {}", simd_backend()); // "NEON (AArch64)" on Apple Silicon | |
| simd_ternary_gemm_i2s(&weights_i2s, rows, cols, &acts, &mut out, scales); | |
| // LoRA-T fine-tuning | |
| let mut model = lorat_qwen2_5_05b(LoraTConfig { rank: 16, ..Default::default() }); | |
| let mut trainer = LoraTTrainer::new(&mut model, 1e-4); | |
| // ... training loop ... | |
| ``` | |
| --- | |
| ## Architecture Highlights | |
| ### Ternary Bridge (Lossless) β Experiment 1 β | |
| ``` | |
| BF16 βββΊ INT8 ββββ | |
| FP8(E4M3)βββββββββΌββΊ TERNARY {-1,0,+1} βββΊ I2_S (GGUF type 36) | |
| FP8(E5M2)βββββββββ | |
| ``` | |
| Zero-copy conversions with exact arithmetic guarantees. | |
| ### GGUF Native I2_S Support β Experiment 2 β | |
| First-class support for `quantization_type = 36 (I2_S)`: | |
| - MSB-first 4-trits/byte (Bits 6-7, 4-5, 2-3, 0-1) | |
| - Embedded/scales/env-configurable dequantization | |
| - Falcon3, BitNet.cpp, llama.cpp compatible | |
| ### SIMD Kernels β Experiment 3 β | |
| - **ARM64 NEON**: 8-lane vectorized, `vld1q_s16` + `vmull` + `vpadal` | |
| - **AVX2**: 8-lane `VPBLENDVB` mask blend, `VPMADDWD` horizontal sum | |
| - **Scalar fallback**: Branch-free, predictable latency | |
| - Integrated FELIX sovereign assembly engine | |
| ### LoRA-T Fine-Tuning β Experiment 4 β | |
| - **Freeze** pretrained ternary weights (I2_S / BitNetWave64) | |
| - **Inject** trainable low-rank adapters (A @ B) in FP32 | |
| - **Forward**: `y = W_ternary @ x + Ξ± * (A @ B) @ x` | |
| - **Gradient** flows only through A, B (ranks 8-64) | |
| - **Fusion** for zero-overhead inference deployment | |
| - Factories for Qwen2.5-0.5B, custom transformers | |
| --- | |
| ## Roadmap | |
| - [x] **Experiment 1**: Ternary β INT8/FP8/E4M3/E5M2 Lossless Bridge | |
| - [x] **Experiment 2**: GGUF I2_S (type 36) Interop | |
| - [x] **Experiment 3**: ARM64 NEON / AVX2 SIMD kernels for ternary GEMM | |
| - [x] **Experiment 4**: QLoRA-style ternary fine-tuning (LoRA-T) | |
| - [ ] **Experiment 5**: Mixed-precision profiler (layer-wise sensitivity) | |
| - [ ] **Experiment 6**: Residual injection scheduler (dynamic precision) | |
| - [ ] **Experiment 7**: Pareto-Q sequential allocator | |
| - [ ] **Experiment 8**: KD pipeline teacherβstudent (ternary) | |
| - [ ] **Experiment 9**: BITCOS cosine similarity retrieval | |
| --- | |
| ## Community | |
| - Discord: coming soon | |
| - Issues: [GitHub](https://github.com/peterlodri-sec/smart-tree/issues) | |
| - Papers: See [`SCIENCE.md`](https://github.com/peterlodri-sec/enthea/blob/main/SCIENCE.md) | |
| --- | |
| ## License | |
| MIT OR Apache-2.0 β Choose your adventure. | |
| --- | |
| <div align="center"> | |
| **"Eight bits ought to be enough for anybody"** β *Probably not Bill Gates* | |
| Built with β€οΈ by the eightb collective | |
| </div> |