pub enum WeightDtype {
BF16,
FP32,
FP8E4M3,
FP8E8M0,
UInt8,
Int64,
PackedQ2_0 {
group: u16,
},
}Expand description
Data type of a weight tensor.
Variants§
BF16
FP32
FP8E4M3
FP8E8M0
UInt8
Int64
PackedQ2_0
Keep-packed PrismML ternary Q2_0 (ggml id 42): raw on-disk blocks stay
2-bit in VRAM (fp16 scale + 2-bit codes per group of group elements),
dequantized in-kernel by the native q2_0_gemv decode path. Only
produced by the GGUF loader under ATLAS_GGUF_NATIVE_Q2=1. Its byte
footprint is NOT a per-element size (2-bit codes + an inline scale per
group), so WeightDtype::byte_size returns 0 for this variant and the
real size is computed in WeightTensor::byte_size (shape + group).
Implementations§
Source§impl WeightDtype
impl WeightDtype
Sourcepub fn byte_size(self) -> usize
pub fn byte_size(self) -> usize
Bytes per element for the fixed-width dtypes. Returns 0 for the
block-based WeightDtype::PackedQ2_0 — WeightTensor::byte_size
handles that variant directly, and no caller multiplies its numel by this.
Sourcepub fn from_safetensors_str(s: &str) -> Result<Self>
pub fn from_safetensors_str(s: &str) -> Result<Self>
Map a raw safetensors header dtype STRING (as it appears in the JSON
header, e.g. "BF16", "F8_E4M3") to a WeightDtype, factored out
so the RDMA weight loader (which receives dtype as a wire string in the
peer manifest, not a safetensors::Dtype) resolves it identically to
the disk loaders — byte-identity depends on the two ends agreeing.
Trait Implementations§
Source§impl Clone for WeightDtype
impl Clone for WeightDtype
Source§fn clone(&self) -> WeightDtype
fn clone(&self) -> WeightDtype
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WeightDtype
impl Debug for WeightDtype
Source§impl PartialEq for WeightDtype
impl PartialEq for WeightDtype
impl Copy for WeightDtype
impl Eq for WeightDtype
impl StructuralPartialEq for WeightDtype
Auto Trait Implementations§
impl Freeze for WeightDtype
impl RefUnwindSafe for WeightDtype
impl Send for WeightDtype
impl Sync for WeightDtype
impl Unpin for WeightDtype
impl UnwindSafe for WeightDtype
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.