pub struct PrefillInput {
pub request_id: Option<RequestId>,
pub maximum_sequence_tokens: Option<usize>,
pub chunk: Option<PrefillChunk>,
pub input_ids: TensorRef,
pub attention_mask: Option<TensorRef>,
pub position_ids: Option<TensorRef>,
pub kv_cache: Option<Arc<dyn KvCacheHandle>>,
pub recurrent_state: Option<Arc<dyn RecurrentStateHandle>>,
pub metadata: HashMap<String, Value>,
}Expand description
Input for prefill phase (processing the initial prompt)
Fields§
§request_id: Option<RequestId>Stable product request identity for plan-runtime resources.
maximum_sequence_tokens: Option<usize>Maximum sequence extent this request may reach, including the prompt. Executors use this for fit validation without allocating future pages.
chunk: Option<PrefillChunk>Exact scheduler-owned prompt chunk for this invocation.
The input tensor still contains the full prompt so token identity and global offsets remain stable. Plan runtimes execute only this range.
input_ids: TensorRefInput token IDs [batch_size, sequence_length]
attention_mask: Option<TensorRef>Attention mask [batch_size, sequence_length] (optional)
position_ids: Option<TensorRef>Position IDs [batch_size, sequence_length] (optional, for RoPE)
kv_cache: Option<Arc<dyn KvCacheHandle>>Pre-allocated KV cache handle (optional, for paged attention)
recurrent_state: Option<Arc<dyn RecurrentStateHandle>>Pre-allocated recurrent-state handle (optional, for state-space layers)
metadata: HashMap<String, Value>Request metadata that can affect model execution.
Implementations§
Source§impl PrefillInput
impl PrefillInput
Sourcepub fn with_request_context(
self,
request_id: RequestId,
maximum_sequence_tokens: usize,
) -> Self
pub fn with_request_context( self, request_id: RequestId, maximum_sequence_tokens: usize, ) -> Self
Attach the typed request boundary consumed by plan runtimes.
Sourcepub fn with_chunk(self, chunk: PrefillChunk) -> Self
pub fn with_chunk(self, chunk: PrefillChunk) -> Self
Attach the exact scheduler-published prompt chunk.
Sourcepub fn with_kv_cache(self, kv_cache: Arc<dyn KvCacheHandle>) -> Self
pub fn with_kv_cache(self, kv_cache: Arc<dyn KvCacheHandle>) -> Self
Create prefill input with a pre-allocated KV cache handle.
Sourcepub fn with_recurrent_state(
self,
recurrent_state: Arc<dyn RecurrentStateHandle>,
) -> Self
pub fn with_recurrent_state( self, recurrent_state: Arc<dyn RecurrentStateHandle>, ) -> Self
Create prefill input with a pre-allocated recurrent-state handle.
Sourcepub fn with_metadata(self, metadata: HashMap<String, Value>) -> Self
pub fn with_metadata(self, metadata: HashMap<String, Value>) -> Self
Attach request metadata.
Sourcepub fn with_attention_mask(self, mask: TensorRef) -> Self
pub fn with_attention_mask(self, mask: TensorRef) -> Self
Add attention mask
Sourcepub fn with_position_ids(self, positions: TensorRef) -> Self
pub fn with_position_ids(self, positions: TensorRef) -> Self
Add position IDs
Sourcepub fn batch_size(&self) -> usize
pub fn batch_size(&self) -> usize
Get batch size
Sourcepub fn sequence_length(&self) -> usize
pub fn sequence_length(&self) -> usize
Get sequence length
Trait Implementations§
Source§impl Clone for PrefillInput
impl Clone for PrefillInput
Source§fn clone(&self) -> PrefillInput
fn clone(&self) -> PrefillInput
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more