Skip to main content

TilingConfig

Struct TilingConfig 

Source
pub struct TilingConfig {
    pub name: String,
    pub macro_tile: TcbGeometry,
    pub midi_tile: TcbGeometry,
    pub micro_tile: TcbGeometry,
    pub backend: TilingBackend,
}
Expand description

Complete tiling configuration for a kernel

Contains geometry for all three tiling levels, enabling hierarchical cache-aware execution.

Fields§

§name: String

Kernel name for identification

§macro_tile: TcbGeometry

Macro-tile geometry (L3/Global)

§midi_tile: TcbGeometry

Midi-tile geometry (L2/Shared)

§micro_tile: TcbGeometry

Micro-tile geometry (Registers)

§backend: TilingBackend

Target backend

Implementations§

Source§

impl TilingConfig

Source

pub fn gpu_q4k_matvec() -> Self

Create configuration for GPU Q4_K MatVec

Optimized for single-token generation where M=1.

Source

pub fn gpu_q4k_matmul() -> Self

Create configuration for GPU Q4_K MatMul (batched)

Optimized for prefill where M > 1.

Source

pub fn gpu_softmax() -> Self

Create configuration for GPU Softmax

Source

pub fn cpu_avx512_matmul() -> Self

Create configuration for CPU AVX-512 MatMul

Optimized for 512-bit wide SIMD:

  • 16 floats per ZMM register
  • 32 ZMM registers available
  • 4×16 micro-kernel uses 8 registers (4 accumulators + 4 scratch)
Source

pub fn cpu_avx512_q4k_matvec() -> Self

Create configuration for CPU AVX-512 Q4K MatVec

Optimized for Q4_K quantized inference with 512-bit SIMD. Key differences from AVX2:

  • 64-byte aligned for cache line optimization
  • 4×1 micro-kernel processes 4 rows simultaneously
  • K=256 aligned to Q4_K superblock
Source

pub fn cpu_avx512_vnni_q4k_q8k() -> Self

Create configuration for AVX-512 VNNI Q4K×Q8K integer dot product

AVX-512 VNNI (Vector Neural Network Instructions) provides:

  • VPDPBUSD: 8-bit unsigned × 8-bit signed multiply-add to i32
  • VPDPWSSD: 16-bit signed × 16-bit signed multiply-add to i32

This enables pure integer Q4K×Q8K without intermediate f32 conversion.

Source

pub fn cpu_avx2_matmul() -> Self

Create configuration for CPU AVX2 MatMul

Source

pub fn cpu_avx2_q4k_matvec() -> Self

Create configuration for CPU Q4_K MatVec (AVX2)

Source

pub fn cpu_rmsnorm() -> Self

Create configuration for RMSNorm (CPU)

Source

pub fn validate(&self) -> Result<(), TilingError>

Validate that tiling configuration is internally consistent

Source

pub fn num_macro_tiles(&self, m: u32, n: u32) -> u32

Calculate total number of macro-tiles for given problem size

Source

pub fn midi_tiles_per_macro(&self) -> u32

Calculate total number of midi-tiles within a macro-tile

Source

pub fn micro_tiles_per_midi(&self) -> u32

Calculate total number of micro-tiles within a midi-tile

Trait Implementations§

Source§

impl Clone for TilingConfig

Source§

fn clone(&self) -> TilingConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TilingConfig

Source§

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

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

impl<'de> Deserialize<'de> for TilingConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for TilingConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,