Skip to content

Commit

Permalink
move pp check to train_esm2.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sichu2023 committed Dec 20, 2024
1 parent dcc84ec commit fb5ad07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ def main(
if scheduler_num_steps is None:
scheduler_num_steps = num_steps

if (log_train_ppl or log_val_ppl) and pipeline_model_parallel_size > 1:
raise NotImplementedError("Perplexity logging does not support pipeline parallelism yet.")

model = biobert_lightning_module(
esm2_config,
tokenizer=tokenizer,
Expand Down
3 changes: 0 additions & 3 deletions sub-packages/bionemo-llm/src/bionemo/llm/lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,6 @@ def __init__(
# all scaling on the internal states are cancelled out in the formula "exp(total_log_probs / count)" so we can safely sum across all devices
self.log_train_ppl = log_train_ppl
self.log_val_ppl = log_val_ppl
if (log_train_ppl or log_val_ppl) and self.trainer.strategy.pipeline_model_parallel_size > 1:
raise NotImplementedError("Perplexity logging does not support pipeline parallelism yet.")

if log_train_ppl:
self.train_ppl = MegatronPerplexityMetric(ignore_index=-100)
if log_val_ppl:
Expand Down

0 comments on commit fb5ad07

Please sign in to comment.