build_moe_row_adapter_decode

Function build_moe_row_adapter_decode 

Source
pub fn build_moe_row_adapter_decode(
    adapter_slots: &[i32],
    padded_n: usize,
    active: i32,
    has_moe_lora: bool,
) -> Vec<i32>
Expand description

2026-09-25: The [padded_n] per-row adapter map of a decode batch, one token per sequence, which moe_lora_gather_bgmv.cu reads as row_adapter[row / top_k] and skips when negative. Row i is active when resolve_moe_lora_route gives Fold, else -1; so Skip, Refuse and padding rows (i >= adapter_slots.len()) are all -1, which is not the attention seq_slot convention (there -1 means the active adapter). Model-engine uploads it in upload_moe_row_adapter.