Releases: paiml/entrenar
Nightly Build
v0.2.2 - SafeTensors & Sub-Crate Tools
What's New
SafeTensors Support
- Full save/load support with metadata preservation
- HuggingFace Hub compatibility - Direct upload/download
- Auto-detection - Format automatically detected from file extension
- Metadata serialization - Model name, architecture, version in headers
HuggingFace Pipeline
- HfModelFetcher - Download models from HuggingFace Hub
- SafeTensors parsing - Load models in SafeTensors format
- Projection layers - Handle dimension-mismatched distillation
New CLI Tools (Sub-Crates)
- entrenar-common - CLI utilities, progress bars, structured output
- entrenar-lora - LoRA optimization and memory planning
- entrenar-inspect - Model inspection and validation
- entrenar-shell - Interactive REPL shell
- entrenar-bench - Distillation benchmarking
- entrenar-distill - Distillation pipeline demo
Quality
- All clippy warnings resolved
- 1,900+ tests passing
- Book documentation updated
Crates Published
- entrenar v0.2.2
- entrenar-common v0.1.0
- entrenar-lora v0.1.0
- entrenar-inspect v0.1.0
- entrenar-shell v0.1.0
- entrenar-bench v0.1.0
- entrenar-distill v0.1.0
Installation
```bash
cargo install entrenar
cargo install entrenar-lora
cargo install entrenar-inspect
cargo install entrenar-shell
cargo install entrenar-bench
cargo install entrenar-distill
```
Full Changelog: v0.2.1...v0.2.2
Entrenar v0.1.0 - Training & Optimization Library
Entrenar v0.1.0 - Production Release
Entrenar (Spanish: "to train") is a high-performance Rust library for training and optimizing neural networks with automatic differentiation, state-of-the-art optimizers, and memory-efficient LoRA/QLoRA fine-tuning.
🎉 First Production Release
This is the initial production-ready release of Entrenar, featuring a complete training infrastructure built with EXTREME TDD methodology.
✨ Features
Core Framework
- Autograd Engine - Tape-based automatic differentiation with backward propagation
- Tensor abstraction with gradient tracking
- BackwardOp trait for custom operations
- Attention, matmul, softmax, layer norm operations
- Property-based gradient checking (200K+ iterations)
Optimizers
- SGD with momentum support
- Adam optimizer with bias correction
- AdamW with decoupled weight decay
- Gradient clipping via L2 norm
- Learning rate scheduling (Cosine, Linear)
- SIMD acceleration for parameter updates via Trueno
- Convergence property tests for all optimizers
LoRA & QLoRA
- LoRA layers with configurable rank and alpha
- QLoRA with 4-bit quantized base weights
- Adapter management (save/load separately from base model)
- Memory benchmarks showing 4× reduction with QLoRA
- Gradient flow tests ensuring proper backpropagation
Model Merging (Arcee Methods)
- TIES (Task Inference via Elimination and Sign voting)
- DARE (Drop And REscale with Bernoulli masking)
- SLERP (Spherical Linear intERPolation)
- Property tests for permutation invariance
- Multi-model ensemble support
Knowledge Distillation
- Temperature-scaled KL divergence loss
- Multi-teacher ensemble distillation
- Progressive layer-wise distillation
- 44 distillation tests including 13 property tests
- Temperature smoothing validation
Training Loop
- High-level Trainer abstraction
- Batch processing with configurable batch size
- Metrics tracking (loss history, learning rates, steps)
- Gradient clipping integration
- Learning rate scheduling during training
Model I/O
- Save/load models with multiple formats (JSON, YAML)
- ModelMetadata with custom fields
- Round-trip integrity validation
- Automatic format detection from file extension
Declarative Configuration
- YAML-based training configuration (Ludwig-style)
- Schema validation with comprehensive error messages
- Auto-inference of feature types from data
- Single-command training via
train_from_yaml() - Builder pattern for optimizers and models from config
📊 Quality Metrics
- 258 tests passing (100% success rate)
- 130 core library tests
- 18 gradient checking tests
- 35 architecture tests
- 16 I/O and configuration tests
- 13 property-based tests (13,000+ iterations)
- 15 chaos engineering tests
- 11 memory benchmark tests
- 10+ additional integration tests
- 0 clippy warnings (strict mode)
- 0 TODOs remaining in codebase
- 55 Rust source files with full documentation
- 146 chapter mdBook documentation
🚀 Getting Started
Add to your Cargo.toml:
```toml
[dependencies]
entrenar = "0.1.0"
```
Quick example:
```rust
use entrenar::{Tensor, train::{Trainer, TrainConfig, MSELoss}, optim::Adam};
// Create trainer
let config = TrainConfig::new().with_log_interval(100);
let optimizer = Adam::default_params(0.001);
let mut trainer = Trainer::new(parameters, optimizer, config);
trainer.set_loss(Box::new(MSELoss));
// Train
let avg_loss = trainer.train_epoch(batches, |x| model.forward(x));
```
📚 Documentation
- Crates.io: https://crates.io/crates/entrenar
- API Docs: https://docs.rs/entrenar
- Book: https://github.com/paiml/entrenar/tree/main/book
- Examples: https://github.com/paiml/entrenar/tree/main/examples
🔗 Links
- Repository: https://github.com/paiml/entrenar
- CHANGELOG: https://github.com/paiml/entrenar/blob/main/CHANGELOG.md
- License: MIT
🙏 Acknowledgments
Built with:
- trueno 0.4.1 - SIMD-accelerated compute engine
- ndarray 0.16 - N-dimensional arrays
- serde 1.0 - Serialization framework
Part of the PAIML (Pragmatic AI Labs ML) ecosystem.
Quality Grade: A+ (Zero defects, 258 passing tests, EXTREME TDD methodology)