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: u642026-09-25: block_size × head_dim × elem_bytes, rounded up to a
multiple of fs_block_size.
fs_block_size: u642026-09-25: The alignment unit group_stride is padded to.
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
2026-09-25: Bytes of one layer’s file: K and V of every block and kv_head.
Sourcepub fn file_offset(&self, key: GroupKey) -> u64
pub fn file_offset(&self, key: GroupKey) -> u64
2026-09-25: Offset of key within its layer’s file. Debug builds assert
that block and kv_head are inside the layout.
Sourcepub fn group_id(&self, key: GroupKey) -> GroupId
pub fn group_id(&self, key: GroupKey) -> GroupId
2026-09-25: Dense GroupId for key across all layers.
Sourcepub fn group_bytes(&self) -> u64
pub fn group_bytes(&self) -> u64
2026-09-25: Bytes one group occupies on disk: group_stride.
Sourcepub fn block_bytes(&self) -> u64
pub fn block_bytes(&self) -> u64
2026-09-25: Bytes in one block: K and V of every kv_head, each at
group_stride pitch. The unit of the StorageBackend block methods.
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