Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

Releases: paiml/entrenar

Nightly Build

07 Apr 05:13

Choose a tag to compare

Nightly Build Pre-release
Pre-release

Automated nightly build from main.

Commit: 5d021a9

This is a pre-release build and may be unstable.

v0.2.2 - SafeTensors & Sub-Crate Tools

29 Nov 16:55

Choose a tag to compare

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

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

21 Nov 07:46

Choose a tag to compare

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

🔗 Links

🙏 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)