pub struct ResidentLaunchPolicy {Show 13 fields
pub sizing: ResidentSizingPolicy,
pub min_hit_capacity: u32,
pub hit_capacity_multiplier: u32,
pub saturated_waves: u32,
pub hot_opcode_threshold: u32,
pub hot_window_threshold: u32,
pub jit_queue_len_threshold: u32,
pub priority_age_threshold: u32,
pub sparse_frontier_threshold_bps: u16,
pub dense_frontier_threshold_bps: u16,
pub memory_pressure_threshold_bps: u16,
pub fusion_edge_threshold: u32,
pub scratch_bytes_per_hit: u32,
}Expand description
Single policy surface for megakernel launch sizing and telemetry-driven routing.
Fields§
§sizing: ResidentSizingPolicySizing policy for worker counts and grid geometry.
min_hit_capacity: u32Minimum capacity for sparse-hit results.
hit_capacity_multiplier: u32Multiplier for expected hits to determine capacity.
saturated_waves: u32Number of waves that define a saturated queue.
hot_opcode_threshold: u32Threshold for promoting hot opcodes to JIT.
hot_window_threshold: u32Threshold for promoting hot windows to JIT.
jit_queue_len_threshold: u32Queue length threshold to prefer JIT over interpreter.
priority_age_threshold: u32Priority age threshold to trigger aging promotions.
sparse_frontier_threshold_bps: u16Frontier density at or below this value uses sparse expansion.
dense_frontier_threshold_bps: u16Frontier density at or above this value uses dense propagation.
memory_pressure_threshold_bps: u16Memory pressure at or above this value uses the memory-constrained path.
fusion_edge_threshold: u32Minimum graph edge count before dense hot work is eligible for fusion.
scratch_bytes_per_hit: u32Conservative resident scratch bytes needed per sparse-hit entry.
Implementations§
Source§impl ResidentLaunchPolicy
impl ResidentLaunchPolicy
Sourcepub fn launch_cache_stats() -> ResidentLaunchCacheStats
pub fn launch_cache_stats() -> ResidentLaunchCacheStats
Return launch recommendation cache telemetry for the current thread.
Sourcepub fn reset_launch_cache_for_thread()
pub fn reset_launch_cache_for_thread()
Clear launch recommendation cache entries and counters for this thread.
Sourcepub fn recommend(
&self,
request: ResidentLaunchRequest,
) -> Result<ResidentLaunchRecommendation, BackendError>
pub fn recommend( &self, request: ResidentLaunchRequest, ) -> Result<ResidentLaunchRecommendation, BackendError>
Recommend geometry, hit capacity, and interpreter/JIT route.
§Errors
Returns BackendError when required adapter limits are zero or derived
launch values cannot fit the u32 ring protocol.
Sourcepub fn recommend_with_topology_evidence(
&self,
request: ResidentLaunchRequest,
) -> Result<(ResidentLaunchRecommendation, ResidentTopologyEvidence), BackendError>
pub fn recommend_with_topology_evidence( &self, request: ResidentLaunchRequest, ) -> Result<(ResidentLaunchRecommendation, ResidentTopologyEvidence), BackendError>
Recommend a launch and emit topology evidence for parity benches.
§Errors
Returns BackendError when the underlying recommendation cannot be
built from the request or adapter limits.
Sourcepub fn recommend_with_promotion_evidence(
&self,
request: ResidentLaunchRequest,
) -> Result<(ResidentLaunchRecommendation, ResidentPromotionEvidence), BackendError>
pub fn recommend_with_promotion_evidence( &self, request: ResidentLaunchRequest, ) -> Result<(ResidentLaunchRecommendation, ResidentPromotionEvidence), BackendError>
Recommend a launch and emit hot opcode/window promotion evidence.
§Errors
Returns BackendError when the underlying recommendation cannot be
built from the request or adapter limits.
Sourcepub fn recommend_with_previous_topology(
&self,
request: ResidentLaunchRequest,
previous_topology: ResidentQueueTopology,
) -> Result<ResidentLaunchRecommendation, BackendError>
pub fn recommend_with_previous_topology( &self, request: ResidentLaunchRequest, previous_topology: ResidentQueueTopology, ) -> Result<ResidentLaunchRecommendation, BackendError>
Recommend a launch while preserving the previous topology inside a narrow hysteresis band.
CUDA resident graphs and long-running dataflow streams should use this entry point when they can track the last successful topology. It prevents borderline frontier-density or memory-pressure telemetry from repeatedly switching kernel variants, invalidating launch plans, and disturbing cache locality at scale.
§Errors
Returns BackendError when required adapter limits are zero or derived
launch values cannot fit the u32 ring protocol.
Sourcepub fn autotune_hit_capacity_multiplier(
&self,
candidate_multipliers: &[u32],
costs: &[f64],
) -> u32
pub fn autotune_hit_capacity_multiplier( &self, candidate_multipliers: &[u32], costs: &[f64], ) -> u32
Select the best hit_capacity_multiplier from a candidate set.
candidate_multipliers are the multipliers to try; costs[i]
is the observed dispatch latency (or any minimization metric)
when candidate_multipliers[i] was used. Lower cost wins; the
minimum observed cost selects the multiplier.
Returns the chosen multiplier. If candidate_multipliers is
empty, returns the policy’s existing hit_capacity_multiplier.
Sourcepub fn autotune_workgroup_size(
&self,
candidate_sizes: &[u32],
costs: &[f64],
current_size: u32,
) -> u32
pub fn autotune_workgroup_size( &self, candidate_sizes: &[u32], costs: &[f64], current_size: u32, ) -> u32
Select the best workgroup-size from a candidate set.
candidate_sizes[i] is paired
with costs[i] (lower is better). Returns the chosen size or
the policy’s sizing.default_workgroup_size_x() fallback.
Sourcepub fn try_natural_gradient_autotune_step(
m_inv_sqrt: &[f64],
grad: &[f64],
n: u32,
learning_rate: f64,
) -> Result<Vec<f64>, BackendError>
pub fn try_natural_gradient_autotune_step( m_inv_sqrt: &[f64], grad: &[f64], n: u32, learning_rate: f64, ) -> Result<Vec<f64>, BackendError>
Compute the next-step parameter delta with fallible output staging.
§Errors
Returns BackendError when host staging cannot be reserved for the
natural-gradient vector.
Sourcepub fn try_natural_gradient_autotune_step_into(
m_inv_sqrt: &[f64],
grad: &[f64],
n: u32,
learning_rate: f64,
out: &mut Vec<f64>,
) -> Result<(), BackendError>
pub fn try_natural_gradient_autotune_step_into( m_inv_sqrt: &[f64], grad: &[f64], n: u32, learning_rate: f64, out: &mut Vec<f64>, ) -> Result<(), BackendError>
Compute the natural-gradient autotune step into caller-owned storage with fallible host staging.
§Errors
Returns BackendError when host staging cannot be reserved for the
natural-gradient vector.
Trait Implementations§
Source§impl Clone for ResidentLaunchPolicy
impl Clone for ResidentLaunchPolicy
Source§fn clone(&self) -> ResidentLaunchPolicy
fn clone(&self) -> ResidentLaunchPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ResidentLaunchPolicy
Source§impl Debug for ResidentLaunchPolicy
impl Debug for ResidentLaunchPolicy
Source§impl Default for ResidentLaunchPolicy
impl Default for ResidentLaunchPolicy
impl Eq for ResidentLaunchPolicy
Source§impl Hash for ResidentLaunchPolicy
impl Hash for ResidentLaunchPolicy
Source§impl PartialEq for ResidentLaunchPolicy
impl PartialEq for ResidentLaunchPolicy
impl StructuralPartialEq for ResidentLaunchPolicy
Auto Trait Implementations§
impl Freeze for ResidentLaunchPolicy
impl RefUnwindSafe for ResidentLaunchPolicy
impl Send for ResidentLaunchPolicy
impl Sync for ResidentLaunchPolicy
impl Unpin for ResidentLaunchPolicy
impl UnsafeUnpin for ResidentLaunchPolicy
impl UnwindSafe for ResidentLaunchPolicy
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.