Realm

oa::ml::nn::Empyrealm

OA’s embedding-plus-hybrid-Mamba core with one canonical Rust execution path. The stack interleaves Mamba-3 blocks with evenly spaced causal self-attention blocks (Nemotron-style), each followed by a dense or routed-expert feed-forward tail. Whole-sequence forward runs through the module graph; single-token decode threads caller-owned EmpyrealmState through step/step_embedded.

StRust public API

Declaration

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

Public Methods

pub fn forward(&self, tokens: &Matrix) -> Result<Matrix>
pub fn forward_embedded(&self, embedded: &Matrix) -> Result<Matrix>
pub fn new_state(&self, batch_size: usize) -> Result<EmpyrealmState>
pub fn step( &self, tokens: &Matrix, state: &mut EmpyrealmState, ) -> Result<Matrix>
pub fn step_embedded( &self, embedded: &Matrix, state: &mut EmpyrealmState, ) -> Result<Matrix>
pub fn layer_count(&self) -> usize
pub fn attention_indices(&self) -> Vec<usize>
fn forward(&self, input: &Matrix) -> Result<Matrix>
fn registry(&self) -> &ModuleRegistry
fn parameters(&self) -> Vec<Parameter>
fn named_parameters(&self) -> Vec<NamedParameter>
fn buffers(&self) -> Vec<Matrix>
fn named_buffers(&self) -> Vec<NamedBuffer>
fn all_parameters(&self) -> Result<Vec<Parameter>>
fn all_named_parameters(&self) -> Result<Vec<NamedParameter>>
fn all_named_buffers(&self) -> Result<Vec<NamedBuffer>>
fn all_named_state_u32(&self) -> Result<Vec<NamedStateU32>>
fn num_parameters(&self) -> Result<usize>
fn train(&self, training: bool)
fn eval(&self)
fn is_training(&self) -> bool
fn scoped_eval(&self) -> ScopedEval<'_>

Associated Functions

pub fn new_with_seed( engine: &Engine, vocab_size: usize, config: EmpyrealmConfig, seed: u64, ) -> Result<Self>

Public Method Documentation

pub fn forward( &self, tokens: &Matrix ) -> Result<Matrix>
No public source comment is attached to this declaration.
pub fn forward_embedded( &self, embedded: &Matrix ) -> Result<Matrix>
No public source comment is attached to this declaration.
pub fn new_state( &self, batch_size: usize ) -> Result<EmpyrealmState>
No public source comment is attached to this declaration.
pub fn step( &self, tokens: &Matrix, state: &mut EmpyrealmState ) -> Result<Matrix>
No public source comment is attached to this declaration.
pub fn step_embedded( &self, embedded: &Matrix, state: &mut EmpyrealmState ) -> Result<Matrix>
No public source comment is attached to this declaration.
pub fn layer_count( &self ) -> usize
No public source comment is attached to this declaration.
pub fn attention_indices( &self ) -> Vec<usize>
No public source comment is attached to this declaration.
fn forward( &self, input: &Matrix ) -> Result<Matrix>
No public source comment is attached to this declaration.
fn registry( &self ) -> &ModuleRegistry
No public source comment is attached to this declaration.
fn parameters( &self ) -> Vec<Parameter>
No public source comment is attached to this declaration.
fn named_parameters( &self ) -> Vec<NamedParameter>
No public source comment is attached to this declaration.
fn buffers( &self ) -> Vec<Matrix>
No public source comment is attached to this declaration.
fn named_buffers( &self ) -> Vec<NamedBuffer>
No public source comment is attached to this declaration.
fn all_parameters( &self ) -> Result<Vec<Parameter>>
No public source comment is attached to this declaration.
fn all_named_parameters( &self ) -> Result<Vec<NamedParameter>>
No public source comment is attached to this declaration.
fn all_named_buffers( &self ) -> Result<Vec<NamedBuffer>>
No public source comment is attached to this declaration.
fn all_named_state_u32( &self ) -> Result<Vec<NamedStateU32>>
No public source comment is attached to this declaration.
fn num_parameters( &self ) -> Result<usize>
No public source comment is attached to this declaration.
fn train( &self, training: bool )
No public source comment is attached to this declaration.
fn eval( &self )
No public source comment is attached to this declaration.
fn is_training( &self ) -> bool
No public source comment is attached to this declaration.
fn scoped_eval( &self ) -> ScopedEval<'_>
No public source comment is attached to this declaration.
pub fn new_with_seed( engine: &Engine, vocab_size: usize, config: EmpyrealmConfig, seed: u64 ) -> Result<Self>
No public source comment is attached to this declaration.