pub struct MixedPrecisionPlan {
pub config: MixedPrecisionConfig,
pub rows: u32,
pub cols: u32,
pub nnz: u64,
pub values_bytes: u64,
pub values_bytes_full: u64,
}Expand description
Pre-computed execution plan for mixed-precision SpMV.
Contains the resolved configuration, estimated bandwidth savings, and memory footprint information needed to launch the kernel.
Fields§
§config: MixedPrecisionConfigResolved configuration (Auto replaced with concrete algorithm).
rows: u32Number of matrix rows.
cols: u32Number of matrix columns.
nnz: u64Number of non-zero entries.
values_bytes: u64Memory footprint in bytes for the FP16/BF16 values array.
values_bytes_full: u64Memory footprint in bytes for the same values if stored in compute precision.
Implementations§
Source§impl MixedPrecisionPlan
impl MixedPrecisionPlan
Sourcepub fn bandwidth_savings_ratio(&self) -> f64
pub fn bandwidth_savings_ratio(&self) -> f64
Returns the bandwidth savings ratio (e.g., ~2.0 for FP16 vs FP32 values).
This only accounts for the values array; row_offsets and col_indices remain unchanged as i32 arrays.
Sourcepub fn estimated_gflops(&self, peak_bandwidth_gb_s: f64) -> f64
pub fn estimated_gflops(&self, peak_bandwidth_gb_s: f64) -> f64
Estimates peak achievable GFLOPS assuming the kernel is perfectly memory-bandwidth-bound.
Uses a simple roofline model: each non-zero requires one FMA (2 flops), plus the memory traffic to load the value, column index, and vector element.
Sourcepub fn avg_nnz_per_row(&self) -> f64
pub fn avg_nnz_per_row(&self) -> f64
Returns the average non-zeros per row.
Trait Implementations§
Source§impl Clone for MixedPrecisionPlan
impl Clone for MixedPrecisionPlan
Source§fn clone(&self) -> MixedPrecisionPlan
fn clone(&self) -> MixedPrecisionPlan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more