pub struct HandoffTransferTiming {
pub mode: TransferTimingMode,
pub full_prompt_tokens: usize,
pub kv_bytes_per_token: Option<usize>,
pub bandwidth_gb_s: Option<f64>,
}Expand description
Source-provided inputs for calculating KV transfer delay.
Schedulers publish this value when source KV ownership becomes held. The Replayer combines it with the destination’s missing-token observation and schedules the virtual transfer completion.
Fields§
§mode: TransferTimingModeWhich prompt footprint contributes to transfer time.
full_prompt_tokens: usizeFull source prompt length.
kv_bytes_per_token: Option<usize>Modeled KV bytes occupied by one prompt token.
bandwidth_gb_s: Option<f64>Modeled transfer bandwidth in decimal gigabytes per second.
Implementations§
Source§impl HandoffTransferTiming
impl HandoffTransferTiming
Sourcepub fn delay_ms(self, destination_missing_tokens: usize) -> Option<f64>
pub fn delay_ms(self, destination_missing_tokens: usize) -> Option<f64>
Calculate transfer delay in milliseconds.
Returns None when the source did not provide a complete timing model
or when bandwidth is non-positive. In that case the Replayer may apply
its configured fallback delay.
Sourcepub fn full_prompt_delay_ms(self) -> Option<f64>
pub fn full_prompt_delay_ms(self) -> Option<f64>
Calculate delay using the full prompt irrespective of mode.
Trait Implementations§
Source§impl Clone for HandoffTransferTiming
impl Clone for HandoffTransferTiming
Source§fn clone(&self) -> HandoffTransferTiming
fn clone(&self) -> HandoffTransferTiming
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 moreimpl Copy for HandoffTransferTiming
Source§impl Debug for HandoffTransferTiming
impl Debug for HandoffTransferTiming
Source§impl<'de> Deserialize<'de> for HandoffTransferTiming
impl<'de> Deserialize<'de> for HandoffTransferTiming
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for HandoffTransferTiming
impl PartialEq for HandoffTransferTiming
Source§impl Serialize for HandoffTransferTiming
impl Serialize for HandoffTransferTiming
impl StructuralPartialEq for HandoffTransferTiming
Auto Trait Implementations§
impl Freeze for HandoffTransferTiming
impl RefUnwindSafe for HandoffTransferTiming
impl Send for HandoffTransferTiming
impl Sync for HandoffTransferTiming
impl Unpin for HandoffTransferTiming
impl UnsafeUnpin for HandoffTransferTiming
impl UnwindSafe for HandoffTransferTiming
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