pub enum View {
Same,
Transposed,
NeoxPairs {
head_dim: usize,
from: usize,
dims: usize,
transpose: bool,
},
RowRange {
first: usize,
count: usize,
transpose: bool,
},
HeadPart {
stride: usize,
offset: usize,
width: usize,
transpose: bool,
},
HeadBlocks {
stride: usize,
offset: usize,
width: usize,
},
FusedPart {
first: usize,
count: usize,
head_dim: usize,
dims: usize,
bias: bool,
},
}Expand description
How a declared weight is read out of its tensor.
Variants§
Same
The tensor’s elements in order.
Transposed
The tensor’s out × in rows as an in × out matrix.
NeoxPairs
Within every head of head_dim rows (or elements), the dims rotated ones from from reordered from
interleaved pairs to halves; then transposed when transpose.
RowRange
Rows first .. first + count, then transposed when transpose.
HeadPart
In every group of stride rows, the width rows starting at offset — one part of every head — then
transposed when transpose.
HeadBlocks
In every group of stride rows, the width rows starting at offset — one head’s block — each block
transposed on its own and the transposes stacked: the weight of a per-head matmul whose checkpoint rows are
each head’s outputs.
FusedPart
One part of a fused query-key-value projection: rows first .. first + count of its weight, read transposed, or
elements first .. first + count of its bias (bias); within the part, each head of head_dim with its first
dims dimensions reordered from interleaved pairs to halves (none when dims is 0).
Implementations§
Source§impl View
impl View
Sourcepub fn declared(&self, inner: usize, rows: usize) -> (usize, usize)
pub fn declared(&self, inner: usize, rows: usize) -> (usize, usize)
The rows × cols layout the view reads a tensor of rows rows of inner elements into: the layout the program
declares the weight.
Sourcepub fn keeps_blocks_down_rows(&self) -> bool
pub fn keeps_blocks_down_rows(&self) -> bool
Whether the view lays each checkpoint row down a declared column, so a Q8_0 tensor’s blocks run down the declared
rows: the layout a spatial program reads a Q8_0 weight in (q8_planes).
Trait Implementations§
impl Eq for View
impl StructuralPartialEq for View
Auto Trait Implementations§
impl Freeze for View
impl RefUnwindSafe for View
impl Send for View
impl Sync for View
impl Unpin for View
impl UnsafeUnpin for View
impl UnwindSafe for View
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§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>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.