Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -6,6 +6,8 @@ tags:
|
|
| 6 |
- bitnet
|
| 7 |
- ggml
|
| 8 |
- simd
|
|
|
|
|
|
|
| 9 |
- edge-ai
|
| 10 |
license: mit
|
| 11 |
library_name: smart-tree
|
|
@@ -75,7 +77,8 @@ smart-tree = { git = "https://github.com/peterlodri-sec/smart-tree" }
|
|
| 75 |
|
| 76 |
```rust
|
| 77 |
use smart_tree::{BitNetWave64, gguf_interop::{I2SPacker, GgufI2SBridge},
|
| 78 |
-
simd_ternary::{simd_ternary_gemm_i2s, simd_backend}
|
|
|
|
| 79 |
|
| 80 |
// Pack ternary weights to GGUF I2_S format
|
| 81 |
let packed = I2SPacker::pack_trits(&[-1, 0, 1, 0, -1, 1]);
|
|
@@ -87,6 +90,11 @@ let recovered = GgufI2SBridge::i2s_to_wave64(&i2s_bytes)?;
|
|
| 87 |
// SIMD-accelerated GEMM
|
| 88 |
println!("Backend: {}", simd_backend()); // "NEON (AArch64)" on Apple Silicon
|
| 89 |
simd_ternary_gemm_i2s(&weights_i2s, rows, cols, &acts, &mut out, scales);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
```
|
| 91 |
|
| 92 |
---
|
|
@@ -113,6 +121,14 @@ First-class support for `quantization_type = 36 (I2_S)`:
|
|
| 113 |
- **Scalar fallback**: Branch-free, predictable latency
|
| 114 |
- Integrated FELIX sovereign assembly engine
|
| 115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
---
|
| 117 |
|
| 118 |
## Roadmap
|
|
@@ -120,7 +136,7 @@ First-class support for `quantization_type = 36 (I2_S)`:
|
|
| 120 |
- [x] **Experiment 1**: Ternary ↔ INT8/FP8/E4M3/E5M2 Lossless Bridge
|
| 121 |
- [x] **Experiment 2**: GGUF I2_S (type 36) Interop
|
| 122 |
- [x] **Experiment 3**: ARM64 NEON / AVX2 SIMD kernels for ternary GEMM
|
| 123 |
-
- [
|
| 124 |
- [ ] **Experiment 5**: Mixed-precision profiler (layer-wise sensitivity)
|
| 125 |
- [ ] **Experiment 6**: Residual injection scheduler (dynamic precision)
|
| 126 |
- [ ] **Experiment 7**: Pareto-Q sequential allocator
|
|
|
|
| 6 |
- bitnet
|
| 7 |
- ggml
|
| 8 |
- simd
|
| 9 |
+
- lora
|
| 10 |
+
- finetuning
|
| 11 |
- edge-ai
|
| 12 |
license: mit
|
| 13 |
library_name: smart-tree
|
|
|
|
| 77 |
|
| 78 |
```rust
|
| 79 |
use smart_tree::{BitNetWave64, gguf_interop::{I2SPacker, GgufI2SBridge},
|
| 80 |
+
simd_ternary::{simd_ternary_gemm_i2s, simd_backend},
|
| 81 |
+
lora_ternary::{lorat_qwen2_5_05b, LoraTTrainer, LoraTConfig}};
|
| 82 |
|
| 83 |
// Pack ternary weights to GGUF I2_S format
|
| 84 |
let packed = I2SPacker::pack_trits(&[-1, 0, 1, 0, -1, 1]);
|
|
|
|
| 90 |
// SIMD-accelerated GEMM
|
| 91 |
println!("Backend: {}", simd_backend()); // "NEON (AArch64)" on Apple Silicon
|
| 92 |
simd_ternary_gemm_i2s(&weights_i2s, rows, cols, &acts, &mut out, scales);
|
| 93 |
+
|
| 94 |
+
// LoRA-T fine-tuning
|
| 95 |
+
let mut model = lorat_qwen2_5_05b(LoraTConfig { rank: 16, ..Default::default() });
|
| 96 |
+
let mut trainer = LoraTTrainer::new(&mut model, 1e-4);
|
| 97 |
+
// ... training loop ...
|
| 98 |
```
|
| 99 |
|
| 100 |
---
|
|
|
|
| 121 |
- **Scalar fallback**: Branch-free, predictable latency
|
| 122 |
- Integrated FELIX sovereign assembly engine
|
| 123 |
|
| 124 |
+
### LoRA-T Fine-Tuning — Experiment 4 ✅
|
| 125 |
+
- **Freeze** pretrained ternary weights (I2_S / BitNetWave64)
|
| 126 |
+
- **Inject** trainable low-rank adapters (A @ B) in FP32
|
| 127 |
+
- **Forward**: `y = W_ternary @ x + α * (A @ B) @ x`
|
| 128 |
+
- **Gradient** flows only through A, B (ranks 8-64)
|
| 129 |
+
- **Fusion** for zero-overhead inference deployment
|
| 130 |
+
- Factories for Qwen2.5-0.5B, custom transformers
|
| 131 |
+
|
| 132 |
---
|
| 133 |
|
| 134 |
## Roadmap
|
|
|
|
| 136 |
- [x] **Experiment 1**: Ternary ↔ INT8/FP8/E4M3/E5M2 Lossless Bridge
|
| 137 |
- [x] **Experiment 2**: GGUF I2_S (type 36) Interop
|
| 138 |
- [x] **Experiment 3**: ARM64 NEON / AVX2 SIMD kernels for ternary GEMM
|
| 139 |
+
- [x] **Experiment 4**: QLoRA-style ternary fine-tuning (LoRA-T)
|
| 140 |
- [ ] **Experiment 5**: Mixed-precision profiler (layer-wise sensitivity)
|
| 141 |
- [ ] **Experiment 6**: Residual injection scheduler (dynamic precision)
|
| 142 |
- [ ] **Experiment 7**: Pareto-Q sequential allocator
|