Skip to main content

SpecFirstTokenProf

Struct SpecFirstTokenProf 

Source
pub struct SpecFirstTokenProf {
Show 27 fields pub cache_alloc_ms: f64, pub prime_ms: f64, pub capture_ms: f64, pub anchor_ms: f64, pub draft_alloc_ms: f64, pub draft_prime_ms: f64, pub first_draft_ms: f64, pub first_verify_ms: f64, pub first_accept_ms: f64, pub first_roll_ms: f64, pub first_maint_ms: f64, pub first_round_tokens: usize, pub first_burst_ms: f64, pub first_burst_hook_ms: f64, pub first_burst_rounds: usize, pub first_burst_tokens: usize, pub sink_alloc_ms: f64, pub prime_tap_dtoh_ms: f64, pub draft_prime_h2d_ms: f64, pub draft_prime_feat_ms: f64, pub draft_prime_kv_ms: f64, pub draft_prime_rows: usize, pub draft_prime_chunks: usize, pub draft_prime_arm: &'static str, pub draft_kv_mb: f64, pub free_mb_before: Vec<(usize, u64)>, pub free_mb_after: Vec<(usize, u64)>,
}
Expand description

The first-token phase buckets (ms) one served spec session carries until the worker prints its [spec-prof] line after the first burst. Every field is a wall interval bounded by stream drains on both sides, so the buckets are device-inclusive and additive; a bucket the route never runs stays 0.0.

Fields§

§cache_alloc_ms: f64

Session creation: the trunk cache allocation (pp::new_cache_planned).

§prime_ms: f64

Session creation: the target prime over the prompt (prime_cache), INCLUDING the host-staged tap DtoHs the DFlash2 sink takes inside the walk and the prime’s own full-vocab logits readback.

§capture_ms: f64

Session creation: the prompt-boundary prefix capture (0 with the prefix door shut).

§anchor_ms: f64

Session creation: the boundary token draw (sampled: host logits HtoD + filtered Gumbel + readback; greedy: host argmax).

§draft_alloc_ms: f64

Session creation: the draft-source state build — DFlash2: DflashKv::new at the session ctx (2 x n_layer x (ctx + block) x n_kv x head_dim x f32, uninit); native MTP: the batched plane fill over the prompt.

§draft_prime_ms: f64

Round 1: the DFlash2 drafter’s ctx ingest of the WHOLE prompt’s feature rows (HtoD of the host-staged taps + ctx_features + per-layer k/v projections). The only prompt-length-linear cost after the target prime. 0 on the native arm.

§first_draft_ms: f64

Round 1: draft production after the ingest (block forward + lm_head over the mask-fill rows + selector walk; native arm: the MTP chain).

§first_verify_ms: f64

Round 1: the t=K+1 verify walk.

§first_accept_ms: f64

Round 1: the accept walk (device argmaxes / rejection sampling + readbacks).

§first_roll_ms: f64

Round 1: the trunk rollback to the accepted prefix.

§first_maint_ms: f64

Round 1: draft-source maintenance (tap drain / plane reset + re-seed).

§first_round_tokens: usize

Round 1: tokens the round committed (j accepted drafts + the bonus).

§first_burst_ms: f64

First burst: wall from burst entry to return, no extra drains. Under the round-cadence door (MEMRA_SPEC_FIRST_TOKEN_EAGER, default ON) the commit hook runs INSIDE this window, so the per-slice detext + channel sends land here too; first_burst_hook_ms is exactly that share — first_burst_ms - first_burst_hook_ms is the engine-only wall of the burst on either arm.

§first_burst_hook_ms: f64

First burst: time spent inside the caller’s commit hook (0 with no hook, i.e. MEMRA_SPEC_FIRST_TOKEN_EAGER=0). Host-only work: detext + Event::Token sends.

§first_burst_rounds: usize

First burst: rounds it ran and tokens it returned (anchor included).

§first_burst_tokens: usize§sink_alloc_ms: f64

Session creation: the prime tap sink’s HOST allocation (HcTapSink::new, a [prompt, n_taps * hidden] f32 Vec: 21 GB at 256k) — eager arm only.

§prime_tap_dtoh_ms: f64

Inside the target prime: the host-staged tap DtoHs (five synchronous readbacks per prime chunk, accumulated by the walk) — eager arm only; a share of prime_ms.

§draft_prime_h2d_ms: f64

Drafter prime split: host->device movement of the tap rows (pageable HtoD on the eager arm; device slot DtoH into pinned + host interleave + async HtoD on the chunked arm), the fc feature GEMM (ctx_features), the 5-layer k/v ingest.

§draft_prime_feat_ms: f64§draft_prime_kv_ms: f64§draft_prime_rows: usize

Drafter prime geometry: rows ingested, chunks, and which arm ran (eager = round-1 ingest in 256-row chunks from the host sink; chunked = MEMRA_GLM5_DRAFT_PRIME_V2, ingest per prime chunk from device-staged taps).

§draft_prime_chunks: usize§draft_prime_arm: &'static str§draft_kv_mb: f64

The drafter ctx KV allocation at the session ctx, in MB (uninit; 2 x n_layer x (ctx + block) x n_kv x head_dim x f32).

§free_mb_before: Vec<(usize, u64)>

Free device memory per device ordinal, before the trunk cache allocation and after the drafter KV allocation — the graph-launch headroom guard and every pool-growth path key on it, so a per-boot bimodality shows up here first.

§free_mb_after: Vec<(usize, u64)>

Trait Implementations§

Source§

impl Clone for SpecFirstTokenProf

Source§

fn clone(&self) -> SpecFirstTokenProf

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SpecFirstTokenProf

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SpecFirstTokenProf

Source§

fn default() -> SpecFirstTokenProf

Returns the “default value” for a type. Read more
Source§

impl PartialEq for SpecFirstTokenProf

Source§

fn eq(&self, other: &SpecFirstTokenProf) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SpecFirstTokenProf

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.