Skip to content

Commit d95c8d8

Browse files
added logging
1 parent 8943f81 commit d95c8d8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

open_instruct/model_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,9 @@ def log_softmax_and_gather(logits: torch.Tensor, index: torch.Tensor) -> torch.T
519519
See https://github.com/allenai/open-instruct/pull/584
520520
"""
521521
B, T, V = logits.shape
522+
logger.info(f"log_softmax_and_gather - logits.shape: {logits.shape}, logits.stride(): {logits.stride()}, logits.is_contiguous(): {logits.is_contiguous()}")
523+
logger.info(f"log_softmax_and_gather - index.shape: {index.shape}, index.stride(): {index.stride()}, index.is_contiguous(): {index.is_contiguous()}")
524+
logger.info(f"log_softmax_and_gather - B={B}, T={T}, V={V}")
522525
return -torch.nn.functional.cross_entropy(logits.view(-1, V), index.view(-1), reduction="none").view(B, T)
523526

524527

0 commit comments

Comments
 (0)