pub struct PpNRt { /* private fields */ }Implementations§
Source§impl PpNRt
impl PpNRt
Sourcepub fn get(e: &Engine) -> Result<&'static PpNRt, Box<dyn Error>>
pub fn get(e: &Engine) -> Result<&'static PpNRt, Box<dyn Error>>
The process-wide transport runtime, built on first use against the primary engine. The stage count + device map freeze at first build (one config per process — gates run one placement per invocation). Build errors are sticky and loud.
pub fn n_stages(&self) -> usize
Sourcepub fn cross_device(&self) -> bool
pub fn cross_device(&self) -> bool
True iff any boundary crosses devices (transport = cudaMemcpyPeerAsync there).
Sourcepub fn engine<'a>(&'a self, s: usize, primary: &'a Engine) -> &'a Engine
pub fn engine<'a>(&'a self, s: usize, primary: &'a Engine) -> &'a Engine
The engine a stage’s subgraph must run through: the primary engine when the stage lives on the primary device, else the stage’s own (remote-context) engine.
Sourcepub fn enter(&self, s: usize) -> StreamOverride
pub fn enter(&self, s: usize) -> StreamOverride
Enter stage s: until the guard drops, every engine op on this thread launches on
the stage’s stream (memra_runtime ambient-stream override).
Sourcepub fn tx(
&self,
b: usize,
x: &CudaSlice<f32>,
n: usize,
) -> Result<usize, Box<dyn Error>>
pub fn tx( &self, b: usize, x: &CudaSlice<f32>, n: usize, ) -> Result<usize, Box<dyn Error>>
Boundary TX at boundary b (call within the stage-b scope; x = the
materialized [n] residual): wait for the slot’s previous RX (write-after-read
guard), copy x into the slot’s persistent buffer via the boundary’s transport on
stage-b’s stream (the owning-stream/publication law), record ev_tx. Returns the
slot index for the paired rx().
Sourcepub fn rx(
&self,
b: usize,
slot_idx: usize,
n: usize,
) -> Result<CudaSlice<f32>, Box<dyn Error>>
pub fn rx( &self, b: usize, slot_idx: usize, n: usize, ) -> Result<CudaSlice<f32>, Box<dyn Error>>
Boundary RX at boundary b (call within the stage-b+1 scope): wait on the slot’s
ev_tx, copy the boundary buffer into a fresh working buffer (dtod on the RX stream —
local on the RX device in both transports), record ev_rx. The returned buffer is
RX-stage-owned: allocated, consumed, and eventually freed on that stage’s stream.
Sourcepub fn record_done(&self) -> Result<CudaEvent, Box<dyn Error>>
pub fn record_done(&self) -> Result<CudaEvent, Box<dyn Error>>
Deferred readback: record a fresh completion event on the LAST stage’s stream (call after the step’s logits matmul has been enqueued there).
Sourcepub fn readback_stream(&self) -> &Arc<CudaStream> ⓘ
pub fn readback_stream(&self) -> &Arc<CudaStream> ⓘ
The dedicated readback stream (last stage’s context).