pub struct Layout {
pub numerics: EngineNumerics,
pub tensors: Vec<Placed>,
pub rotary: Vec<(Rope, u64)>,
pub ctx: usize,
pub regions: u64,
pub region: u64,
pub sequences: usize,
pub blocks: Vec<BlockState>,
pub bytes: u64,
}Expand description
The card’s memory as a machine lays it out.
Fields§
§numerics: EngineNumerics§tensors: Vec<Placed>Every tensor the program reads, in Program::tensors order.
rotary: Vec<(Rope, u64)>Every rotary table the program turns heads by, in Program::ropes order, each at its address: per position,
dims/2 cosines then dims/2 sines, f32.
ctx: usizePositions every sequence may reach.
regions: u64Where the sequences’ regions start, each region bytes, sequences of them.
region: u64§sequences: usize§blocks: Vec<BlockState>Each layer’s place in a region.
bytes: u64Implementations§
Source§impl Layout
impl Layout
Sourcepub fn of(
spec: &ModelSpec,
numerics: EngineNumerics,
program: &Program,
source: &dyn WeightSource,
sequences: usize,
ctx: usize,
) -> Result<Layout, EngineError>
pub fn of( spec: &ModelSpec, numerics: EngineNumerics, program: &Program, source: &dyn WeightSource, sequences: usize, ctx: usize, ) -> Result<Layout, EngineError>
The memory of sequences sequences of spec at numerics, each reaching ctx positions, over the tensors
program reads from source.
Trait Implementations§
impl StructuralPartialEq for Layout
Auto Trait Implementations§
impl Freeze for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnsafeUnpin for Layout
impl UnwindSafe for Layout
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
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.