pub struct AdvancedProcessor { /* private fields */ }Expand description
Advanced graph-processing processor: real timing/memory instrumentation plus (optionally) adaptive candidate-operation selection.
Implementations§
Source§impl AdvancedProcessor
impl AdvancedProcessor
Sourcepub fn new(config: AdvancedConfig) -> Self
pub fn new(config: AdvancedConfig) -> Self
Create a new advanced processor
Sourcepub fn execute<N, E, Ix, T, F>(
&mut self,
graph: &Graph<N, E, Ix>,
operation: F,
) -> Result<T>
pub fn execute<N, E, Ix, T, F>( &mut self, graph: &Graph<N, E, Ix>, operation: F, ) -> Result<T>
Execute advanced graph processing.
Wraps operation with genuine wall-clock timing and a real
(structural) memory estimate; both feed Self::get_optimization_stats.
Always runs operation on the CPU – see the module docs for why
there is no GPU/neuromorphic dispatch path for an opaque closure.
Sourcepub fn execute_profiled<N, E, Ix, T, F>(
&mut self,
graph: &Graph<N, E, Ix>,
operation: F,
) -> Result<T>
pub fn execute_profiled<N, E, Ix, T, F>( &mut self, graph: &Graph<N, E, Ix>, operation: F, ) -> Result<T>
Like Self::execute, but additionally measures REAL operating-system
process memory (peak resident-set size) while operation runs, via
background-thread sampling (crate::memory::AdvancedMemoryAnalyzer).
This is strictly more accurate than the structural estimate
execute uses, at the cost of spawning a monitoring thread per call
– prefer execute in hot loops or over many small graphs.
Sourcepub fn execute_adaptive<N, E, Ix, T>(
&mut self,
graph: &Graph<N, E, Ix>,
candidates: &[CandidateOp<N, E, Ix, T>],
) -> Result<T>
pub fn execute_adaptive<N, E, Ix, T>( &mut self, graph: &Graph<N, E, Ix>, candidates: &[CandidateOp<N, E, Ix, T>], ) -> Result<T>
Executes the best-performing of several candidate implementations of
the same operation, per this processor’s adaptive (bandit-RL)
selection policy (NeuralRLAgent), and feeds the observed latency
back in as a reward so future calls keep adapting. This is the
genuine “RL-driven algorithm selection” the module docs describe:
candidates[i] are, e.g., different algorithm implementations or
parameter choices for the same task; over repeated calls the agent
learns which one tends to be fastest for this workload and
increasingly favors it, while still exploring the others per the
configured ExplorationStrategy.
Sourcepub fn get_performance_report(&self) -> SimplePerformanceReport
pub fn get_performance_report(&self) -> SimplePerformanceReport
Get performance report
Sourcepub fn get_optimization_stats(&self) -> AdvancedStats
pub fn get_optimization_stats(&self) -> AdvancedStats
Get optimization statistics, genuinely accumulated from every
execute/execute_profiled/execute_adaptive call made so far
(starts at AdvancedStats::default before the first call).
Sourcepub fn gpu_context(&self) -> &GPUAccelerationContext
pub fn gpu_context(&self) -> &GPUAccelerationContext
Real GPU hardware-availability context, computed via
GPUAccelerationContext::detect when this processor was
constructed with enable_gpu_acceleration set (an honest
GPUAccelerationContext::default otherwise).
Sourcepub fn rl_agent(&self) -> &NeuralRLAgent
pub fn rl_agent(&self) -> &NeuralRLAgent
The adaptive (bandit-RL) agent backing Self::execute_adaptive.
Sourcepub fn rl_agent_mut(&mut self) -> &mut NeuralRLAgent
pub fn rl_agent_mut(&mut self) -> &mut NeuralRLAgent
Mutable access to the adaptive agent, e.g. to swap its
ExplorationStrategy.
Auto Trait Implementations§
impl Freeze for AdvancedProcessor
impl RefUnwindSafe for AdvancedProcessor
impl Send for AdvancedProcessor
impl Sync for AdvancedProcessor
impl Unpin for AdvancedProcessor
impl UnsafeUnpin for AdvancedProcessor
impl UnwindSafe for AdvancedProcessor
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