Skip to main content

FlashDecodingArgs

Struct FlashDecodingArgs 

Source
pub struct FlashDecodingArgs<'a, T: Element> {
    pub q: TensorRef<'a, T, 3>,
    pub k: TensorRef<'a, T, 4>,
    pub v: TensorRef<'a, T, 4>,
    pub y: TensorMut<'a, T, 3>,
}
Expand description

Args bundle for a FlashDecoding launch.

Q is rank-3 because seq_q == 1 is encoded in the descriptor — no need to thread a unit axis through the API.

K/V take shape [B, H_kv, K_len, D] (the PHYSICAL layout, not the broadcast-replicated H_q view). The kernel handles the Q→KV head mapping via integer division kv_head = q_head / group_size. For pure MHA the caller just passes H_kv == H_q and the same data shape as before.

Fields§

§q: TensorRef<'a, T, 3>

Query tensor — shape [B, H_q, D]. Arbitrary strides via the supplied stride array; typical case is contig.

§k: TensorRef<'a, T, 4>

Key tensor — shape [B, H_kv, K_len, D], physical layout.

§v: TensorRef<'a, T, 4>

Value tensor — shape [B, H_kv, K_len, D], physical layout.

§y: TensorMut<'a, T, 3>

Output tensor — shape [B, H_q, D].

Auto Trait Implementations§

§

impl<'a, T> !UnwindSafe for FlashDecodingArgs<'a, T>

§

impl<'a, T> Freeze for FlashDecodingArgs<'a, T>

§

impl<'a, T> RefUnwindSafe for FlashDecodingArgs<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for FlashDecodingArgs<'a, T>
where T: Sync + Send,

§

impl<'a, T> Sync for FlashDecodingArgs<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for FlashDecodingArgs<'a, T>

§

impl<'a, T> UnsafeUnpin for FlashDecodingArgs<'a, T>

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.

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