kizzasi-core
Core State Space Model (SSM) engine for Kizzasi AGSP.
Overview
High-performance SSM implementation with O(1) per-step inference, SIMD optimizations, and parallel processing. Provides the foundational building blocks for autoregressive signal prediction.
Features
- Selective SSM: Input-dependent state transitions with ZOH discretization
- Parallel Scan: O(log N) depth associative scan algorithm
- SIMD Operations: Vectorized dot products, matrix operations, and activations
- Memory Efficient: Array pooling and workspace management
- GPU Support: CUDA and Metal backends via candle
- Training: Full training infrastructure with gradient computation
- Numerical Stability: Kahan summation, safe exp/log, Welford variance
Quick Start
use ;
// Create SSM with 64-dimensional hidden state
let config = builder
.input_dim
.hidden_dim
.output_dim
.num_layers
.build?;
let mut ssm = new?;
// Single-step prediction (O(1) complexity)
let input = zeros;
let output = ssm.step?;
Performance
- Single step (d=256): ~80μs
- Batch processing (B=32, d=256): ~1.5ms
- 388 comprehensive tests with 100% pass rate
- Zero-copy operations where possible
Documentation
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.