Skip to main content

AutomaticPlanningBackend

Trait AutomaticPlanningBackend 

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

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

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, AutomaticPlanningError>

Inspects an artifact without materializing its tensor payloads.

Source

fn admit_candidate( &self, model_path: &Path, plan: &ExecutionPlan, ) -> Result<CandidateAdmission, AutomaticPlanningError>

Checks whether this backend can load a concrete portable plan.

Source

fn bounded_residency_requirement( &self, model_path: &Path, 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§