Last updated: 2026-11-17

Vulkan Runtime

Compute Prefill Policy

All API Sections

Host-only routing for accelerator CLI, debug and slot prefill.

Share the decisions so prompt batching and SSM reduction selection cannot drift apart.

6 exports shown

constant

batch_threshold

#
pub const batch_threshold: usize = 32

No public doc comment yet.

src/compute/prefill_policy.zig:5

struct

Options

#
pub const Options = struct

Memory Layout

Size: 1 bytes (alignment: 1)

Offset Size Align Field Type
0 1 1 tier zinc_rt.engine.Tier

No public doc comment yet.

src/compute/prefill_policy.zig:7

function

useBatched

#
pub fn useBatched(tokens: usize, options: Options) bool

No public doc comment yet.

src/compute/prefill_policy.zig:14

struct

SlotOptions

#
pub const SlotOptions = struct

Memory Layout

Size: 8 bytes (alignment: 4)

Offset Size Align Field Type
4 1 1 rocm bool
5 1 1 moe bool
0 4 4 slots u32
6 1 1 kv_f32 bool
7 1 1 b1_matvec bool

No public doc comment yet.

src/compute/prefill_policy.zig:25

function

useCliMoeSlotPrefill

#
pub fn useCliMoeSlotPrefill(tokens: usize, options: SlotOptions) bool

The MoE CLI batches short prompts with the warp SSM scan.

Serial HTTP prefill instead chose "box" where the CLI/reference chose "fridge". Merely enabling slot batching still selects the block scan, so both the scheduler and slot scan must use this decision. Restrict it to the F32 single-slot B=1 path; concurrent serving needs its existing batched-decode reduction.

src/compute/prefill_policy.zig:38

function

useSlotDecodeQ8

#
pub fn useSlotDecodeQ8(batched_prefill: bool, options: SlotOptions) bool

A long request can allocate Q8 scratch that remains cached for later ones.

Its presence must not switch a fresh serial-prefilled request to different decode arithmetic. Batched prefill still enables the existing Q8 fast path.

src/compute/prefill_policy.zig:46