pub struct StoreLayout {
pub rows: usize,
pub slots: Vec<(u32, u32)>,
pub beats: u32,
pub greedy: bool,
}Expand description
The token-row store as the engine holds it: beats of LANES f32 elements, slot s’s row r from beat
base + r·beats of its entry, every slot wide enough for the widest vector the step’s jobs write to it, and two
slots over the same beats only when no point of the step holds both. A greedy store (StoreLayout::greedy) keeps
each row’s logits as their arg-max.
Fields§
§rows: usize§slots: Vec<(u32, u32)>Per slot code: the slot’s first beat and its beats a row.
beats: u32§greedy: boolWhether the logits slot holds each row’s arg-max in place of its logits.
Implementations§
Source§impl StoreLayout
impl StoreLayout
Sourcepub fn of(jobs: &[Job], layout: &Layout, rows: usize) -> StoreLayout
pub fn of(jobs: &[Job], layout: &Layout, rows: usize) -> StoreLayout
The store jobs write over rows rows, each slot’s width the widest any job writes to it, each slot at the
lowest beat no slot live beside it holds (StoreLayout::live_together), the widest first — or, where that
leaves a row longer than the most beats a point of the step holds together (StoreLayout::widest), in the first
order of a fixed sequence of them that lays the row that short, the shortest of them all if none does.
Sourcepub fn greedy(jobs: &[Job], layout: &Layout, rows: usize) -> StoreLayout
pub fn greedy(jobs: &[Job], layout: &Layout, rows: usize) -> StoreLayout
StoreLayout::of with the head’s read-out never in the store: the logits slot is a beat a row, its first lane
the index numerics::argmax picks of the row’s logits and its second that logit’s
bits, so the store holds what a greedy step reads back however wide the vocabulary.
Sourcepub fn widest(&self, jobs: &[Job]) -> u32
pub fn widest(&self, jobs: &[Job]) -> u32
The most beats a row of the store holds at any point of the step jobs, the store laid for: the widest set of its
slots a job reads, writes or holds live across it (StoreLayout::live_together) — no layout’s row is shorter.
Sourcepub fn live_together(jobs: &[Job]) -> Vec<u32>
pub fn live_together(jobs: &[Job]) -> Vec<u32>
For each slot code, the slots some point of the step jobs holds beside it, as a mask of slot codes: those a
job reads or writes, and those live across it (StoreLayout::live_out).
Sourcepub fn live_out(jobs: &[Job]) -> Vec<u32>
pub fn live_out(jobs: &[Job]) -> Vec<u32>
For each job of the step jobs, the slots live out of it, as a mask of slot codes. A slot is live from a job
that makes it afresh to the last job that reads it before it is made again, the step taken round (the next step
follows it, and the host reads the logits after its last job); a job that writes a slot in part leaves it live.
Trait Implementations§
Source§impl Clone for StoreLayout
impl Clone for StoreLayout
Source§fn clone(&self) -> StoreLayout
fn clone(&self) -> StoreLayout
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StoreLayout
impl Debug for StoreLayout
Source§impl PartialEq for StoreLayout
impl PartialEq for StoreLayout
impl StructuralPartialEq for StoreLayout
Auto Trait Implementations§
impl Freeze for StoreLayout
impl RefUnwindSafe for StoreLayout
impl Send for StoreLayout
impl Sync for StoreLayout
impl Unpin for StoreLayout
impl UnsafeUnpin for StoreLayout
impl UnwindSafe for StoreLayout
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.