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: ElemTypeThe element the buffer holds.
Implementations§
Source§impl<'a> TileArg<'a>
impl<'a> TileArg<'a>
Sourcepub fn last_arrival<'t, V: Size>(
&self,
partitioning: &Partitioning,
portion: &Portion,
i: usize,
arrivals: &'t [Atomic<u32>],
) -> LastArrival<'t>
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.
Sourcepub 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
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>
impl<'a> TileArg<'a>
Sourcepub fn relay<'t, V: Size>(
&self,
partitioning: &Partitioning,
turns: &'t [Atomic<u32>],
) -> Relay<'t>
pub fn relay<'t, V: Size>( &self, partitioning: &Partitioning, turns: &'t [Atomic<u32>], ) -> Relay<'t>
Sourcepub 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
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
Source§impl TileArg<'_>
impl TileArg<'_>
Sourcepub fn tile(&self, _partitioning: &Partitioning) -> Tile
pub fn tile(&self, _partitioning: &Partitioning) -> Tile
Serve the operand as a Tile over the kernel’s one partitioning, under its scales.
Sourcepub fn lines<E: Numeric, V: Size>(&self) -> &Tensor<Vector<E, V>> ⓘ
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 LaunchArg for TileArg<'static>
impl LaunchArg for TileArg<'static>
Source§type RuntimeArg = TileArgLaunch
type RuntimeArg = TileArgLaunch
Source§type CompilationArg = TileArgCompilationArg
type CompilationArg = TileArgCompilationArg
fn register( arg: Self::RuntimeArg, launcher: &mut KernelLauncher, ) -> Self::CompilationArg
Source§fn expand(
arg: &Self::CompilationArg,
builder: &mut KernelBuilder,
) -> TileArgExpand<'static>
fn expand( arg: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> TileArgExpand<'static>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ViewLayoutLaunchArg for T
impl<T> ViewLayoutLaunchArg for T
Source§type RuntimeArg = <T as LaunchArg>::RuntimeArg
type RuntimeArg = <T as LaunchArg>::RuntimeArg
Source§type CompilationArg = <T as LaunchArg>::CompilationArg
type CompilationArg = <T as LaunchArg>::CompilationArg
fn register<B>(
arg: <T as ViewLayoutLaunchArg>::RuntimeArg,
_buffer: &B,
_ty: Type,
launcher: &mut KernelLauncher,
) -> <T as ViewLayoutLaunchArg>::CompilationArgwhere
B: MemoryArg,
Source§fn expand(
arg: &<T as ViewLayoutLaunchArg>::CompilationArg,
_ty: Type,
builder: &mut KernelBuilder,
) -> <T as CubeType>::ExpandType
fn expand( arg: &<T as ViewLayoutLaunchArg>::CompilationArg, _ty: Type, builder: &mut KernelBuilder, ) -> <T as CubeType>::ExpandType
KernelBuilder.Source§fn expand_output(
arg: &Self::CompilationArg,
ty: Type,
builder: &mut KernelBuilder,
) -> Self::ExpandType
fn expand_output( arg: &Self::CompilationArg, ty: Type, builder: &mut KernelBuilder, ) -> Self::ExpandType
KernelBuilder.