fuel_posttrain/lib.rs
1// SPDX-License-Identifier: MIT OR Apache-2.0
2//! Post-training model compression for the Fuel ML framework.
3//!
4//! **Layer**: Use-Case Orchestration | **Stability**: experimental
5//!
6//! Techniques applied to a model's weights *after* it has been loaded and
7//! (optionally) quantized — as opposed to `fuel-training`, which owns the
8//! training-LOOP infrastructure (optimizers, schedulers, checkpoints) for a
9//! model still being trained. This crate's consumers already have a frozen
10//! set of weights and want to recover accuracy lost to quantization, or
11//! shrink the weight set further via pruning.
12//!
13//! ## Modules
14//!
15//! - [`norm_tweaking`] — Norm Tweaking (Li et al., AAAI 2024): recalibrates
16//! normalization-layer gamma/beta parameters to compensate for the
17//! activation-distribution shift quantization introduces. Ported from
18//! `lightbulb/src/quantization/norm_tweaking.rs` (candlelight-based) as
19//! part of the Candle-to-Fuel migration (lightbulb #106). **Read the
20//! module doc before using this**: the ported implementation is an
21//! analytical approximation of the paper's algorithm, not the paper's own
22//! iterative gradient-based calibration — the source this was ported from
23//! never implemented that half either.
24//!
25//! ## What is NOT here
26//!
27//! - Training-loop infrastructure (optimizers, LR schedulers, gradient
28//! clipping) — stays in `fuel-training`.
29//! - Model definitions — stay in `fuel-transformers`.
30//! - Quantization FORMAT numerics (GGML block types, dequant kernels) —
31//! stay in `fuel-quantized`.
32
33pub mod norm_tweaking;