pub enum WeightBytes {
Owned(Vec<u8>),
Mapped {
mmap: Arc<Mmap>,
range: Range<usize>,
},
Shared {
buf: Arc<Vec<u8>>,
range: Range<usize>,
},
}Expand description
Backing storage for a quantized weight matrix’s raw bytes: either an
owned buffer (synthetic/test weights, or any tensor that had to be
copied for some other reason) or a zero-copy view into a shared
memory-mapped GGUF file. This is the fix for the “loader read
everything into a fresh Vec
Variants§
Owned(Vec<u8>)
Mapped
A sub-range of a shared, lease-style buffer (e.g. one matrix
inside an ferrox_core::expert_store::ExpertLease’s combined
gate/up/down bytes). Holding the Arc here is exactly what
makes the store’s lease pinning structural: as long as any
WeightMatrix built over these bytes is alive, the cache entry’s
strong count stays >1 and eviction cannot reuse it.
Implementations§
Auto Trait Implementations§
impl Freeze for WeightBytes
impl RefUnwindSafe for WeightBytes
impl Send for WeightBytes
impl Sync for WeightBytes
impl Unpin for WeightBytes
impl UnsafeUnpin for WeightBytes
impl UnwindSafe for WeightBytes
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more