pub struct ThresholdTable {
pub svd: usize,
pub qr: usize,
pub lq: usize,
pub eigh: usize,
pub eig: usize,
pub gemm: usize,
pub solve: usize,
pub transpose: usize,
}Expand description
Per-op parallelism thresholds.
Each field is the smallest problem-size key at which the op should
dispatch as ExecPolicy::Parallel(0). Keys are op-specific and
produced by the corresponding NativeBackend::par_for_* method:
svd/qr/lq and gemm use cbrt(m*n*min(m,n)) and cbrt(m*n*k)
respectively, eigh/eig/solve use n, transpose uses total
element count.
usize::MAX marks “no finite parallel threshold”: either unmeasured
on this profile, or a calibrated decision that parallel never wins
(e.g. ThresholdTable::laptop().transpose). policy_by_n treats it
as ExecPolicy::Sequential in both cases.
Fields§
§svd: usizeSVD threshold; key is cbrt(m*n*min(m,n)).
qr: usizeQR threshold; key is cbrt(m*n*min(m,n)).
lq: usizeLQ threshold; key is cbrt(m*n*min(m,n)).
eigh: usizeHermitian-eigendecomposition threshold; key is the dimension n.
eig: usizeGeneral-eigendecomposition threshold; key is the dimension n.
gemm: usizeGEMM threshold; key is cbrt(m*n*k).
solve: usizeLinear-solve threshold; key is the dimension n.
transpose: usizeTranspose threshold; key is the total element count.
Implementations§
Source§impl ThresholdTable
impl ThresholdTable
Sourcepub fn laptop() -> Self
pub fn laptop() -> Self
Thresholds calibrated for laptop-class CPUs (Apple M2 8-core).
Values come from crates/ariadnetor-linalg/benches/sweep_{decomp, decomp_rect,gemm,solve,transpose}_par.rs run in a single session.
transpose is calibrated per backend at compile time. Under the
hptt feature the sweep showed no regime where Rayon-style
parallel can beat HPTT’s tiled sequential on laptop, so the
sentinel usize::MAX is retained. Without it (the default build),
the naive fallback’s simpler sequential loses to the parallel
kernel above ~65k total elements.
Sourcepub fn workstation() -> Self
pub fn workstation() -> Self
Thresholds calibrated for workstation-class CPUs (Xeon NUMA, 112 cores).
Calibrated with the same five sweeps listed for laptop(). Most
ops carry the usize::MAX sentinel: at workstation scale parallel
sync cost is high enough that svd/qr/lq/eigh/eig/solve
never beat sequential at any n ≤ 1024 tested. Only large GEMMs
(cbrt(m*n*k) ≥ 768) and transposes benefit from parallel
dispatch.
transpose is calibrated per backend at compile time. Under
hptt the tiled kernel only crosses over at total element count
≥ 4_194_304. Without it (the default build), the naive fallback
crosses over much earlier — its parallel kernel beats its own
sequential above ~262_144 total elements. Calibration was
performed on 2D [n, n] inputs; the dispatch key is total
elements for any rank.
Sourcepub fn detect() -> Self
pub fn detect() -> Self
Pick a profile based on std::thread::available_parallelism().
Reads the logical-core count (falling back to the conservative 1
when the query fails) and delegates the profile choice to
Self::profile_for_parallelism.
Trait Implementations§
Source§impl Clone for ThresholdTable
impl Clone for ThresholdTable
Source§fn clone(&self) -> ThresholdTable
fn clone(&self) -> ThresholdTable
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ThresholdTable
impl RefUnwindSafe for ThresholdTable
impl Send for ThresholdTable
impl Sync for ThresholdTable
impl Unpin for ThresholdTable
impl UnsafeUnpin for ThresholdTable
impl UnwindSafe for ThresholdTable
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,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
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