pub struct GroupLayout {
pub num_layers: u32,
pub num_blocks: u32,
pub num_kv_heads: u16,
pub group_stride: u64,
pub fs_block_size: u64,
}Fields§
§num_layers: u32§num_blocks: u32§num_kv_heads: u16§group_stride: u64block_size × head_dim × elem_bytes, rounded up to fs_block_size.
fs_block_size: u64Filesystem block size (4 KiB on most NVMe). Group stride is a multiple.
Implementations§
Source§impl GroupLayout
impl GroupLayout
pub fn new( num_layers: u32, num_blocks: u32, num_kv_heads: u16, block_size: u32, head_dim: u32, elem_bytes: u32, fs_block_size: u64, ) -> Self
Sourcepub fn bytes_per_layer(&self) -> u64
pub fn bytes_per_layer(&self) -> u64
Bytes occupied by one full layer in its file (K + V across all blocks).
Sourcepub fn file_offset(&self, key: GroupKey) -> u64
pub fn file_offset(&self, key: GroupKey) -> u64
File offset for key within its layer’s file.
Sourcepub fn group_bytes(&self) -> u64
pub fn group_bytes(&self) -> u64
Number of bytes a single group occupies on disk (== group_stride).
Sourcepub fn block_bytes(&self) -> u64
pub fn block_bytes(&self) -> u64
Bytes in one full block: K + V across all kv-heads, each a
group_stride-pitch group. This is the contiguous unit the
block-granular StorageBackend ops read/write in one operation.
Trait Implementations§
Source§impl Clone for GroupLayout
impl Clone for GroupLayout
Source§fn clone(&self) -> GroupLayout
fn clone(&self) -> GroupLayout
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 Debug for GroupLayout
impl Debug for GroupLayout
impl Copy for GroupLayout
Auto Trait Implementations§
impl Freeze for GroupLayout
impl RefUnwindSafe for GroupLayout
impl Send for GroupLayout
impl Sync for GroupLayout
impl Unpin for GroupLayout
impl UnwindSafe for GroupLayout
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