Archived
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:
1 parent
09ff76701c
commit
582cda0a53
15 files changed
+141
-84
No files matched your search
+1
-1
@@ -17,7 +17,7 @@ extern "C" {
|
||||
* kind of plugin reports it, and a plugin that does not report exactly this version is refused at
|
||||
* load with both versions printed. A new optional export (e.g. rad_plugin_reference) is not a
|
||||
* change of shape: a plugin without it gets the default. */
|
||||
#define RAD_ABI_VERSION 17u
|
||||
#define RAD_ABI_VERSION 18u
|
||||
|
||||
/* ================================================================== plugin identity */
|
||||
/* One value per plugin, not flags (QUANT is 3). RAD_PLUGIN_QUANT is a quantiser plugin:
|
||||
|
||||
@@ -49,6 +49,17 @@ typedef struct RadBatch {
|
||||
const int32_t* positions; /* [n_tok] device */
|
||||
const int32_t* cu_seqlens; /* [n_seq+1] device: sequence boundaries within this step */
|
||||
const int32_t* seq_ids; /* [n_seq] device: engine-side sequence identity */
|
||||
/* [n_tok] device: the runtime LoRA adapter each token's row runs with, as a slot of the
|
||||
* adapter pools the core declared (docs/OPS.md, lora_shrink / lora_expand). A row whose slot is
|
||||
* < 0 or >= the pools' slot count S is a base row, which an adapter op leaves untouched. Every
|
||||
* row of a sequence carries its request's slot, fixed when the request was admitted, so a step
|
||||
* that mixes adapters and the base needs nothing else.
|
||||
*
|
||||
* Null when the engine serves no adapters (no --lora and no --max-loras). The core issues the
|
||||
* adapter ops itself and reads it there; a block with an adapter epilogue of its own reads it
|
||||
* too. Like every array above it sits at one address per rank for the engine's life and is
|
||||
* rewritten every step, so a recorded pass replays it. */
|
||||
const int32_t* lora_slot;
|
||||
|
||||
/* The tokens the sampler wants logits for: indices into this step's tokens, [n_out].
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user