pub struct Objective {
pub optimize: Optimize,
pub context: usize,
pub hop_secs: f64,
pub kv_bytes_per_layer_token: Option<u64>,
pub on_unknown_kv: UnknownKv,
pub kv_dtype: Option<String>,
pub precision_ladder: Vec<Precision>,
}Expand description
Objective plus the constraints that shape it.
Fields§
§optimize: Optimize§context: usizeContext length the KV cache must hold. The planner reserves KV bytes per node before fitting weights — a plan that fits at seq 8 and OOMs at 128 k is not a plan.
hop_secs: f64Seconds a network hop adds to the critical path. Only Optimize::Latency
uses it; the default is a LAN round trip for a hidden-state relay.
kv_bytes_per_layer_token: Option<u64>Cache bytes per layer per token, when you know it and the checkpoint cannot be read for it. Overrides inference.
on_unknown_kv: UnknownKvWhat to do when the cache size cannot be determined.
kv_dtype: Option<String>Cache element dtype at plan time (f32 default, f16/bf16, f8).
Mirrors CostOptions::kv_dtype, which applies when the profile is
inferred; this one applies when the planner has to synthesize a bound
itself. Defaulting to f32 keeps that bound the conservative one.
precision_ladder: Vec<Precision>Precisions to try, widest first. The planner walks down until the model fits and reports what it settled on, instead of failing with “too big” and leaving you to guess the next step.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Objective
impl<'de> Deserialize<'de> for Objective
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Objective
impl RefUnwindSafe for Objective
impl Send for Objective
impl Sync for Objective
impl Unpin for Objective
impl UnsafeUnpin for Objective
impl UnwindSafe for Objective
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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