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§
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, AutomaticPlanningError>
fn inspect_resources( &self, model_path: &Path, ) -> Result<ModelResourceProfile, AutomaticPlanningError>
Inspects an artifact without materializing its tensor payloads.
Sourcefn admit_candidate(
&self,
model_path: &Path,
plan: &ExecutionPlan,
) -> Result<CandidateAdmission, AutomaticPlanningError>
fn admit_candidate( &self, model_path: &Path, plan: &ExecutionPlan, ) -> Result<CandidateAdmission, AutomaticPlanningError>
Checks whether this backend can load a concrete portable plan.
Sourcefn bounded_residency_requirement(
&self,
model_path: &Path,
plan: &ExecutionPlan,
) -> Result<BoundedResidencyRequirement, AutomaticPlanningError>
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".