Skip to main content

layer_engine

Function layer_engine 

Source
pub fn layer_engine<'a>(
    e: &'a Engine,
    n_trunk: usize,
    il: usize,
) -> Result<&'a Engine, Box<dyn Error>>
Expand description

M2 increment 2 (weight sharding): the engine that should UPLOAD layer il’s weights (and build its decode mirrors) — the owning stage’s engine when the door is open with device placement and sharding not rolled back; else the primary. il >= n_trunk (MTP/NextN blocks) maps to the last stage. The head (output_norm + lm head) belongs to the last trunk layer’s stage — call with il = n_trunk - 1.