pub struct DictionaryScoreRoutePlan {
pub n_rows: usize,
pub n_items: usize,
pub feature_dim: usize,
pub device_min_score_elems: usize,
pub max_tile_score_elems: usize,
pub tile_items: usize,
pub tile_count: usize,
pub device_admitted: bool,
pub peak_score_bytes: usize,
pub dot_flops_lower_bound: u128,
}Expand description
Device admission and tile geometry for one minibatch-by-dictionary score route.
Fields§
§n_rows: usizeMinibatch rows scored together.
n_items: usizeCandidate atoms/blocks scored for each row.
feature_dim: usizeDot-product width for one score.
device_min_score_elems: usizeMinimum n_rows * n_items elements required for device admission.
max_tile_score_elems: usizeMaximum n_rows * tile_items score elements held by one device launch.
tile_items: usizeCandidate items per launch tile.
tile_count: usizeNumber of candidate tiles covering 0..n_items.
device_admitted: boolTrue when the total route work is large enough to use the device.
peak_score_bytes: usizePeak score-block bytes for a full tile.
dot_flops_lower_bound: u128Lower-bound arithmetic for dispatch diagnostics: one multiply and one add
per (row, item, feature) score term.
Implementations§
Source§impl DictionaryScoreRoutePlan
impl DictionaryScoreRoutePlan
Sourcepub fn with_limits(
n_rows: usize,
n_items: usize,
feature_dim: usize,
device_min_score_elems: usize,
max_tile_score_elems: usize,
) -> Self
pub fn with_limits( n_rows: usize, n_items: usize, feature_dim: usize, device_min_score_elems: usize, max_tile_score_elems: usize, ) -> Self
Build a plan with explicit thresholds. The function is pure and allocation-free so call sites can test routing decisions without a CUDA runtime.
Sourcepub fn default_for_shape(
n_rows: usize,
n_items: usize,
feature_dim: usize,
) -> Self
pub fn default_for_shape( n_rows: usize, n_items: usize, feature_dim: usize, ) -> Self
Build a plan with the library defaults used by sparse dictionary routers.
Sourcepub const fn is_degenerate(self) -> bool
pub const fn is_degenerate(self) -> bool
True when the plan covers no route work.
Trait Implementations§
Source§impl Clone for DictionaryScoreRoutePlan
impl Clone for DictionaryScoreRoutePlan
Source§fn clone(&self) -> DictionaryScoreRoutePlan
fn clone(&self) -> DictionaryScoreRoutePlan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DictionaryScoreRoutePlan
Source§impl Debug for DictionaryScoreRoutePlan
impl Debug for DictionaryScoreRoutePlan
impl Eq for DictionaryScoreRoutePlan
Source§impl PartialEq for DictionaryScoreRoutePlan
impl PartialEq for DictionaryScoreRoutePlan
Source§fn eq(&self, other: &DictionaryScoreRoutePlan) -> bool
fn eq(&self, other: &DictionaryScoreRoutePlan) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DictionaryScoreRoutePlan
Auto Trait Implementations§
impl Freeze for DictionaryScoreRoutePlan
impl RefUnwindSafe for DictionaryScoreRoutePlan
impl Send for DictionaryScoreRoutePlan
impl Sync for DictionaryScoreRoutePlan
impl Unpin for DictionaryScoreRoutePlan
impl UnsafeUnpin for DictionaryScoreRoutePlan
impl UnwindSafe for DictionaryScoreRoutePlan
Blanket Implementations§
impl<T> Boilerplate for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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