pub struct ModelCompilePipeline { /* private fields */ }Expand description
Compile-once / specialize-per-variant pipeline with optional FIFO cache.
Implementations§
Source§impl ModelCompilePipeline
impl ModelCompilePipeline
pub fn new(device: Device) -> Self
pub fn with_capacity(device: Device, capacity: usize) -> Self
pub fn device(&self) -> Device
pub fn has_template(&self) -> bool
Sourcepub fn build_template<F>(
&mut self,
build_hir: F,
options: &CompileOptions,
) -> Result<&CompileResult, LowerError>
pub fn build_template<F>( &mut self, build_hir: F, options: &CompileOptions, ) -> Result<&CompileResult, LowerError>
Step 1 — run fusion pipeline on symbolic HIR (dynamic dims allowed).
pub fn template_binding_manifest(&self) -> BindingManifest
Sourcepub fn specialize_template(
&self,
binding: &DimBinding,
options: &CompileOptions,
) -> CompileResult
pub fn specialize_template( &self, binding: &DimBinding, options: &CompileOptions, ) -> CompileResult
Step 2 — bind symbolic dims and replan buffers.
Sourcepub fn compile_lir(
&self,
specialized: CompileResult,
options: &CompileOptions,
) -> CompiledGraph
pub fn compile_lir( &self, specialized: CompileResult, options: &CompileOptions, ) -> CompiledGraph
Step 3 — backend executable from specialized LIR.
Sourcepub fn get_or_compile<F>(
&mut self,
key: u64,
binding: &DimBinding,
build_hir: F,
options: &CompileOptions,
) -> Result<&mut CompiledGraph, LowerError>
pub fn get_or_compile<F>( &mut self, key: u64, binding: &DimBinding, build_hir: F, options: &CompileOptions, ) -> Result<&mut CompiledGraph, LowerError>
Full pipeline: template (once) → specialize → compile; cached by key.
Sourcepub fn binding_manifest_for_binding(
&self,
binding: &DimBinding,
options: &CompileOptions,
) -> BindingManifest
pub fn binding_manifest_for_binding( &self, binding: &DimBinding, options: &CompileOptions, ) -> BindingManifest
Manifest for a variant without storing specialized LIR in the cache.
Sourcepub fn binding_manifest_for_component(
&self,
component: &ModelComponent,
options: &CompileOptions,
) -> BindingManifest
pub fn binding_manifest_for_component( &self, component: &ModelComponent, options: &CompileOptions, ) -> BindingManifest
Layout for a full ModelComponent (specialized parameter block).
Sourcepub fn get_or_compile_component<F>(
&mut self,
component: &ModelComponent,
build_hir: F,
options: &CompileOptions,
) -> Result<(&mut CompiledGraph, BindingManifest), LowerError>
pub fn get_or_compile_component<F>( &mut self, component: &ModelComponent, build_hir: F, options: &CompileOptions, ) -> Result<(&mut CompiledGraph, BindingManifest), LowerError>
Template → specialize → compile; keyed by ModelComponent::cache_key.
pub fn contains(&self, key: u64) -> bool
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn template_result(&self) -> Option<&CompileResult>
pub fn template_result(&self) -> Option<&CompileResult>
Symbolic template from Self::build_template / Self::get_or_compile.
Sourcepub fn ensure_template<F: FnOnce() -> HirModule>(
&mut self,
build_hir: F,
options: &CompileOptions,
) -> Result<&CompileResult, LowerError>
pub fn ensure_template<F: FnOnce() -> HirModule>( &mut self, build_hir: F, options: &CompileOptions, ) -> Result<&CompileResult, LowerError>
Build the symbolic template once (no specialization).
Sourcepub fn get_or_specialize_aot<F: FnOnce() -> HirModule>(
&mut self,
aot: &AotCache,
disk_base: &str,
key: u64,
binding: &DimBinding,
build_hir: F,
options: &CompileOptions,
) -> Result<&mut CompiledGraph, AotCacheError>
pub fn get_or_specialize_aot<F: FnOnce() -> HirModule>( &mut self, aot: &AotCache, disk_base: &str, key: u64, binding: &DimBinding, build_hir: F, options: &CompileOptions, ) -> Result<&mut CompiledGraph, AotCacheError>
Disk-backed specialize ([CompilationMode::Aot]); caches by key.
Auto Trait Implementations§
impl Freeze for ModelCompilePipeline
impl !RefUnwindSafe for ModelCompilePipeline
impl Send for ModelCompilePipeline
impl !Sync for ModelCompilePipeline
impl Unpin for ModelCompilePipeline
impl UnsafeUnpin for ModelCompilePipeline
impl !UnwindSafe for ModelCompilePipeline
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
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more