Skip to main content

AutomaticPlanningBackend

Trait AutomaticPlanningBackend 

Source
pub trait AutomaticPlanningBackend {
    type Inspection;

    // Required methods
    fn backend_id(&self) -> BackendId;
    fn discover_hardware(
        &self,
    ) -> Result<HardwareProfile, AutomaticPlanningError>;
    fn inspect_resources(
        &self,
        model_path: &Path,
    ) -> Result<(ModelResourceProfile, Self::Inspection), AutomaticPlanningError>;
    fn admit_candidate(
        &self,
        inspection: &Self::Inspection,
        plan: &ExecutionPlan,
    ) -> Result<CandidateAdmission, AutomaticPlanningError>;
    fn bounded_residency_requirement(
        &self,
        inspection: &Self::Inspection,
        plan: &ExecutionPlan,
    ) -> Result<BoundedResidencyRequirement, AutomaticPlanningError>;
}
Expand description

High-level observations a backend supplies to the neutral planner.

Required Associated Types§

Source

type Inspection

Backend-neutral artifact inspection retained across every candidate probe.

Required Methods§

Source

fn backend_id(&self) -> BackendId

Stable identity used by execution plans for this backend adapter.

Source

fn discover_hardware(&self) -> Result<HardwareProfile, AutomaticPlanningError>

Discovers the devices and memory facts visible to this backend adapter.

Source

fn inspect_resources( &self, model_path: &Path, ) -> Result<(ModelResourceProfile, Self::Inspection), AutomaticPlanningError>

Inspects an artifact without materializing its tensor payloads.

Source

fn admit_candidate( &self, inspection: &Self::Inspection, plan: &ExecutionPlan, ) -> Result<CandidateAdmission, AutomaticPlanningError>

Checks whether this backend can load a concrete portable plan.

Source

fn bounded_residency_requirement( &self, inspection: &Self::Inspection, plan: &ExecutionPlan, ) -> Result<BoundedResidencyRequirement, AutomaticPlanningError>

Establishes the exact bounded window needed by a non-resident plan.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§