metrale_model_layers/lora/
mod.rs

1// SPDX-License-Identifier: MIT OR Apache-2.0
2
3//! 2026-09-25: PEFT LoRA adapters: audit, pack into the rank-padded slot pool
4//! and the expert pool, slot routing and swap, and token overlays. "LoRA"
5//! here means adapters; `kv_lora_rank` / `q_lora_rank` in the model config are
6//! MLA dimensions, unrelated.
7//!
8//! Owner: model-layers (lora).
9//! Invariants: none beyond the types.
10
11mod audit;
12mod env;
13mod expert_apply;
14mod expert_pack;
15mod key;
16mod loading;
17mod moe_row_adapter;
18mod overlay;
19mod overlay_build;
20mod overlay_tables;
21mod slot_math;
22mod target;
23mod types;
24
25pub(crate) use audit::{AuditedAdapter, audit_adapter};
26pub use env::*;
27pub use expert_apply::*;
28pub use key::*;
29pub use loading::*;
30pub use moe_row_adapter::*;
31pub use overlay::*;
32pub use overlay_build::*;
33pub use overlay_tables::*;
34pub use slot_math::*;
35pub use target::*;
36pub use types::*;
37
38// 2026-09-25: Only `fetch_adapter_manifest` needs `cuda`; the rest is host
39// code, compiled under test too so its tests run without CUDA.
40#[cfg(any(feature = "cuda", test))]
41// 2026-09-25: Unix-only: the RDMA swap it serves (model-engine
42// `swap_lora_slot_from_peer`) is unix-only.
43#[cfg(unix)]
44pub mod rdma_stage;
45
46#[cfg(test)]
47#[path = "test_support.rs"]
48mod test_support;