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§
Sourcetype Inspection
type Inspection
Backend-neutral artifact inspection retained across every candidate probe.
Required Methods§
Sourcefn backend_id(&self) -> BackendId
fn backend_id(&self) -> BackendId
Stable identity used by execution plans for this backend adapter.
Sourcefn discover_hardware(&self) -> Result<HardwareProfile, AutomaticPlanningError>
fn discover_hardware(&self) -> Result<HardwareProfile, AutomaticPlanningError>
Discovers the devices and memory facts visible to this backend adapter.
Sourcefn inspect_resources(
&self,
model_path: &Path,
) -> Result<(ModelResourceProfile, Self::Inspection), AutomaticPlanningError>
fn inspect_resources( &self, model_path: &Path, ) -> Result<(ModelResourceProfile, Self::Inspection), AutomaticPlanningError>
Inspects an artifact without materializing its tensor payloads.
Sourcefn admit_candidate(
&self,
inspection: &Self::Inspection,
plan: &ExecutionPlan,
) -> Result<CandidateAdmission, AutomaticPlanningError>
fn admit_candidate( &self, inspection: &Self::Inspection, plan: &ExecutionPlan, ) -> Result<CandidateAdmission, AutomaticPlanningError>
Checks whether this backend can load a concrete portable plan.
Sourcefn bounded_residency_requirement(
&self,
inspection: &Self::Inspection,
plan: &ExecutionPlan,
) -> Result<BoundedResidencyRequirement, AutomaticPlanningError>
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".