TiledAttention

Struct TiledAttention 

Source
pub struct TiledAttention {
    pub m_state: DeviceBuffer,
    pub l_state: DeviceBuffer,
    pub o_state: DeviceBuffer,
    /* private fields */
}

Fields§

§m_state: DeviceBuffer§l_state: DeviceBuffer§o_state: DeviceBuffer

Implementations§

Source§

impl TiledAttention

Source

pub fn new(dims: TiledAttentionDims) -> Result<Self>

Source

pub fn begin_step(&self, ctx: &CudaCtx, num_seqs: usize) -> Result<()>

2026-09-25: Set (m, l, o) of the first num_seqs sequences to (-inf, 0, 0) on ctx.stream, before the step’s first step_tile.

§Errors

num_seqs > max_seqs, or a cuMemsetD32Async fails.

Source

pub fn begin_step_on_stream(&self, stream: u64, num_seqs: usize) -> Result<()>

Source

pub fn paged_strides(&self) -> (i64, i64, i64)

2026-09-25: (blk, tok, kvh) strides, in BF16 elements, of the paged K/V layout [num_blocks, block_size, num_kv_heads, head_dim].

Source

pub fn scratch_pool_strides(&self) -> (i64, i64, i64)

2026-09-25: (blk, tok, kvh) strides, in BF16 elements, of the scratch pool slot layout [slot, K|V, kv_head, block_size, head_dim].

Source

pub fn step_tile( &self, ctx: &CudaCtx, q: u64, k_pool: u64, v_pool: u64, tile_blocks: u64, tile_block_counts: u64, num_seqs: usize, blk_stride: i64, tok_stride: i64, kvh_stride: i64, last_block_valid_slots: i32, ) -> Result<()>

2026-09-25: One tile of KV blocks for num_seqs sequences, folded into the running state. The strides select the K/V layout; see paged_strides and scratch_pool_strides.

Source

pub fn step_tile_on_stream( &self, stream: u64, q: u64, k_pool: u64, v_pool: u64, tile_blocks: u64, tile_block_counts: u64, num_seqs: usize, blk_stride: i64, tok_stride: i64, kvh_stride: i64, last_block_valid_slots: i32, ) -> Result<()>

Source

pub fn finalize( &self, ctx: &CudaCtx, output: u64, num_seqs: usize, ) -> Result<()>

2026-09-25: Write o_state / l_state for num_seqs sequences to output as BF16, 0 where l is 0.

Source

pub fn finalize_on_stream( &self, stream: u64, output: u64, num_seqs: usize, ) -> Result<()>

Source

pub fn dims(&self) -> TiledAttentionDims

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