pub struct WorkerConfig {
pub cost_model: Arc<ArcSwap<CostModel>>,
pub idle_timeout: Option<Duration>,
pub model_variant: ModelVariant,
pub max_seq_length: usize,
pub intra_threads: usize,
}Expand description
Execution-policy configuration shared by all workers.
cost_model is an Arc<ArcSwap<CostModel>> so all workers share a single
handle and the background probe can update the cost model atomically after
fitting. Each worker loads the current value lock-free at the start of
every session.run() call via config.cost_model.load().
Fields§
§cost_model: Arc<ArcSwap<CostModel>>Quadratic-aware workspace cost model and per-worker budget.
Shared across all workers via ArcSwap. The background probe updates
this handle once fitted coefficients are available; workers observe the
new model on their next request without any coordination or restart.
idle_timeout: Option<Duration>Duration of inactivity before workers unload their model instances.
model_variant: ModelVariantONNX model variant to load (FP32, FP16, or INT8).
max_seq_length: usizeMaximum tokenized sequence length.
intra_threads: usizeNumber of intra-op threads each ORT session may use for a single
session.run() call. Plumbed through to load_session at model load
time. See crate::config::Config::intra_threads for sizing guidance.
Trait Implementations§
Source§impl Clone for WorkerConfig
impl Clone for WorkerConfig
Source§fn clone(&self) -> WorkerConfig
fn clone(&self) -> WorkerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for WorkerConfig
impl RefUnwindSafe for WorkerConfig
impl Send for WorkerConfig
impl Sync for WorkerConfig
impl Unpin for WorkerConfig
impl UnsafeUnpin for WorkerConfig
impl UnwindSafe for WorkerConfig
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
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