abi, sched: placeholder runs read both ways

An encoder states that the language model reads a picture's or video
frame's placeholders both ways (RadEncoderDecl::bidirectional). The
scheduler then ends no prefill chunk inside such a run, and a trunk
pass names its runs and the keys their rows see (RadBatch::n_bidi).
Fields appended; such a pass is not recorded.
This commit is contained in:
keptn42 committed 2026-11-04 07:20:43 +01:00
1 parent 81be3cb63d
commit da7b911c64
10 files changed
+246 -12

No files matched your search

+7
View File
@@ -886,6 +886,13 @@ typedef struct RadEncoderDecl {
* position tables or kernels are per geometry; the core ends a pass where the grid changes.
* 0 packs segments of any grid into a pass. */
int32_t one_grid;
/* ---- appended in ABI 32 (runs the language model reads both ways) */
/* 1: the language model attends the placeholders of one picture or video frame to each other
* both ways (Gemma 4's use_bidirectional_attention "vision"), text before and after them
* causally. The core then ends no prefill chunk inside such a run and states each trunk pass's
* runs (RadBatch::n_bidi). 0 for an audio encoder. */
int32_t bidirectional;
} RadEncoderDecl;
int rad_declare_encoder(RadBuilder* b, const RadEncoderDecl* d);