pub struct GpuWorker {
pub gpu: DiscoveredGpu,
pub model_cache: Arc<Mutex<ModelCache>>,
pub active_generation: Arc<RwLock<Option<ActiveGeneration>>>,
pub model_load_lock: Arc<Mutex<()>>,
pub shared_pool: Arc<Mutex<SharedPool>>,
pub in_flight: AtomicUsize,
pub consecutive_failures: AtomicUsize,
pub degraded_until: RwLock<Option<Instant>>,
pub job_tx: SyncSender<GpuJob>,
}Expand description
Per-GPU worker state. Each GPU gets its own model cache, load lock, and health tracking.
Fields§
§gpu: DiscoveredGpu§model_cache: Arc<Mutex<ModelCache>>§active_generation: Arc<RwLock<Option<ActiveGeneration>>>§model_load_lock: Arc<Mutex<()>>§in_flight: AtomicUsize§consecutive_failures: AtomicUsize§degraded_until: RwLock<Option<Instant>>§job_tx: SyncSender<GpuJob>Implementations§
Source§impl GpuWorker
impl GpuWorker
Sourcepub fn is_degraded(&self) -> bool
pub fn is_degraded(&self) -> bool
Check if this worker is in a degraded state (3+ consecutive failures, within cooldown).
When the cooldown has expired we clear the failure counter and the
degraded_until timestamp so the next single failure doesn’t
immediately re-degrade the GPU. Without this lazy reset, a worker
that has 3 historical failures followed by a long idle period would
flip back to Degraded on the very first post-cooldown failure
(because consecutive_failures is still >= 3 from before).
Sourcepub fn status(&self) -> GpuWorkerStatus
pub fn status(&self) -> GpuWorkerStatus
Build a status snapshot for this worker.
Auto Trait Implementations§
impl !Freeze for GpuWorker
impl RefUnwindSafe for GpuWorker
impl Send for GpuWorker
impl Sync for GpuWorker
impl Unpin for GpuWorker
impl UnsafeUnpin for GpuWorker
impl UnwindSafe for GpuWorker
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
Mutably borrows from an owned value. Read more
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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