DflashScratch

Struct DflashScratch 

Source
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: DevicePtr

2026-09-25: [ctx_window, hidden] BF16: ctx rows after fc and hidden_norm.

§fused_kv_out: DevicePtr

2026-09-25: [ctx_window, L * 2 * kv_dim] BF16: the ctx precompute’s KV GEMM output.

§slot_mapping_dev: DevicePtr

2026-09-25: i64[ctx_window] paged-cache slot indices for reshape_and_cache.

§precompute_in: DevicePtr

2026-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: DevicePtr

2026-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: u64

2026-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: DevicePtr

2026-09-25: i32 RoPE positions: the eff_ctx ctx rows, then each sequence’s block rows from that sequence’s position.

§markov_embed: DevicePtr

2026-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: DevicePtr

2026-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: DevicePtr

2026-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: DevicePtr

2026-09-25: [nb * γ, 2 * conv_kernel_size * (hidden / conv_group_size)] BF16 dynamic conv kernels, reused by each conv site in turn.

§conv_tmp: DevicePtr

2026-09-25: [nb * γ, hidden] BF16 staging for the convolved hidden.

§sel_vals: DevicePtr

2026-09-25: [nb * γ, 16] f32: the selector’s top-16 logits per row.

§sel_idx: DevicePtr

2026-09-25: [nb * γ, 16] u32: the selector’s top-16 token ids per row.

§sel_hproj: DevicePtr

2026-09-25: [nb * γ, selector_rank] BF16: the selector’s hidden projection.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,