pub struct DflashScratch {Show 27 fields
pub stream_buf: DevicePtr,
pub norm_buf: DevicePtr,
pub q_buf: DevicePtr,
pub k_buf: DevicePtr,
pub v_buf: DevicePtr,
pub attn_out: DevicePtr,
pub mlp_intermediate: DevicePtr,
pub mlp_up: DevicePtr,
pub stream_acc: DevicePtr,
pub fc_proj: DevicePtr,
pub fused_kv_out: DevicePtr,
pub slot_mapping_dev: DevicePtr,
pub precompute_in: DevicePtr,
pub option_b_indirect_args_dev: DevicePtr,
pub draft_tokens_host_pinned: AtomicPtr<u8>,
pub draft_tokens_event: u64,
pub logits: DevicePtr,
pub draft_tokens_dev: DevicePtr,
pub position_ids: DevicePtr,
pub markov_embed: DevicePtr,
pub markov_bias: DevicePtr,
pub conf_out: DevicePtr,
pub conv_dyn: DevicePtr,
pub conv_tmp: DevicePtr,
pub sel_vals: DevicePtr,
pub sel_idx: DevicePtr,
pub sel_hproj: DevicePtr,
}Expand description
2026-09-25: Device scratch for the γ-block forward, allocated once per head
in from_weights.rs. nb below is the head’s max_batch.
Fields§
§stream_buf: DevicePtr§norm_buf: DevicePtr§q_buf: DevicePtr§k_buf: DevicePtr§v_buf: DevicePtr§attn_out: DevicePtr§mlp_intermediate: DevicePtr§mlp_up: DevicePtr§stream_acc: DevicePtr§fc_proj: DevicePtr2026-09-25: [ctx_window, hidden] BF16: ctx rows after fc and
hidden_norm.
fused_kv_out: DevicePtr2026-09-25: [ctx_window, L * 2 * kv_dim] BF16: the ctx precompute’s KV
GEMM output.
slot_mapping_dev: DevicePtr2026-09-25: i64[ctx_window] paged-cache slot indices for
reshape_and_cache.
precompute_in: DevicePtr2026-09-25: [PRECOMPUTE_BATCH_ROWS, L_t * h_t] BF16 staging for the
batched ctx precompute: the uncommitted ctx rows of several sequences,
contiguous.
option_b_indirect_args_dev: DevicePtr2026-09-25: nb triples [u32 kv_len, u32 q_offset, u32 q_rope_pos],
12 bytes each, one per band, read by the indirect paged-attention kernel
at entry. The host writes them before the captured region, so a captured
graph sees a fixed pointer.
draft_tokens_host_pinned: AtomicPtr<u8>2026-09-25: Pinned host buffer, nb * gamma * 4 bytes, for the
draft-token D2H copy; allocated once in from_weights.rs. AtomicPtr
keeps DflashScratch Send + Sync. Nothing stores to it after
construction, so Relaxed loads are enough.
draft_tokens_event: u642026-09-25: Event recorded after the draft-token D2H copy; the host waits
on it before reading the pinned buffer. Created once in from_weights.rs.
logits: DevicePtr§draft_tokens_dev: DevicePtr§position_ids: DevicePtr2026-09-25: i32 RoPE positions: the eff_ctx ctx rows, then each
sequence’s block rows from that sequence’s position.
markov_embed: DevicePtr2026-09-25: DSpark Markov scratch: [1, markov_rank] BF16 latent for the
prev-token gather (markov_w1[prev]). DevicePtr(0) when the
drafter has no Markov head.
markov_bias: DevicePtr2026-09-25: DSpark Markov scratch: [vocab] BF16 bias
(markov_w2 @ markov_embed), residual-added onto one logits row
per sequential step. DevicePtr(0) when no Markov head.
conf_out: DevicePtr2026-09-25: DSpark confidence scratch: [γ] BF16 per-row acceptance
logits, read back on the host after the draft-token D2H to pick how many
drafts to keep. DevicePtr(0) when the drafter has no confidence head.
conv_dyn: DevicePtr2026-09-25: [nb * γ, 2 * conv_kernel_size * (hidden / conv_group_size)]
BF16 dynamic conv kernels, reused by each conv site in turn.
conv_tmp: DevicePtr2026-09-25: [nb * γ, hidden] BF16 staging for the convolved hidden.
sel_vals: DevicePtr2026-09-25: [nb * γ, 16] f32: the selector’s top-16 logits per row.
sel_idx: DevicePtr2026-09-25: [nb * γ, 16] u32: the selector’s top-16 token ids per row.
sel_hproj: DevicePtr2026-09-25: [nb * γ, selector_rank] BF16: the selector’s hidden
projection.