Skip to main content

TileArg

Struct TileArg 

Source
pub struct TileArg<'a> {
    pub spec: TileSpec,
    pub element: ElemType,
    /* private fields */
}
Expand description

An operand as a single launch argument: its values, a buffer or a TMA tensor map, its comptime TileSpec, the element its buffer holds, and the scales they are read under.

The element is data the argument carries, stated where the operand is bound (TileArgLaunch::new), not a type of the kernel’s: what the buffer holds, width of them a line. A packed buffer holds u32 words, its spec’s packing naming the fields in them; a reader decodes them into the element it asks for (Tile::dequantized), or f32 where it asks for none.

Scales are levels innermost first, so each covers more than the one inside it: NVFP4’s values carry their block scales, which carry the per-tensor scale. A plain level holding u32 is words of block scales, which only the block-scaled instruction reads; any other, a packed one included, is scales read as numbers.

Values stored as indices (Field::Index) read through the table they index, their codebook (TileArgLaunch::codebook); a gather’s runtime coefficients and offsets (TileArgLaunch::runtime_map) ride the argument too, as does the table that places their windows (TileArgLaunch::indexed), a routed product’s experts or a pool’s pages. A kernel serves every operand the same way, with tile.

Fields§

§spec: TileSpec§element: ElemType

The element the buffer holds.

Implementations§

Source§

impl<'a> TileArg<'a>

Source

pub fn last_arrival<'t, V: Size>( &self, partitioning: &Partitioning, portion: &Portion, i: usize, arrivals: &'t [Atomic<u32>], ) -> LastArrival<'t>

This operand as the slots of a LastArrival at the i-th box portion touches, under partitioning, whose cube level shares its steps (shared_by). The operand is laid out as Partitioning::arrival_slots says for its axes.

Source

pub fn __expand_last_arrival<'infer, 't, 'scope, V: Size>( scope: &'scope Scope, this: &'infer <Self as CubeType>::ExpandType, partitioning: &'infer <Partitioning as CubeType>::ExpandType, portion: &'infer <Portion as CubeType>::ExpandType, i: <usize as CubeType>::ExpandType, arrivals: &'t <[Atomic<u32>] as CubeType>::ExpandType, ) -> <LastArrival<'t> as CubeType>::ExpandType

This operand as the slots of a LastArrival at the i-th box portion touches, under partitioning, whose cube level shares its steps (shared_by). The operand is laid out as Partitioning::arrival_slots says for its axes.

Source§

impl<'a> TileArg<'a>

Source

pub fn relay<'t, V: Size>( &self, partitioning: &Partitioning, turns: &'t [Atomic<u32>], ) -> Relay<'t>

This operand as the carry of a Relay: the box the cubes splitting the contraction along its across axis take their turns at, under partitioning, whose first level is the cube level. turns arrives holding zero and is left holding zero.

Source

pub fn __expand_relay<'infer, 't, 'scope, V: Size>( scope: &'scope Scope, this: &'infer <Self as CubeType>::ExpandType, partitioning: &'infer <Partitioning as CubeType>::ExpandType, turns: &'t <[Atomic<u32>] as CubeType>::ExpandType, ) -> <Relay<'t> as CubeType>::ExpandType

This operand as the carry of a Relay: the box the cubes splitting the contraction along its across axis take their turns at, under partitioning, whose first level is the cube level. turns arrives holding zero and is left holding zero.

Source§

impl TileArg<'_>

Source

pub fn tile(&self, _partitioning: &Partitioning) -> Tile

Serve the operand as a Tile over the kernel’s one partitioning, under its scales.

Source

pub fn lines<E: Numeric, V: Size>(&self) -> &Tensor<Vector<E, V>> ⓘ

The buffer as lines of V of E, which must be the element it holds and the width it is bound at: what a write that adds into a line reads and writes it as. A launch that bound the buffer at another element is refused as the kernel expands.

Trait Implementations§

Source§

impl<'a> CubeType for TileArg<'a>

Source§

type ExpandType = TileArgExpand<'a>

Source§

impl LaunchArg for TileArg<'static>

Source§

type RuntimeArg = TileArgLaunch

The runtime argument for the kernel.
Source§

type CompilationArg = TileArgCompilationArg

Compilation argument.
Source§

fn register( arg: Self::RuntimeArg, launcher: &mut KernelLauncher, ) -> Self::CompilationArg

Source§

fn expand( arg: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> TileArgExpand<'static>

Register a variable during compilation that fill the KernelBuilder.

Auto Trait Implementations§

§

impl<'a> Freeze for TileArg<'a>

§

impl<'a> RefUnwindSafe for TileArg<'a>

§

impl<'a> Send for TileArg<'a>

§

impl<'a> Sync for TileArg<'a>

§

impl<'a> Unpin for TileArg<'a>

§

impl<'a> UnsafeUnpin for TileArg<'a>

§

impl<'a> UnwindSafe for TileArg<'a>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

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> IntoComptime for T

Source§

fn comptime(self) -> Self

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ViewLayoutLaunchArg for T
where T: LaunchArg + Send + Sync,

Source§

type RuntimeArg = <T as LaunchArg>::RuntimeArg

The runtime argument for the kernel.
Source§

type CompilationArg = <T as LaunchArg>::CompilationArg

Compilation argument.
Source§

fn register<B>( arg: <T as ViewLayoutLaunchArg>::RuntimeArg, _buffer: &B, _ty: Type, launcher: &mut KernelLauncher, ) -> <T as ViewLayoutLaunchArg>::CompilationArg
where B: MemoryArg,

Source§

fn expand( arg: &<T as ViewLayoutLaunchArg>::CompilationArg, _ty: Type, builder: &mut KernelBuilder, ) -> <T as CubeType>::ExpandType

Register an input variable during compilation that fill the KernelBuilder.
Source§

fn expand_output( arg: &Self::CompilationArg, ty: Type, builder: &mut KernelBuilder, ) -> Self::ExpandType

Register an output variable during compilation that fill the KernelBuilder.
Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more