Expand description
Token-overlay kernel launchers (Feature 2). Thin KernelLaunch wrappers over
kernels/gb10/common/token_overlay.cu:
embed_rowdiff— build-time: which adapter base rows differ from served.embed_overlay_routed— forward: replace overridden vocab rows post-gather.lmhead_overlay_routed— forward: recompute overridden logit columns.
Argument order is in LOCKSTEP with the .cu signatures (cuLaunchKernel is
type-blind). All device tables are load-time-fixed addresses; the only
per-step arg is seq_slot (NULL ⇒ uniform active) — graph-capture safe.
Structs§
- Overlay
Kernels - The four token-overlay kernels, resolved once at model construction via
try_kernel(null-on-miss ⇒ the feature is silently unused rather than a hard init failure on a kernel image that predates the overlay).
Functions§
- embed_
overlay_ routed - In-place row-replace of overridden vocab rows on the residual stream after
the embed gather (BEFORE
scale_embeddings). Per rowr:s = seq_slot[r](oractivewhen NULL);s<0skip;ids[r]>=vocabskip (no overlay entry for a token beyond the overlay’s served-vocab snapshot — CWE-125 guard);slot=slot_map_tab[s][ids[r]];slot<0orslot>=n_tab[s]skip; copyrows_tab[s][slot]overout[r]. - embed_
rowdiff flags[r] = (max_i |base[r,i] - served[r,i]| > thresh). Grid one thread/row.- lmhead_
overlay_ routed - In-place recompute of overridden logit columns (BEFORE softcap). One warp per
(row, j);jindexes the overridden-id slot of that row’s adapter. Picks the bf16 or f32 logits kernel peris_fp32.