Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement megatron-aware perplexity in torchmetrics #525

Open
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

sichu2023
Copy link
Collaborator

@sichu2023 sichu2023 commented Dec 12, 2024

Summary

Replace PerplexityLoggingCallback with parallelism-aware MegatronPerplexityMetric. Pipeline parallel is not supported yet.

Usage

Added perplexity logging in argparse.

python sub-packages/bionemo-esm2/src/bionemo/esm2/scripts/train_esm2.py --log-train-ppl --log-val-ppl

Testing

Added under sub-packages/bionemo-llm/tests/bionemo/llm/test_lightning.py

Tests for these changes can be run via:

pytest -v sub-packages/bionemo-llm/tests/bionemo/llm/test_lightning.py

@sichu2023
Copy link
Collaborator Author

Previous @pstjohn 's effort
#382

@sichu2023 sichu2023 self-assigned this Dec 12, 2024
@sichu2023 sichu2023 changed the base branch from main to sichu/update-ddp-config December 12, 2024 14:00
@sichu2023 sichu2023 force-pushed the sichu/update-ddp-config branch 2 times, most recently from ecd102a to cfa66d3 Compare December 12, 2024 17:28
@sichu2023 sichu2023 force-pushed the sichu/update-ddp-config branch from cfa66d3 to e1e9037 Compare December 16, 2024 16:59
@sichu2023
Copy link
Collaborator Author

Exponential Validation Loss vs Validation Perplexity
Test run on single device without parallelism.

@sichu2023 sichu2023 force-pushed the sichu/torchmetrics-ppl-logging branch from 2fd1fd7 to 4959e80 Compare December 19, 2024 19:48
@sichu2023 sichu2023 changed the base branch from sichu/update-ddp-config to main December 19, 2024 19:54
@sichu2023 sichu2023 marked this pull request as ready for review December 19, 2024 19:55
@sichu2023 sichu2023 force-pushed the sichu/torchmetrics-ppl-logging branch from 1de355d to 32e0568 Compare December 19, 2024 19:56
@sichu2023
Copy link
Collaborator Author

On multi-device DP
Exponential of Validation Loss and Validation PPL over Time

@sichu2023
Copy link
Collaborator Author

And on multi-device TP x DP.
Uploading Exponential of Validation Loss and Validation PPL over Time (Second Set).png…

@sichu2023 sichu2023 requested review from pstjohn and jstjohn December 19, 2024 23:57
@sichu2023 sichu2023 force-pushed the sichu/torchmetrics-ppl-logging branch from 007c6e0 to 78aa7a3 Compare December 20, 2024 00:09
@sichu2023 sichu2023 enabled auto-merge (squash) December 20, 2024 00:09
@sichu2023
Copy link
Collaborator Author

/build-ci

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants