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: f64Session creation: the trunk cache allocation (pp::new_cache_planned).
prime_ms: f64Session 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: f64Session creation: the prompt-boundary prefix capture (0 with the prefix door shut).
anchor_ms: f64Session creation: the boundary token draw (sampled: host logits HtoD + filtered Gumbel + readback; greedy: host argmax).
draft_alloc_ms: f64Session 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: f64Round 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: f64Round 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: f64Round 1: the t=K+1 verify walk.
first_accept_ms: f64Round 1: the accept walk (device argmaxes / rejection sampling + readbacks).
first_roll_ms: f64Round 1: the trunk rollback to the accepted prefix.
first_maint_ms: f64Round 1: draft-source maintenance (tap drain / plane reset + re-seed).
first_round_tokens: usizeRound 1: tokens the round committed (j accepted drafts + the bonus).
first_burst_ms: f64First 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: f64First 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: usizeFirst burst: rounds it ran and tokens it returned (anchor included).
first_burst_tokens: usize§sink_alloc_ms: f64Session 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: f64Inside 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: f64Drafter 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: usizeDrafter 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: f64The 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
impl Clone for SpecFirstTokenProf
Source§fn clone(&self) -> SpecFirstTokenProf
fn clone(&self) -> SpecFirstTokenProf
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more