abi: RadBatch::lora_slot, each row's runtime LoRA adapter; RAD_ABI_VERSION 18

The per-row adapter slot moves from the core's `lora_slot` derivation into the step batch, beside
the other per-row arrays: [n_tok] i32 device, the row's slot in the adapter pools, < 0 or >= S a
base row, null when the engine serves no adapters. The batch builder fills it from
Request::lora_slot where it fills token_ids and positions, in the slab every rank's batch already
points into -- one address per rank for the engine's life, uploaded in stream order ahead of the
step's kernels -- so a recorded pass replays it the way it replays token_ids. Ctx::pass_key reads
the pointer; the adapter ops are issued whatever the slots hold, so nothing a pass launches depends
on their values.

Off: the slab carves nothing for it (a zero-length carve), no buffer is declared, and every other
slab offset and the arena are what they were. The derivation, its program buffer and
Program::lora_slot_buf are gone. abi_layout_table regenerated at 18 (RadBatch grows to 320 bytes,
the fields after seq_ids move by 8); sched_test holds the per-row fill, and that the slot array is
the only thing adapters add to the slab.
This commit is contained in:
baKon committed 2026-10-16 20:52:09 -05:00
1 parent 09ff76701c
commit 582cda0a53
15 files changed
+141 -84

No files matched your search

+2 -1
View File
@@ -1096,7 +1096,8 @@ every KV group, rather than per group and per layer.
It carries: token ids and positions; per-group slot mappings and block tables; sequence boundaries
(`cu_seqlens`); query and context lengths with their host-side upper bounds; the speculative window
layout (§10); encoder rows and M-RoPE positions (§11); checkpoint destinations (§7.3); the phase,
which the run phase uses to index bucket tables (§2.2); and the decode/prefill split.
which the run phase uses to index bucket tables (§2.2); the decode/prefill split; and each row's
runtime LoRA adapter slot (`lora_slot`, null when the engine serves no adapters).
The split is `n_seq_decode` and `n_tok_decode`: the core orders every step so its decode rows come
first, and those two say where they end. A block that treats the two kinds of row differently (a