nemo_rl.algorithms.loss.clipped_pg#
Module Contents#
Functions#
Copy scalar metrics to the host in one synchronization. |
|
Compute optional diagnostics for the full metric set. |
|
Compute and reduce the actor objective in one compilable region. |
API#
- nemo_rl.algorithms.loss.clipped_pg.materialize_scalar_metrics(
- metrics: dict[str, torch.Tensor],
- dtype: torch.dtype,
Copy scalar metrics to the host in one synchronization.
- nemo_rl.algorithms.loss.clipped_pg.clipped_pg_diagnostic_metrics(
- *,
- curr_logprobs: torch.Tensor,
- prev_logprobs: torch.Tensor,
- generation_logprobs: torch.Tensor,
- ratios: torch.Tensor,
- ratios_clamped: torch.Tensor,
- mask: torch.Tensor,
- global_valid_toks: torch.Tensor,
- reference_policy_kl_type: str,
Compute optional diagnostics for the full metric set.
- nemo_rl.algorithms.loss.clipped_pg.clipped_pg_actor_objective(
- curr_logprobs: torch.Tensor,
- *,
- prev_logprobs: torch.Tensor,
- advantages: torch.Tensor,
- token_mask: torch.Tensor,
- mask: torch.Tensor,
- sample_mask: torch.Tensor,
- importance_weights: Optional[torch.Tensor],
- global_valid_toks: torch.Tensor,
- global_valid_seqs: torch.Tensor,
- ratio_clip_min: float,
- ratio_clip_max: float,
- ratio_clip_c: float,
- disable_ppo_ratio: bool,
- force_on_policy_ratio: bool,
- sequence_level_importance_ratios: bool,
- use_cispo: bool,
- token_level_loss: bool,
Compute and reduce the actor objective in one compilable region.