Skip to main content

Crate blazen_train_tune

Crate blazen_train_tune 

Source
Expand description

AutoML / hyperparameter search on top of blazen-train.

This crate is intentionally separate from blazen-train itself so that the heavy training engine (candle, hf-hub, tokenizers) doesn’t have to be compiled in to use the searchers — the Evaluator trait is the only coupling point, and callers wire their own training loop into it.

Pieces:

  • spaceSearchSpace + Distribution (Categorical / IntUniform / Uniform / LogUniform / Discrete). The space defines what hyperparams exist and what each one’s prior looks like.
  • trialTrial record + status state machine.
  • searcherSearcher trait + three real implementations: RandomSearch, GridSearch, and TpeSearch (Tree-structured Parzen Estimator, Bergstra et al. 2011, Algorithm 1).
  • journal — JSONL append-only TrialJournal for crash recovery.
  • runnerRunner glues a SearchSpace + Searcher + Evaluator
    • TrialJournal into a budgeted (max-trials / time-budget) loop, optionally fan-out across N tokio workers.

See examples/lora_sft_search.rs for an end-to-end LoRA SFT search.

ML acronyms (LoRA, TPE, KDE, SFT, …) saturate the docs; backticking each one would hurt readability without adding clarity.

Re-exports§

pub use error::TuneError;
pub use journal::TrialJournal;
pub use runner::EvalFuture;
pub use runner::Evaluator;
pub use runner::Runner;
pub use runner::RunnerBudget;
pub use searcher::GridSearch;
pub use searcher::RandomSearch;
pub use searcher::Searcher;
pub use searcher::TpeSearch;
pub use space::Distribution;
pub use space::SearchSpace;
pub use trial::Trial;
pub use trial::TrialId;
pub use trial::TrialStatus;

Modules§

error
Error type for blazen-train-tune.
journal
Append-only JSONL trial journal.
runner
The async search loop.
searcher
Search strategies: RandomSearch, GridSearch, TpeSearch.
space
SearchSpace + Distribution types.
trial
Trial record + lifecycle state machine.