pub struct MicroLoRA { /* private fields */ }Expand description
Micro-LoRA for per-request adaptation
Uses rank 1-2 for ultra-low latency updates. Forward pass: output += scale * (input @ down) @ up
Performance notes (from benchmarks):
- Rank-2 is ~5% faster than Rank-1 due to better SIMD vectorization
- Batch size 32 optimal: 0.447ms per-vector, 2,236 ops/sec throughput
- SIMD-enabled: +10% speedup over scalar
Implementations§
Source§impl MicroLoRA
impl MicroLoRA
Sourcepub fn forward_scalar(&self, input: &[f32], output: &mut [f32])
pub fn forward_scalar(&self, input: &[f32], output: &mut [f32])
Scalar forward pass (fallback)
Sourcepub fn forward(&self, input: &[f32], output: &mut [f32])
pub fn forward(&self, input: &[f32], output: &mut [f32])
Forward pass with automatic SIMD detection
Sourcepub fn accumulate_gradient(&mut self, signal: &LearningSignal)
pub fn accumulate_gradient(&mut self, signal: &LearningSignal)
Accumulate gradient from learning signal
Sourcepub fn apply_accumulated(&mut self, learning_rate: f32)
pub fn apply_accumulated(&mut self, learning_rate: f32)
Apply accumulated gradients with learning rate
Get hidden dimension
Sourcepub fn param_count(&self) -> usize
pub fn param_count(&self) -> usize
Get parameter count
Sourcepub fn pending_updates(&self) -> usize
pub fn pending_updates(&self) -> usize
Get pending update count
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MicroLoRA
impl<'de> Deserialize<'de> for MicroLoRA
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MicroLoRA
impl RefUnwindSafe for MicroLoRA
impl Send for MicroLoRA
impl Sync for MicroLoRA
impl Unpin for MicroLoRA
impl UnwindSafe for MicroLoRA
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more