Module model

Module model 

Source
Expand description

Generic transformer model.

The model loop (embed -> layers -> norm -> lm_head) is architecture- agnostic. Layer-specific logic lives in TransformerLayer implementations.

Wave 4b1 split: this module was originally a single 8,690 LoC model.rs. Sub-modules now hold:

  • types struct TransformerModel + PinnedMetaStaging
  • ssm_pool SsmStatePool
  • ssm_snapshot SsmSnapshotPool
  • block_mgmt free-fn helpers (apply_evicted_blocks etc.)
  • impl_a1/2/3 first inherent impl TransformerModel block
  • impl_b1/2/3 second inherent impl TransformerModel block
  • trait_impl single impl Model for TransformerModel block FLAGGED ≤500 LoC cap — Rust does NOT allow splitting one trait impl across files (E0119), and breaking it into inherent-helper delegation is a semantic refactor outside this wave’s scope.
  • drop impl Drop for TransformerModel
  • tests extracted unit tests

Modules§

nllb
Served NLLB-200 / M2M-100 encoder-decoder translation model.

Structs§

TransformerModel