pub struct DerivedStore { /* private fields */ }Expand description
Device buffers a loader derived from this store’s tensors.
Implementations§
Source§impl DerivedStore
impl DerivedStore
Sourcepub fn adopt(&self, label: &'static str, ptr: DevicePtr, bytes: usize)
pub fn adopt(&self, label: &'static str, ptr: DevicePtr, bytes: usize)
Take ownership of a derived buffer.
label is a static category (“ssm qkvz fp8 concat”, “attn fp8 twin”),
not a per-tensor name: the report aggregates, and a String per buffer
would allocate once per layer per twin for text nobody reads per entry.
Sourcepub fn disown(&self, ptr: DevicePtr) -> Option<usize>
pub fn disown(&self, ptr: DevicePtr) -> Option<usize>
Give up ownership of a buffer the caller is about to free itself.
The transient half of a fused concat is adopted by the generic loader
that produced it and then freed by the loader that consumed it
(qwen35_dense.rs, the GDN [QKV|Z] arm). Without this the pointer
would be freed twice — once there, once at teardown. Returns the bytes
that left the ledger, or None if this store never held it.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn by_label(&self) -> Vec<(&'static str, usize, usize)>
pub fn by_label(&self) -> Vec<(&'static str, usize, usize)>
label -> (bytes, count), biggest first, for the residency summary.
Sourcepub fn release(&self, gpu: &dyn GpuBackend) -> Result<()>
pub fn release(&self, gpu: &dyn GpuBackend) -> Result<()>
Free everything adopted. Drains first, so a failure part-way through cannot leave a freed pointer in the list to be freed again.