pub struct CompiledProgram { /* private fields */ }Implementations§
Source§impl CompiledProgram
impl CompiledProgram
pub fn evaluate( &self, _py: Python<'_>, return_grads: bool, samples: Option<usize>, seed: Option<u64>, confidence: f64, max_nonmonotone_iterations: usize, sampling_method: Option<String>, memory_mb: Option<u64>, allow_cpu_oracle: bool, ) -> PyResult<EvalResult>
Sourcepub fn evaluate_device(
&self,
py: Python<'_>,
samples: Option<usize>,
seed: Option<u64>,
confidence: f64,
max_nonmonotone_iterations: usize,
sampling_method: Option<String>,
memory_mb: Option<u64>,
) -> PyResult<McDeviceEvalResult>
pub fn evaluate_device( &self, py: Python<'_>, samples: Option<usize>, seed: Option<u64>, confidence: f64, max_nonmonotone_iterations: usize, sampling_method: Option<String>, memory_mb: Option<u64>, ) -> PyResult<McDeviceEvalResult>
Evaluate Monte Carlo programs and return device-only result counts via DLPack.
This is the primary GPU-native API surface for MC inference. It never performs device->host reads for result data (only returns device buffers).
Sourcepub fn zero_grad(&self, py: Python<'_>) -> PyResult<()>
pub fn zero_grad(&self, py: Python<'_>) -> PyResult<()>
Zero gradients for all registered networks.
This should be called at the start of each training iteration to clear accumulated gradients from previous iterations.
Sourcepub fn optimizer_step(&self, py: Python<'_>) -> PyResult<()>
pub fn optimizer_step(&self, py: Python<'_>) -> PyResult<()>
Perform optimizer step for all registered networks.
This applies the accumulated gradients to update network parameters. Should be called after forward_backward().
Sourcepub fn clip_grad_norms(&self, py: Python<'_>, max_norm: f64) -> PyResult<()>
pub fn clip_grad_norms(&self, py: Python<'_>, max_norm: f64) -> PyResult<()>
Clip gradient norms for all registered networks.
Uses torch.nn.utils.clip_grad_norm_.
Sourcepub fn evaluate_loss(&self, queries: Vec<String>) -> PyResult<f64>
pub fn evaluate_loss(&self, queries: Vec<String>) -> PyResult<f64>
Sourcepub fn memory_stats(&self, py: Python<'_>) -> PyResult<PyObject>
pub fn memory_stats(&self, py: Python<'_>) -> PyResult<PyObject>
Return memory diagnostics including allocated_bytes and memory_limit_bytes.
pub fn rule_provenance(&self, py: Python<'_>) -> PyResult<PyObject>
pub fn proof_traces(&self, py: Python<'_>) -> PyResult<PyObject>
pub fn host_transfer_stats(&self, py: Python<'_>) -> PyResult<PyObject>
pub fn reset_host_transfer_stats(&self)
pub fn neural_hot_loop_diagnostics(&self, py: Python<'_>) -> PyResult<PyObject>
pub fn cuda_graph_stats(&self, py: Python<'_>) -> PyResult<PyObject>
Trait Implementations§
Source§impl IntoPy<Py<PyAny>> for CompiledProgram
impl IntoPy<Py<PyAny>> for CompiledProgram
Source§impl<'py> IntoPyObject<'py> for CompiledProgram
impl<'py> IntoPyObject<'py> for CompiledProgram
Source§type Target = CompiledProgram
type Target = CompiledProgram
Source§type Output = Bound<'py, <CompiledProgram as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <CompiledProgram as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PyClass for CompiledProgram
impl PyClass for CompiledProgram
Source§impl PyClassImpl for CompiledProgram
impl PyClassImpl for CompiledProgram
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§type ThreadChecker = SendablePyClass<CompiledProgram>
type ThreadChecker = SendablePyClass<CompiledProgram>
type Inventory = Pyo3MethodsInventoryForCompiledProgram
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a CompiledProgram
impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a CompiledProgram
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a mut CompiledProgram
impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a mut CompiledProgram
Source§impl PyTypeInfo for CompiledProgram
impl PyTypeInfo for CompiledProgram
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
§fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
renamed to PyTypeInfo::type_object
PyTypeInfo::type_object].§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type or a subclass of this type.§fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
renamed to PyTypeInfo::is_type_of
PyTypeInfo::is_type_of].§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type.§fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
renamed to PyTypeInfo::is_exact_type_of
PyTypeInfo::is_exact_type_of].impl DerefToPyAny for CompiledProgram
Auto Trait Implementations§
impl Freeze for CompiledProgram
impl !RefUnwindSafe for CompiledProgram
impl Send for CompiledProgram
impl Sync for CompiledProgram
impl Unpin for CompiledProgram
impl UnsafeUnpin for CompiledProgram
impl UnwindSafe for CompiledProgram
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
§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
self into an owned Python object, dropping type information and unbinding it
from the 'py lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
self into a Python object. Read more