DflashKernels

Struct DflashKernels 

Source
pub struct DflashKernels {
Show 27 fields pub rms_norm: KernelHandle, pub residual_rms_norm: KernelHandle, pub dense_gemv: KernelHandle, pub dense_gemm: KernelHandle, pub w4a16_gemm: KernelHandle, pub dense_gemm_pipelined: KernelHandle, pub rope_qwen3: KernelHandle, pub reshape_cache_fp8: KernelHandle, pub reshape_cache_bf16: KernelHandle, pub prefill_attn_dflash_fp8: KernelHandle, pub prefill_attn_dflash_bf16: KernelHandle, pub prefill_attn_dflash_bf16_indirect: KernelHandle, pub silu_mul: KernelHandle, pub residual_add: KernelHandle, pub argmax: KernelHandle, pub batched_embed: KernelHandle, pub fill_slots: KernelHandle, pub prefill_attn: KernelHandle, pub quantize_bf16_to_fp8: KernelHandle, pub fp8_gemm_n128_row_scaled: KernelHandle, pub dense_gemv_fp8w: KernelHandle, pub fp8_gemm_n128_row_scaled_m16: KernelHandle, pub fp8_gemv_rt2: KernelHandle, pub fp8_gemv_rt2_16: KernelHandle, pub dflash2_conv2: KernelHandle, pub dflash2_topk16: KernelHandle, pub dflash2_selector_walk: KernelHandle,
}
Expand description

2026-09-25: Kernel handles for the DFlash drafter, all resolved once in BlockDiffusionDraftHead::from_weights. A handle resolved there with try_kernel is KernelHandle(0) when the target’s build lacks the kernel.

Fields§

§rms_norm: KernelHandle§residual_rms_norm: KernelHandle§dense_gemv: KernelHandle§dense_gemm: KernelHandle§w4a16_gemm: KernelHandle

2026-09-25: NVFP4 GEMM for the logits when the target’s lm_head is NVFP4 (lm_head_nvfp4 is Some), whose packed bytes the BF16 GEMM cannot read. .0 == 0 when the target has no w4a16_gemm kernel.

§dense_gemm_pipelined: KernelHandle§rope_qwen3: KernelHandle§reshape_cache_fp8: KernelHandle§reshape_cache_bf16: KernelHandle

2026-09-25: BF16 paged KV write: the ctx rows in precompute_ctx_kv and the block rows in forward_block_layer_pre_attn.

§prefill_attn_dflash_fp8: KernelHandle§prefill_attn_dflash_bf16: KernelHandle§prefill_attn_dflash_bf16_indirect: KernelHandle

2026-09-25: attn_prefill_paged_indirect: BF16 paged attention that reads kv_len, q_offset and q_rope_pos from device memory at kernel entry. The drafter’s paged attention (forward_block_layer_attention) launches it non-causally.

§silu_mul: KernelHandle§residual_add: KernelHandle§argmax: KernelHandle§batched_embed: KernelHandle§fill_slots: KernelHandle

2026-09-25: Builds count i64 cache slot indices on the device from a block table: the ctx rows’ slots in propose and the batched precompute, and the block rows’ slots in forward_block.

§prefill_attn: KernelHandle

2026-09-25: Non-paged prefill attention, built for head_dim 128 only (attn_prefill_h128): the non-paged layer body and the dflash_contig_attn path use it.

§quantize_bf16_to_fp8: KernelHandle

2026-09-25: BF16 → FP8 E4M3 weight quantization with one f32 scale per row, run only in from_weights to build the FP8 mirrors of the seven dense GEMM weights (q/k/v/o/gate/up/down) and, when the checkpoint has no FP8 lm_head, the lm_head.

§fp8_gemm_n128_row_scaled: KernelHandle

2026-09-25: Row-scaled BF16 × FP8 → BF16 GEMM over an Fp8DenseWeight, from the w4a16 module (from_weights picks the variant). With DflashQuantization::Fp8Weights the layer GEMMs use it when neither rt2 GEMV applies, and the lm_head uses it above 16 rows.

§dense_gemv_fp8w: KernelHandle§fp8_gemm_n128_row_scaled_m16: KernelHandle

2026-09-25: fp8_gemm_t_row_scaled_m16, a single-warp row-scaled FP8 GEMM that computes at most 16 rows. The FP8 lm_head uses it at 16 rows or fewer when neither rt2 GEMV applies.

§fp8_gemv_rt2: KernelHandle

2026-09-25: fp8_gemv_rowscale_batch8_rt2, a register-tiled row-scaled FP8 GEMV for at most 8 rows. The FP8 layer GEMMs and the FP8 lm_head try it first, then fp8_gemv_rt2_16, then a tile GEMM. .0 == 0 on targets without the fp8_gemv_rt module. Kill-switch: METRALE_NO_DFLASH_FP8_RT=1. provenance-id: 526f6e616c6420522e205374657369616b

§fp8_gemv_rt2_16: KernelHandle

2026-09-25: fp8_gemv_rowscale_batch16_rt2, the 16-row sibling of fp8_gemv_rt2, for at most 16 rows. .0 == 0 on targets without it. Both rt2 GEMVs also need K to be a multiple of 16, and METRALE_NO_DFLASH_FP8_RT=1 disables both. provenance-id: 526f6e616c6420522e205374657369616b

§dflash2_conv2: KernelHandle

2026-09-25: DFlash2 two-tap grouped dynamic conv (kernels/gb10/common/dflash2.cu). .0 == 0 on targets without the module, and dflash2_active is then false.

§dflash2_topk16: KernelHandle

2026-09-25: DFlash2 per-row top-16 over the drafter logits; overwrites each selected logit.

§dflash2_selector_walk: KernelHandle

2026-09-25: DFlash2 candidate-selector chain walk, one launch, one block per sequence.

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,