#[non_exhaustive]pub struct BatchQuery {
pub items: usize,
pub item_muladds: f64,
pub item_parallel: bool,
pub vendor_batch: bool,
pub balanced_lanes: bool,
pub outer_only_when_item_serial: bool,
}Expand description
What one batch of one route looks like to batch_decision.
Work is described by an estimate, not by dimensions: each family supplies
the multiply-adds of one item (GEMM mnk, LU n^3/3, solve n^2 k,
QR 2mn^2/3, with complex elements weighing four). The two booleans and
balanced_lanes say what the route permits; they are how the legacy rules
above become inputs instead of hidden constants.
§Examples
use tcontract_exec::batch::BatchQuery;
let query = BatchQuery::new(32, 4096.0)
.with_item_parallel(false)
.with_vendor_batch(true);
assert_eq!(query.items, 32);
assert!(!query.item_parallel);
assert!(query.vendor_batch);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.items: usizeNumber of independent items; 0 means there is no work.
item_muladds: f64Multiply-adds of one item.
item_parallel: boolThe route permits item-parallel width greater than one, i.e.
item_threads > 1 is meaningful. Auto keeps item threads one when
this is false.
vendor_batch: boolThe route has a vendor call for the whole batch at this shape.
BatchStrategy::WholeBatchVendor is available only when this is true.
balanced_lanes: boolAuto may only keep lanes when every lane is non-empty, the split is
near-even and the batch alone fills the narrowed budget: the packed
driver’s balanced-lanes rule.
outer_only_when_item_serial: boolAuto prefers the inner route (one lane, the item kernel gets a team) and
fans out over items only when one item alone cannot use a team: the faer
batched-GEMM rule. The item width is then the width of one item, not the
whole budget.
Implementations§
Source§impl BatchQuery
impl BatchQuery
Sourcepub fn new(items: usize, item_muladds: f64) -> Self
pub fn new(items: usize, item_muladds: f64) -> Self
A query for items items of item_muladds multiply-adds each, on a
route that permits item parallelism and has no vendor batch route.
Sourcepub fn with_item_parallel(self, item_parallel: bool) -> Self
pub fn with_item_parallel(self, item_parallel: bool) -> Self
Return this query with the item-parallel capability set.
Sourcepub fn with_vendor_batch(self, vendor_batch: bool) -> Self
pub fn with_vendor_batch(self, vendor_batch: bool) -> Self
Return this query with the vendor batch capability set.
Sourcepub fn with_balanced_lanes(self, balanced_lanes: bool) -> Self
pub fn with_balanced_lanes(self, balanced_lanes: bool) -> Self
Return this query with the balanced-lanes capability set.
Sourcepub fn with_outer_only_when_item_serial(self, value: bool) -> Self
pub fn with_outer_only_when_item_serial(self, value: bool) -> Self
Return this query with the “outer only when one item cannot use a team” capability set (the faer batched-GEMM rule).
Trait Implementations§
Source§impl Clone for BatchQuery
impl Clone for BatchQuery
impl Copy for BatchQuery
Source§impl Debug for BatchQuery
impl Debug for BatchQuery
Source§impl PartialEq for BatchQuery
impl PartialEq for BatchQuery
impl StructuralPartialEq for BatchQuery
Auto Trait Implementations§
impl Freeze for BatchQuery
impl RefUnwindSafe for BatchQuery
impl Send for BatchQuery
impl Sync for BatchQuery
impl Unpin for BatchQuery
impl UnsafeUnpin for BatchQuery
impl UnwindSafe for BatchQuery
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> 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