Releases: mindtro/semafold
Releases · mindtro/semafold
v0.2.0
What's new in v0.2.0
GPU Acceleration Layer
- New
ComputeBackendprotocol covering the two O(V×D²) GEMMs that dominate encode/decode cost:rotate,rotate_inverse,project,normalize_rows,restore_norms NumPyBackend— always available, delegates to canonical implementations to prevent driftTorchBackend— CUDA (NVIDIA) and MPS (Apple Silicon via PyTorch);pip install semafold[torch]MLXBackend— Metal (Apple Silicon via MLX);pip install semafold[mlx]- Thread-safe auto-detection registry with priority chain: CUDA → MPS → MLX → NumPy
- On-device matrix cache keyed by
(ctypes.data, shape)— bounded to ≤ 64 entries, safe againstid()reuse after LRU eviction list_backends()probes availability without instantiating backend objects- Plain
pip install semafoldunchanged — NumPy remains the default, no new required dependencies
Typed Enum Surface
EncodeObjective,EncodeMetric,EncodingSegmentKindadded to the stable root exportEncodingBoundType,WorkloadSuitabilityadded to the stable root export- All enum fields accept both enum instances and string values — existing string-based code continues to work
Quality
- Windows compatibility verified
- 189 tests passing across Python 3.10–3.13
- Pyright 0 errors
Install
pip install semafold # NumPy core — no GPU required
pip install semafold[torch] # + NVIDIA CUDA / Apple MPS
pip install semafold[mlx] # + Apple Silicon Metal
## Upgrade notes
No breaking changes. String values for enum fields continue to work — enums are the preferred form going forward.v0.1.0
Initial release of semafold — vector-first compression for embeddings, retrieval, and KV-cache workloads.
What's included
- Stable root API:
CompressionBudget,CompressionEstimate,CompressionFootprint,CompressionGuarantee,ValidationEvidence PassthroughVectorCodecandScalarReferenceVectorCodec- Preview-only TurboQuant family under deep import
semafold.turboquant:TurboQuantMSEVectorCodec— reconstruction-optimized quantizationTurboQuantProdVectorCodec— inner-product-optimized quantization with QJL sign sketchTurboQuantKVPreviewCodec— KV-cache compression (keys: Prod, values: MSE)
- Explicit byte accounting and validation evidence on all encodings
- Deterministic synthetic benchmarks
Install
pip install semafold==0.1.0