pub struct ResidencyPlanner;Expand description
Analysis-only residency planner. Computes live ranges and peak
bytes for a graph, emits a ResidencyReport. Does not mutate
the graph. Takes &Graph — the caller holds whatever lock it
already has; no hidden lock acquisition.
Implementations§
Source§impl ResidencyPlanner
impl ResidencyPlanner
Sourcepub fn analyze(g: &Graph, roots: &[NodeId]) -> ResidencyReport
pub fn analyze(g: &Graph, roots: &[NodeId]) -> ResidencyReport
Run the analysis. O(V + E) in the reachable subgraph. Walks a plain topological order and counts every node’s output (the single-device view the KV-pool sizing uses).
Sourcepub fn analyze_on(
g: &Graph,
roots: &[NodeId],
device: DeviceLocation,
) -> ResidencyReport
pub fn analyze_on( g: &Graph, roots: &[NodeId], device: DeviceLocation, ) -> ResidencyReport
The analysis the eviction pass uses to decide whether device fits a budget: the walk is
the order the executor will actually run (execution_plan, which pins each Op::Move
after every non-destructive reader of its source), and a node counts only while it is
resident on device: the output of an Op::Move / Op::Copy aimed at ANOTHER device
(the staged host copy of an eviction) is not device bytes. Without both, an eviction could
never lower the analysed peak and the pass would evict until it ran out of rounds.
Auto Trait Implementations§
impl Forget for ResidencyPlanner
impl Freeze for ResidencyPlanner
impl Move for ResidencyPlanner
impl RefUnwindSafe for ResidencyPlanner
impl Send for ResidencyPlanner
impl Sync for ResidencyPlanner
impl Unpin for ResidencyPlanner
impl UnsafeUnpin for ResidencyPlanner
impl UnwindSafe for ResidencyPlanner
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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