nemo_rl.utils.rpc_guard#

Keep cohort-sized payloads off Ray RPC boundaries.

Actors that exist to take work off the controller only help if the work’s inputs and outputs stay small. Both the token-capture finalizer and the advantage stage move tensors through DataPlane and return metadata, so this guard is what makes “metadata-only” checkable rather than aspirational.

Module Contents#

Functions#

assert_metadata_only

Reject tensors and known heavy row fields reachable from an RPC graph.

Data#

API#

nemo_rl.utils.rpc_guard.FORBIDDEN_RPC_KEYS#

None

nemo_rl.utils.rpc_guard.assert_metadata_only(value: Any, *, path: str = 'rpc') → None#

Reject tensors and known heavy row fields reachable from an RPC graph.