PeetPedro commited on
Commit
ce2708c
Β·
verified Β·
1 Parent(s): 6c0d83d

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +144 -0
README.md ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - rust
4
+ - quantization
5
+ - ternary
6
+ - bitnet
7
+ - ggml
8
+ - simd
9
+ - edge-ai
10
+ license: mit
11
+ library_name: smart-tree
12
+ ---
13
+
14
+ # 🧠 eightb β€” Eight-Bit Intelligence Systems
15
+
16
+ <p align="center">
17
+ <img src="https://img.shields.io/badge/rust-%23dea584.svg?logo=rust&logoColor=white"/>
18
+ <img src="https://img.shields.io/badge/cloudflare-F38020?logo=cloudflare&logoColor=white"/>
19
+ <img src="https://img.shields.io/badge/webassembly-654FF0?logo=webassembly&logoColor=white"/>
20
+ <img src="https://img.shields.io/badge/mlx-ECEEF1?logo=apple&logoColor=black"/>
21
+ </p>
22
+
23
+ **Ultra-low precision neural networks β€’ Quantization-native architectures β€’ Edge-first inference**
24
+
25
+ ---
26
+
27
+ ## Philosophy
28
+
29
+ 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:
30
+
31
+ | Precision | Storage | MAC Energy | Typical Quality |
32
+ |-----------|---------|------------|-----------------|
33
+ | BF16 | 2Γ— | 1Γ— | Baseline |
34
+ | INT8 | ΒΌΓ— | ~β…“Γ— | Near-baseline |
35
+ | **INT2/I2_S** | **β…›Γ—** | **~¹⁄₁₂×** | **Surprisingly good** |
36
+
37
+ Our flagship: **BitNet 1.58-bit** β€” ternary weights trained straight-through estimator, no distillation tax.
38
+
39
+ ---
40
+
41
+ ## Repositories
42
+
43
+ | Repo | Description | Status |
44
+ |------|-------------|--------|
45
+ | [`smart-tree`](https://huggingface.co/eightb/smart-tree) | SIMD-accelerated ternary inference engine (ARM NEON / AVX2 / WASM) | βœ… Active |
46
+ | [`enthea`](https://github.com/peterlodri-sec/enthea) | Pure-Rust quantized linear algebra: GEMM, attention, MoE routing | βœ… Active |
47
+ | [`felix-assembly`](https://github.com/peterlodri-sec/felix-assembly) | CPU-agnostic FELIX ISA for portable SIMD kernels | πŸ”¬ Experimental |
48
+ | [`quantlab`](https://github.com/peterlodri-sec/quantlab) | Automated quantization search: Pareto-Q, KD pipelines, RL tuning | 🚧 Building |
49
+
50
+ ---
51
+
52
+ ## Quick Start: `smart-tree` Binary
53
+
54
+ ```bash
55
+ # Download latest release
56
+ curl -LO https://huggingface.co/eightb/smart-tree/resolve/main/st
57
+ chmod +x st
58
+
59
+ # Validate GGUF I2_S (Falcon3-3B-I2_S compatible)
60
+ ./st gguf validate
61
+
62
+ # Convert BitNetWave64 β†’ I2_S hex
63
+ ./st gguf convert --wave DEADBEEFDEADBEEF:FEEDFACEFEEDFACE
64
+
65
+ # Inspect GGUF for ternary tensors
66
+ ./st gguf inspect --file falcon3-3b-i2s.gguf
67
+ ```
68
+
69
+ ### As Library
70
+
71
+ ```toml
72
+ [dependencies]
73
+ smart-tree = { git = "https://github.com/peterlodri-sec/smart-tree" }
74
+ ```
75
+
76
+ ```rust
77
+ use smart_tree::{BitNetWave64, gguf_interop::{I2SPacker, GgufI2SBridge}};
78
+
79
+ // Pack ternary weights to GGUF I2_S format
80
+ let packed = I2SPacker::pack_trits(&[-1, 0, 1, 0, -1, 1]);
81
+
82
+ // Full Wave64 ↔ I2_S roundtrip
83
+ let i2s_bytes = GgufI2SBridge::wave64_to_i2s(&wave)?;
84
+ let recovered = GgufI2SBridge::i2s_to_wave64(&i2s_bytes)?;
85
+ ```
86
+
87
+ ---
88
+
89
+ ## Architecture Highlights
90
+
91
+ ### Ternary Bridge (Lossless)
92
+ ```
93
+ BF16 ──► INT8 ◄──┐
94
+ FP8(E4M3)◄───────┼─► TERNARY {-1,0,+1} ──► I2_S (GGUF type 36)
95
+ FP8(E5M2)β—„β”€β”€β”€β”€β”€β”€β”€β”˜
96
+ ```
97
+ Zero-copy conversions with exact arithmetic guarantees.
98
+
99
+ ### SIMD Kernels
100
+ - **ARM64 NEON**: 128-bit loads, `tbl` lut unpack, pairwise madd
101
+ - **AVX2**: VPBLENDVB mask blend, VPMADDWD horizontal sum
102
+ - **Scalar fallback**: Branch-free, predictable latency
103
+
104
+ ### GGUF Native
105
+ First-class support for `quantization_type = 36 (I2_S)`:
106
+ - MSB-first 4-trits/byte (Bits 6-7, 4-5, 2-3, 0-1)
107
+ - Embedded/scales/env-configurable dequantization
108
+ - Falcon3, BitNet.cpp, llama.cpp compatible
109
+
110
+ ---
111
+
112
+ ## Roadmap
113
+
114
+ - [ ] **Experiment 3**: ARM64 NEON / AVX2 SIMD kernels for ternary GEMM
115
+ - [ ] **Experiment 4**: QLoRA-style ternary fine-tuning (LoRA-T)
116
+ - [ ] **Experiment 5**: Mixed-precision profiler (layer-wise sensitivity)
117
+ - [ ] **Experiment 6**: Residual injection scheduler (dynamic precision)
118
+ - [ ] **Experiment 7**: Pareto-Q sequential allocator
119
+ - [ ] **Experiment 8**: KD pipeline teacher→student (ternary)
120
+ - [ ] **Experiment 9**: BITCOS cosine similarity retrieval
121
+
122
+ ---
123
+
124
+ ## Community
125
+
126
+ - Discord: coming soon
127
+ - Issues: [GitHub](https://github.com/peterlodri-sec/smart-tree/issues)
128
+ - Papers: See [`SCIENCE.md`](https://github.com/peterlodri-sec/enthea/blob/main/SCIENCE.md)
129
+
130
+ ---
131
+
132
+ ## License
133
+
134
+ MIT OR Apache-2.0 β€” Choose your adventure.
135
+
136
+ ---
137
+
138
+ <div align="center">
139
+
140
+ **"Eight bits ought to be enough for anybody"** β€” *Probably not Bill Gates*
141
+
142
+ Built with ❀️ by the eightb collective
143
+
144
+ </div>