Skip to content

Commit 5359dbf

Browse files
committed
fix
Signed-off-by: Hemil Desai <hemild@nvidia.com>
1 parent 7a3ba3b commit 5359dbf

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

nemo_rl/models/policy/workers/dtensor_policy_worker_v2.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,10 @@ def score(self, data: BatchedDataDict) -> BatchedDataDict[ScoreOutputSpec]:
661661
sequence_dim=sequence_dim,
662662
)
663663

664+
# skip keeping the scores for the dummy batches
665+
if batch_idx >= iterator_len:
666+
continue
667+
664668
all_rm_scores.append(rm_scores)
665669

666670
all_rm_scores = torch.cat(all_rm_scores, dim=0)
@@ -746,6 +750,10 @@ def get_topk_logits(
746750
sequence_dim=sequence_dim,
747751
)
748752

753+
# skip keeping the topk values for the dummy batches
754+
if batch_idx >= iterator_len:
755+
continue
756+
749757
# Keep only real sequence tokens (no trimming here; padded positions can be masked downstream)
750758
# Shapes remain [B, S, k].
751759
out_topk_vals.append(vals.cpu())

0 commit comments

Comments
 (0)