build_overlay

Function build_overlay 

Source
pub fn build_overlay(
    gpu: &dyn GpuBackend,
    kernels: &OverlayKernels,
    slot: &OverlayRawSlot,
    served_embed: DevicePtr,
    served_lmhead: DevicePtr,
    vocab: usize,
    h: usize,
    tied: bool,
    stream: u64,
) -> Result<Option<EmbedOverlay>>
Expand description

Stage 2 (set_lora_weights): row-diff against the served tables, compact the override rows, build the slot_map, and free the Stage-1 raw scratch. Ok(None) when the slot overrides nothing (silently inert = correct).

tied means the lm_head aliases the embed table (buffer aliasing OR a quantized head derived from embed) — the caller then reuses the embed rows for the logit recompute (overlay_tables), so no distinct lm_head build.