nemo_gym.token_id_capture.adapters.megatron
nemo_gym.token_id_capture.adapters.megatron
Dependency-light extraction adapter for Megatron Inference offloaded payloads.
Module Contents
Classes
Functions
Data
API
Translate Megatron inference request/response material at the framework boundary.
Megatron inference offloads exact prompt ids, generated ids, and selected-token log
probabilities as attributes on a payload object rather than as a chat
completion dict. The adapter reads either shape so extraction failures
flow through RolloutTokenCapture.complete_call_from_response and
poison the call with capture_failed coordinates, the same outcome the
vLLM adapter produces.
Read one field from a Megatron Inference payload object or an equivalent mapping.
Read a log-probability field, rejecting non-numeric elements.
Read a token-id field, rejecting anything but plain integers.
Megatron Inference hands host-side list[int] values. A float, string, or
bool element means the payload is malformed; int() would silently
truncate or coerce it into a plausible-looking id.