nemo_rl.utils.multimodal_payload_metrics#
Module Contents#
Functions#
Estimate data bytes, optionally counting shared leaves only once. |
|
Count media leaves, optionally counting shared objects only once. |
|
Count media embedded in typed vLLM content without counting prompt text. |
|
Count media leaves embedded in typed content without counting text. |
|
Return cloudpickle protocol-5 frame plus out-of-band buffer bytes. |
|
Measure one exact Ray argument without scanning when disabled. |
|
Aggregate metrics over the exact unique per-DP-shard Ray arguments. |
|
Aggregate payload measurements collected during one logging interval. |
|
Return and clear payload measurements recorded in this process. |
|
Record metrics for the logger and print a stable, scrapeable line. |
Data#
API#
- nemo_rl.utils.multimodal_payload_metrics._PENDING_PAYLOAD_METRICS: dict[str, int | float]#
None
- nemo_rl.utils.multimodal_payload_metrics._PENDING_PAYLOAD_METRICS_LOCK#
‘Lock(…)’
- nemo_rl.utils.multimodal_payload_metrics._tensor_nbytes(value: torch.Tensor | None) int#
- nemo_rl.utils.multimodal_payload_metrics._value_nbytes(value: Any, seen: set[int] | None = None) int#
Estimate data bytes, optionally counting shared leaves only once.
- nemo_rl.utils.multimodal_payload_metrics._value_segment_count(
- value: Any,
- seen: set[int] | None = None,
Count media leaves, optionally counting shared objects only once.
- nemo_rl.utils.multimodal_payload_metrics._typed_content_media_nbytes(
- value: Any,
- seen: set[int] | None = None,
Count media embedded in typed vLLM content without counting prompt text.
- nemo_rl.utils.multimodal_payload_metrics._typed_content_media_segment_count(
- value: Any,
- seen: set[int] | None = None,
Count media leaves embedded in typed content without counting text.
- nemo_rl.utils.multimodal_payload_metrics.protocol5_serialized_nbytes(value: Any) int#
Return cloudpickle protocol-5 frame plus out-of-band buffer bytes.
- nemo_rl.utils.multimodal_payload_metrics.collect_multimodal_payload_metrics(
- data: Any,
- boundary: str,
- *,
- enabled: bool,
Measure one exact Ray argument without scanning when disabled.
- nemo_rl.utils.multimodal_payload_metrics.collect_sharded_multimodal_payload_metrics(
- shards: collections.abc.Sequence[collections.abc.Mapping[str, Any]],
- boundary: str,
- *,
- enabled: bool,
Aggregate metrics over the exact unique per-DP-shard Ray arguments.
- nemo_rl.utils.multimodal_payload_metrics.merge_multimodal_payload_metrics(
- metric_sets: collections.abc.Sequence[collections.abc.Mapping[str, int | float]],
Aggregate payload measurements collected during one logging interval.
Byte and segment counts are summed because repeated calls represent distinct Ray transfers. Per-call maxima and shard counts retain their maximum value, and physical-to-logical ratios are recomputed from the aggregated byte totals instead of averaging ratios.
- nemo_rl.utils.multimodal_payload_metrics.drain_multimodal_payload_metrics() dict[str, int | float]#
Return and clear payload measurements recorded in this process.
- nemo_rl.utils.multimodal_payload_metrics.print_multimodal_payload_metrics(
- metrics: collections.abc.Mapping[str, int | float],
Record metrics for the logger and print a stable, scrapeable line.