Struct ExpertPlacementPolicy
pub struct ExpertPlacementPolicy {
pub expected_reuse: u16,
/* private fields */
}Expand description
Frozen placement policy used for all expert-cache misses in a generation run.
Fields§
§expected_reuse: u16A non-zero expected reuse count permits an initial fetch to amortise its transfer.
Implementations§
§impl ExpertPlacementPolicy
impl ExpertPlacementPolicy
pub fn from_calibration(
calibration: ExpertPlacementCalibration,
expected_reuse: u16,
) -> ExpertPlacementPolicy
pub fn from_calibration( calibration: ExpertPlacementCalibration, expected_reuse: u16, ) -> ExpertPlacementPolicy
Freeze a policy from a completed calibration. Reuse is clamped so malformed telemetry cannot create an unbounded or divide-by-zero decision.
pub fn calibration(&self) -> ExpertPlacementCalibration
pub fn calibration(&self) -> ExpertPlacementCalibration
Placement calibration.
pub fn prefer_cpu(
&self,
bytes_per_expert: usize,
queue_depth: usize,
allow_cpu_hybrid: bool,
) -> bool
pub fn prefer_cpu( &self, bytes_per_expert: usize, queue_depth: usize, allow_cpu_hybrid: bool, ) -> bool
True when a cache miss should execute on CPU rather than enqueue a GPU transfer.
GPU cost is transfer + launch + resident evaluation, amortised by expected reuse. Queue depth scales transfer time but is bounded by the observed safe overlap; beyond that the request stays on CPU. Missing measurements fail closed to GPU staging, preserving the existing manager behaviour rather than inventing a throughput figure.
Trait Implementations§
§impl Clone for ExpertPlacementPolicy
impl Clone for ExpertPlacementPolicy
§fn clone(&self) -> ExpertPlacementPolicy
fn clone(&self) -> ExpertPlacementPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ExpertPlacementPolicy
§impl Debug for ExpertPlacementPolicy
impl Debug for ExpertPlacementPolicy
§impl Default for ExpertPlacementPolicy
impl Default for ExpertPlacementPolicy
§fn default() -> ExpertPlacementPolicy
fn default() -> ExpertPlacementPolicy
Returns the “default value” for a type. Read more
§impl PartialEq for ExpertPlacementPolicy
impl PartialEq for ExpertPlacementPolicy
impl StructuralPartialEq for ExpertPlacementPolicy
Auto Trait Implementations§
impl Freeze for ExpertPlacementPolicy
impl RefUnwindSafe for ExpertPlacementPolicy
impl Send for ExpertPlacementPolicy
impl Sync for ExpertPlacementPolicy
impl Unpin for ExpertPlacementPolicy
impl UnsafeUnpin for ExpertPlacementPolicy
impl UnwindSafe for ExpertPlacementPolicy
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
Mutably borrows from an owned value. Read more
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.