pub struct PipelineSequence {
pub id: u64,
pub phase: ExecutionPhase,
pub input_tokens: Vec<TokenId>,
pub generated_tokens: Vec<TokenId>,
pub kv_cache: Option<Arc<dyn KvCacheHandle>>,
pub sampling_params: SamplingParams,
pub priority: Priority,
pub rng: SamplingRng,
pub prefill_start: Option<Instant>,
pub first_token_time: Option<Instant>,
pub completion_time: Option<Instant>,
}Expand description
Sequence being processed in the pipeline
Fields§
§id: u64Unique sequence ID
phase: ExecutionPhaseCurrent phase
input_tokens: Vec<TokenId>Input tokens (for prefill)
generated_tokens: Vec<TokenId>Generated tokens
kv_cache: Option<Arc<dyn KvCacheHandle>>KV cache handle
sampling_params: SamplingParamsSampling parameters
priority: PriorityPriority
rng: SamplingRngRandom number generator
prefill_start: Option<Instant>Prefill start time
first_token_time: Option<Instant>First token time (TTFT)
completion_time: Option<Instant>Total time to complete
Implementations§
Source§impl PipelineSequence
impl PipelineSequence
Sourcepub fn new(
id: u64,
input_tokens: Vec<TokenId>,
sampling_params: SamplingParams,
priority: Priority,
) -> Self
pub fn new( id: u64, input_tokens: Vec<TokenId>, sampling_params: SamplingParams, priority: Priority, ) -> Self
Create new sequence
Sourcepub fn total_tokens(&self) -> usize
pub fn total_tokens(&self) -> usize
Total tokens in sequence
Sourcepub fn should_stop(&self, vocab_size: usize) -> bool
pub fn should_stop(&self, vocab_size: usize) -> bool
Check if generation should stop
Trait Implementations§
Source§impl Clone for PipelineSequence
impl Clone for PipelineSequence
Auto Trait Implementations§
impl !RefUnwindSafe for PipelineSequence
impl !UnwindSafe for PipelineSequence
impl Freeze for PipelineSequence
impl Send for PipelineSequence
impl Sync for PipelineSequence
impl Unpin for PipelineSequence
impl UnsafeUnpin for PipelineSequence
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more