Expand description
MicroLoRA WASM - Ultra-fast Low-Rank Adaptation for Edge AI
This crate provides rank-2 LoRA (Low-Rank Adaptation) matrices optimized for WASM execution with <100us adaptation latency. Designed for real-time per-operator-type learning in query optimization systems.
§Key Features
- Rank-2 LoRA: Minimal parameter count (2d parameters per adapter)
- Per-Operator Scoping: Separate adapters for different operator types
- <100us Adaptation: Instant weight updates for real-time learning
- WASM-Optimized: no_std compatible, minimal allocations
§Architecture
Input Embedding (d-dim)
|
v
+---------+
| A: d x 2 | Down projection
+---------+
|
v
+---------+
| B: 2 x d | Up projection
+---------+
|
v
Delta W = alpha * (A @ B)
|
v
Output = Input + Delta WStructs§
- LoRA
Config - Configuration for MicroLoRA
- LoRA
Pair - A single LoRA adapter pair (A and B matrices)
- Micro
LoRA Engine - Main MicroLoRA engine managing multiple LoRA pairs
- Scoped
LoRA - Scoped LoRA manager with per-operator-type adapters
- Trajectory
- A single trajectory recording
- Trajectory
Buffer - Ring buffer for trajectory storage
- Trajectory
Stats - Statistics for a collection of trajectories
- Wasm
Micro LoRA - WASM-exposed MicroLoRA engine
- Wasm
Scoped LoRA - WASM-exposed Scoped LoRA manager
Enums§
- Operator
Scope - Operator types for scoping (matches ruvector-dag OperatorType)