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>
 
impl<Q: CubePrimitive, S: CubePrimitive, F: Numeric, C: Coordinates + 'static> QuantizedView<Q, S, F, C>
pub fn new( values: View<Line<Q>, C>, scales: View<S, C>, scheme: QuantScheme, ) -> Self
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>
 
impl<Q: CubePrimitive, S: CubePrimitive, F: Numeric, C: Coordinates + 'static> QuantizedView<Q, S, F, C>
pub fn view(self) -> View<Line<F>, C>
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>
 
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>
 
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)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moreSource§impl<Q: CubePrimitive, S: CubePrimitive, F: Numeric, C: Coordinates + 'static> CubeType for QuantizedView<Q, S, F, C>
 
impl<Q: CubePrimitive, S: CubePrimitive, F: Numeric, C: Coordinates + 'static> CubeType for QuantizedView<Q, S, F, C>
type ExpandType = QuantizedViewExpand<Q, S, F, C>
Source§fn into_mut(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType
 
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>
 
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>
 
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>
 
type CompilationArg = QuantizedViewCompilationArg<Q, S, F, C>
Compilation argument.
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
 
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
 
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>
 
impl<Q: CubePrimitive, S: CubePrimitive, F: Numeric, C: Coordinates + 'static> Lined for QuantizedView<Q, S, F, C>
fn line_size(&self) -> u32
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>
 
impl<Q: CubePrimitive, S: CubePrimitive, F: Numeric, C: Coordinates + 'static> ViewOperations<Line<F>, C> for QuantizedView<Q, S, F, C>
fn read(&self, pos: C) -> T
fn read_checked(&self, pos: C) -> T
fn read_masked(&self, pos: C, value: T) -> T
fn read_unchecked(&self, pos: C) -> T
Source§fn to_linear_slice(&self, pos: C, size: C) -> Slice<T, ReadOnly>
 
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.fn as_tensor_map(&self) -> CubeOption<TensorMap<T>>
Source§fn tensor_map_load(
    &self,
    barrier: &Barrier,
    shared_memory: &mut Slice<T, ReadWrite>,
    pos: C,
)
 
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.
fn shape(&self) -> C
fn is_in_bounds(&self, pos: C) -> bool
fn __expand_read( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, ) -> <T as CubeType>::ExpandType
fn __expand_read_checked( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, ) -> <T as CubeType>::ExpandType
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
fn __expand_read_unchecked( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, ) -> <T as CubeType>::ExpandType
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
fn __expand_as_tensor_map( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <CubeOption<TensorMap<T>> as CubeType>::ExpandType
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
fn __expand_shape( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <C as CubeType>::ExpandType
fn __expand_is_in_bounds( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, ) -> <bool as CubeType>::ExpandType
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>
impl<Q, S, F, C> UnwindSafe for QuantizedView<Q, S, F, C>
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
Mutably borrows from an owned value. Read more