pub struct CaptionTrace {Show 17 fields
pub preprocess_ms: f64,
pub tower_ms: f64,
pub tower_per_tile_ms: Vec<f64>,
pub assemble_ms: f64,
pub prefill_ms: f64,
pub step_ms: Vec<f64>,
pub detokenize_ms: f64,
pub tiles: usize,
pub rows: usize,
pub cols: usize,
pub tile: usize,
pub image_tokens: usize,
pub text_tokens: usize,
pub prompt_tokens: usize,
pub max_positions: usize,
pub split: bool,
pub resized_to: Vec<(usize, usize)>,
}Expand description
Where the time went, stage by stage, for one caption.
§Why this exists on the engine rather than in the caller
A caller can time describe_image and get one number. That number is
almost useless for a VLM, because it is dominated by a cost the caller
cannot see: the vision tower runs once per tile, and a still image is
seventeen tiles. A reader looking at “4.2 seconds” concludes the language
model is slow. The truth is usually that they handed it a picture.
So the split is reported by the code that knows it, and the alternative — a demo or a profiler reassembling the pipeline out of the public pieces to time each one — is exactly the drift this crate spent §16 avoiding.
Fields§
§preprocess_ms: f64Image -> pixel_values: two Lanczos resizes, the tile cut, normalise.
tower_ms: f64SigLIP + connector, summed over every tile of every image.
tower_per_tile_ms: Vec<f64>One entry per tile, in the order the tower saw them. The last belongs to the global thumbnail.
assemble_ms: f64Chat template, tokenize, embed, splice.
prefill_ms: f64One forward pass over the whole prompt.
step_ms: Vec<f64>One entry per generated token.
detokenize_ms: f64Detokenize and trim.
tiles: usize§rows: usize§cols: usize§tile: usizeTile edge in pixels (512 for this checkpoint).
image_tokens: usizetiles * tokens_per_tile — what the picture costs the prompt.
text_tokens: usizeWhatever is left of the prompt once the images are counted out.
prompt_tokens: usize§max_positions: usizeThe tower’s own token budget, so a reader can see the headroom.
split: boolWas tile splitting on? Off means video framing — 1 tile per image.
resized_to: Vec<(usize, usize)>The size each image was resized to before tiling, in order.
Implementations§
Source§impl CaptionTrace
impl CaptionTrace
Trait Implementations§
Source§impl Clone for CaptionTrace
impl Clone for CaptionTrace
Source§fn clone(&self) -> CaptionTrace
fn clone(&self) -> CaptionTrace
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CaptionTrace
impl Debug for CaptionTrace
Source§impl Default for CaptionTrace
impl Default for CaptionTrace
Source§fn default() -> CaptionTrace
fn default() -> CaptionTrace
Source§impl PartialEq for CaptionTrace
impl PartialEq for CaptionTrace
impl StructuralPartialEq for CaptionTrace
Auto Trait Implementations§
impl Freeze for CaptionTrace
impl RefUnwindSafe for CaptionTrace
impl Send for CaptionTrace
impl Sync for CaptionTrace
impl Unpin for CaptionTrace
impl UnsafeUnpin for CaptionTrace
impl UnwindSafe for CaptionTrace
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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