QuantizedView

Struct QuantizedView 

Source
pub struct QuantizedView<Q: CubePrimitive, S: CubePrimitive, F: Numeric, C: Coordinates + 'static> { /* private fields */ }
Expand description

View that dequantizes after loads. Scales layout should take values coordinates and map them to the corresponding scale.

§Warning

Assumes only one scale maps to a single load. Adjust line size of values or block size to ensure this. Must ensure block_size.is_multiple_of(line_size * scheme.num_quants()).

Implementations§

Source§

impl<Q: CubePrimitive, S: CubePrimitive, F: Numeric, C: Coordinates + 'static> QuantizedView<Q, S, F, C>

Source

pub fn new( values: View<Line<Q>, C>, scales: View<S, C>, scheme: QuantScheme, ) -> Self

Source

pub fn __expand_new( scope: &mut Scope, values: <View<Line<Q>, C> as CubeType>::ExpandType, scales: <View<S, C> as CubeType>::ExpandType, scheme: QuantScheme, ) -> <Self as CubeType>::ExpandType

Source§

impl<Q: CubePrimitive, S: CubePrimitive, F: Numeric, C: Coordinates + 'static> QuantizedView<Q, S, F, C>

Source

pub fn view(self) -> View<Line<F>, C>

Source

pub fn __expand_view( scope: &mut Scope, this: QuantizedViewExpand<Q, S, F, C>, ) -> ViewExpand<Line<F>, C, ReadOnly>

Trait Implementations§

Source§

impl<Q: Clone + CubePrimitive, S: Clone + CubePrimitive, F: Clone + Numeric, C: Clone + Coordinates + 'static> Clone for QuantizedView<Q, S, F, C>

Source§

fn clone(&self) -> QuantizedView<Q, S, F, C>

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<Q: CubePrimitive, S: CubePrimitive, F: Numeric, C: Coordinates + 'static> CubeType for QuantizedView<Q, S, F, C>

Source§

type ExpandType = QuantizedViewExpand<Q, S, F, C>

Source§

fn into_mut(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType

Wrapper around the init method, necessary to type inference.
Source§

impl<Q: CubePrimitive, S: CubePrimitive, F: Numeric, C: Coordinates + 'static> LaunchArg for QuantizedView<Q, S, F, C>

Source§

type RuntimeArg<'a, R: Runtime> = QuantizedViewLaunch<'a, Q, S, F, C, R>

The runtime argument for the kernel.
Source§

type CompilationArg = QuantizedViewCompilationArg<Q, S, F, C>

Compilation argument.
Source§

fn compilation_arg<'a, R: Runtime>( runtime_arg: &Self::RuntimeArg<'a, R>, ) -> Self::CompilationArg

Source§

fn expand( arg: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> <Self as CubeType>::ExpandType

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

fn expand_output( arg: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> <Self as CubeType>::ExpandType

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

impl<Q: CubePrimitive, S: CubePrimitive, F: Numeric, C: Coordinates + 'static> Lined for QuantizedView<Q, S, F, C>

Source§

fn line_size(&self) -> u32

Source§

fn __expand_line_size(_scope: &mut Scope, this: Self::ExpandType) -> u32

Source§

impl<Q: CubePrimitive, S: CubePrimitive, F: Numeric, C: Coordinates + 'static> ViewOperations<Line<F>, C> for QuantizedView<Q, S, F, C>

Source§

fn read(&self, pos: C) -> T

Source§

fn read_checked(&self, pos: C) -> T

Source§

fn read_masked(&self, pos: C, value: T) -> T

Source§

fn read_unchecked(&self, pos: C) -> T

Source§

fn to_linear_slice(&self, pos: C, size: C) -> Slice<T, ReadOnly>

Create a slice starting from pos, with size. The layout handles translation into concrete indices.
Source§

fn as_tensor_map(&self) -> CubeOption<TensorMap<T>>

Source§

fn tensor_map_load( &self, barrier: &Barrier, shared_memory: &mut Slice<T, ReadWrite>, pos: C, )

.Execute a TMA load into shared memory, if the underlying storage supports it. Panics if it’s unsupported.
Source§

fn shape(&self) -> C

Source§

fn is_in_bounds(&self, pos: C) -> bool

Source§

fn __expand_read( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, ) -> <T as CubeType>::ExpandType

Source§

fn __expand_read_checked( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, ) -> <T as CubeType>::ExpandType

Source§

fn __expand_read_masked( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, value: <T as CubeType>::ExpandType, ) -> <T as CubeType>::ExpandType

Source§

fn __expand_read_unchecked( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, ) -> <T as CubeType>::ExpandType

Source§

fn __expand_to_linear_slice( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, size: <C as CubeType>::ExpandType, ) -> <Slice<T, ReadOnly> as CubeType>::ExpandType

Source§

fn __expand_as_tensor_map( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <CubeOption<TensorMap<T>> as CubeType>::ExpandType

Source§

fn __expand_tensor_map_load( scope: &mut Scope, this: <Self as CubeType>::ExpandType, barrier: <Barrier as CubeType>::ExpandType, shared_memory: <Slice<T, ReadWrite> as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, ) -> <() as CubeType>::ExpandType

Source§

fn __expand_shape( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <C as CubeType>::ExpandType

Source§

fn __expand_is_in_bounds( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, ) -> <bool as CubeType>::ExpandType

Source§

impl<Q: Copy + CubePrimitive, S: Copy + CubePrimitive, F: Copy + Numeric, C: Copy + Coordinates + 'static> Copy for QuantizedView<Q, S, F, C>

Auto Trait Implementations§

§

impl<Q, S, F, C> Freeze for QuantizedView<Q, S, F, C>

§

impl<Q, S, F, C> RefUnwindSafe for QuantizedView<Q, S, F, C>

§

impl<Q, S, F, C> Send for QuantizedView<Q, S, F, C>

§

impl<Q, S, F, C> Sync for QuantizedView<Q, S, F, C>

§

impl<Q, S, F, C> Unpin for QuantizedView<Q, S, F, C>
where F: Unpin, C: Unpin, S: Unpin, Q: Unpin,

§

impl<Q, S, F, C> UnwindSafe for QuantizedView<Q, S, F, C>

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

Source§

fn vzip(self) -> V