pub struct UnifiedBatch {
pub items: Vec<UnifiedBatchItem>,
}Expand description
A mixed-batch forward request: any combination of in-progress prefill
chunks and decode steps. See UnifiedBatchItem for the per-item
semantics. The producer (engine) groups all sequences active in this
iter into a single batch; the consumer (model) runs one forward and
returns per-item logits (only for items with is_final_chunk = true,
in the order they appear in items).
Fields§
§items: Vec<UnifiedBatchItem>Implementations§
Source§impl UnifiedBatch
impl UnifiedBatch
pub fn new() -> Self
Sourcepub fn total_q_tokens(&self) -> usize
pub fn total_q_tokens(&self) -> usize
Total query tokens across all items — corresponds to the M dim of the model’s per-layer GEMMs in the unified forward.
Sourcepub fn num_sampled_items(&self) -> usize
pub fn num_sampled_items(&self) -> usize
Number of items that will produce a logits vector (decode items always; prefill items only on their final chunk).
Trait Implementations§
Source§impl Clone for UnifiedBatch
impl Clone for UnifiedBatch
Source§fn clone(&self) -> UnifiedBatch
fn clone(&self) -> UnifiedBatch
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UnifiedBatch
impl Debug for UnifiedBatch
Source§impl Default for UnifiedBatch
impl Default for UnifiedBatch
Source§fn default() -> UnifiedBatch
fn default() -> UnifiedBatch
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for UnifiedBatch
impl !RefUnwindSafe for UnifiedBatch
impl Send for UnifiedBatch
impl Sync for UnifiedBatch
impl Unpin for UnifiedBatch
impl UnsafeUnpin for UnifiedBatch
impl !UnwindSafe for UnifiedBatch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more