Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions miles/backends/fsdp_utils/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,9 @@ def train(self, rollout_id: int, rollout_data_ref: Box) -> None:

pg_loss, pg_clipfrac = compute_policy_loss(ppo_kl, advantages, self.args.eps_clip, self.args.eps_clip_high)

rollout_log_probs = torch.cat([batch["rollout_log_probs"] for batch in unpacked_batches], dim=0)
rollout_log_probs = rollout_log_probs.to(device=log_probs.device)

# Apply TIS before sample mean calculation
if self.args.use_tis:
# Initialize TIS variables
Expand All @@ -444,9 +447,6 @@ def train(self, rollout_id: int, rollout_data_ref: Box) -> None:
for batch in unpacked_batches
), "rollout_log_probs must be provided as non-empty torch.Tensor for TIS"

rollout_log_probs = torch.cat([batch["rollout_log_probs"] for batch in unpacked_batches], dim=0)
rollout_log_probs = rollout_log_probs.to(device=log_probs.device)

tis = torch.exp(old_log_probs - rollout_log_probs)
ois = (-ppo_kl).exp()
tis_clip = torch.clamp(
Expand Down