Skip to main content

FlashAttnPrefillLayout

Enum FlashAttnPrefillLayout 

Source
pub enum FlashAttnPrefillLayout {
    HeadMajor,
    SeqMajor,
}
Expand description

Layout selector for dispatch_flash_attn_prefill_bf16_d64.

The kernel reads from raw device pointers via integer strides, so any element layout that keeps head_dim (D) as the contiguous innermost axis is valid input. The two layouts named here both satisfy that constraint and cover every BERT/embedding caller in hf2q today:

  • HeadMajor[B, H, L, D], the same layout the D=256/D=512 dispatchers assume. Stride math: seq = D, head = L * D, batch = H * L * D.

  • SeqMajor[B, L, H, D], the natural output of BERT linear projections (hidden = H * D row-major). Stride math: seq = H * D, head = D, batch = L * H * D. Choosing this layout avoids three host-side transpose dispatches per layer (Q + K + V) plus one for the output, which is the entire point of the D=64 dispatcher’s existence — the BERT family wins on dispatch count, not raw FA perf.

Variants§

§

HeadMajor

[B, H, L, D] — same as the D=256/D=512 dispatchers.

§

SeqMajor

[B, L, H, D] — natural BERT/embedding-model layout.

Trait Implementations§

Source§

impl Clone for FlashAttnPrefillLayout

Source§

fn clone(&self) -> FlashAttnPrefillLayout

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 FlashAttnPrefillLayout

Source§

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

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

impl PartialEq for FlashAttnPrefillLayout

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for FlashAttnPrefillLayout

Source§

impl Eq for FlashAttnPrefillLayout

Source§

impl StructuralPartialEq for FlashAttnPrefillLayout

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