Skip to main content

Costs

Struct Costs 

Source
pub struct Costs {
    pub dev_bytes_per_s: f64,
    pub cpu_bytes_per_s: f64,
    pub dyn_layer_s: f64,
    pub graph_submit_s: f64,
    pub cpu_layer_s: f64,
    pub fill_bytes_per_s: f64,
    pub hit_curve: Vec<(f64, f64)>,
}
Expand description

Measured cost constants of the decision.

Fields§

§dev_bytes_per_s: f64

Effective device bytes/s for a resident weight stream.

§cpu_bytes_per_s: f64

Effective host bytes/s for q4tp expert / q8_2f projection streams.

§dyn_layer_s: f64

Fixed cost of one host-walked layer whose projections and resident experts run per-op on the device: the QKV and O submits, the MoE frame fence, the host attention core and route.

§graph_submit_s: f64

Fixed cost of one whole-token graph submit.

§cpu_layer_s: f64

Fixed cost of one pure-host layer (pool dispatch barriers).

§fill_bytes_per_s: f64

Upload bytes/s of a bank fill.

§hit_curve: Vec<(f64, f64)>

Per-layer LRU hit rate of a decode stream by slots per layer (trace replay of real routing). Interpolated in log(slots).

Implementations§

Source§

impl Costs

Source

pub fn measured() -> Self

RTX PRO 6000 Blackwell (96 GB, Vulkan) + EPYC 9655 in a 24-core cgroup, MiMo-V2.6-Flash q4tp (runs of 2026-09-24):

  • dyn_layer_s: a bank-served layer measured 0.9–1.0 ms of host walk per layer at ~100 % hits with the generic frame (QKV submit 0.22 ms, O 0.14 ms, frame 0.43 ms, attention core 0.06 ms); the dedicated bank kernels take ~0.2 ms off the frame. The device’s own bytes are charged separately at dev_bytes_per_s.
  • hit_curve: per-layer LRU hit rate after a 64-token warm-up, replayed from a 446-token CMF_MOE_TRACE of docs/ppl_nat.txt (tools/moe_lru_sim.py).
  • cpu_bytes_per_s: q4tp/q8_2f streaming of the host walk with the 22-thread pool.
Source

pub fn hit_rate(&self, slots: f64, n_experts: usize) -> f64

LRU hit rate at slots per layer.

Trait Implementations§

Source§

impl Clone for Costs

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Costs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Costs

§

impl RefUnwindSafe for Costs

§

impl Send for Costs

§

impl Sync for Costs

§

impl Unpin for Costs

§

impl UnsafeUnpin for Costs

§

impl UnwindSafe for Costs

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more