oa::ml::training::TrainingProgram

Fixed-shape forward, backward, and AdamW program captured for Vulkan replay. The first capture records semantic work without executing it. Replays use one cached command buffer and graph-resident optimizer state; no forward, autograd, or optimizer graph is rebuilt on the host.

StRust public API

Declaration

pub struct TrainingProgram { /* private fields */ }
Public Rust declaration.

Public Methods

pub fn upload_input<T: Element>( &mut self, captured: &Matrix, values: &[T], ) -> Result<()>
pub fn replay( &mut self, engine: &Engine, optimizer: &mut AdamW, ) -> Result<Event>
pub fn replay_timed( &mut self, engine: &Engine, optimizer: &mut AdamW, ) -> Result<Event>
pub fn replay_and_wait( &mut self, engine: &Engine, optimizer: &mut AdamW, ) -> Result<f32>
pub fn replay_timed_and_wait( &mut self, engine: &Engine, optimizer: &mut AdamW, ) -> Result<(f32, Duration)>
pub const fn loss(&self) -> &Matrix
pub fn diagnostics(&self) -> ExecutionPlanDiagnostics
pub const fn semantic_graph(&self) -> &SemanticGraph
pub fn semantic_debug_report_json(&self, name: &str) -> String
pub fn debug_report_json(&self, name: &str) -> String
pub const fn replay_count(&self) -> u32
pub fn is_complete(&self) -> Result<bool>
pub fn wait(&self) -> Result<()>
pub fn reset(self) -> Result<()>
pub fn compilation_debug_report_json(&self, name: &str) -> String
pub const fn compilation_stages(&self) -> &[TrainingCompilationStageRecord]

Associated Functions

pub fn capture( engine: &Engine, optimizer: &mut AdamW, step: impl FnOnce() -> Result<Matrix>, ) -> Result<Self>

Public Method Documentation

pub fn upload_input<T: Element>( &mut self, captured: &Matrix, values: &[T], ) -> Result<()>
No public source comment is attached to this declaration.
pub fn replay( &mut self, engine: &Engine, optimizer: &mut AdamW ) -> Result<Event>
No public source comment is attached to this declaration.
pub fn replay_timed( &mut self, engine: &Engine, optimizer: &mut AdamW ) -> Result<Event>
No public source comment is attached to this declaration.
pub fn replay_and_wait( &mut self, engine: &Engine, optimizer: &mut AdamW ) -> Result<f32>
No public source comment is attached to this declaration.
pub fn replay_timed_and_wait( &mut self, engine: &Engine, optimizer: &mut AdamW, ) -> Result<( f32, Duration )>
No public source comment is attached to this declaration.
pub const fn loss( &self ) -> &Matrix
No public source comment is attached to this declaration.
pub fn diagnostics( &self ) -> ExecutionPlanDiagnostics
No public source comment is attached to this declaration.
pub const fn semantic_graph( &self ) -> &SemanticGraph
No public source comment is attached to this declaration.
pub fn semantic_debug_report_json( &self, name: &str ) -> String
No public source comment is attached to this declaration.
pub fn debug_report_json( &self, name: &str ) -> String
No public source comment is attached to this declaration.
pub const fn replay_count( &self ) -> u32
No public source comment is attached to this declaration.
pub fn is_complete( &self ) -> Result<bool>
No public source comment is attached to this declaration.
pub fn wait(&self) -> Result<()>
No public source comment is attached to this declaration.
pub fn reset(self) -> Result<()>
No public source comment is attached to this declaration.
pub fn compilation_debug_report_json( &self, name: &str ) -> String
No public source comment is attached to this declaration.
pub const fn compilation_stages( &self ) -> &[TrainingCompilationStageRecord]
No public source comment is attached to this declaration.
pub fn capture( engine: &Engine, optimizer: &mut AdamW, step: impl FnOnce() -> Result<Matrix> ) -> Result<Self>
No public source comment is attached to this declaration.