-
Notifications
You must be signed in to change notification settings - Fork 359
[megatron] Fused LM-head log-prob + entropy (avoid full [*, seq, vocab] logit materialization) #1765
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
Open
dyurk-lila
wants to merge
7
commits into
NovaSky-AI:main
Choose a base branch
from
dyurk-lila:feat/fused-linear-cross-entropy
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[megatron] Fused LM-head log-prob + entropy (avoid full [*, seq, vocab] logit materialization) #1765
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ad7534f
feat(megatron): fused linear log-prob (hidden->logprob) to avoid mate…
dyurk-lila 1227b4c
fix(megatron): Triton fused-logprob OOV gradient + GPU-validated prec…
dyurk-lila 9747c19
fix(megatron): cast hidden to LM-head weight dtype in Triton fused-lo…
dyurk-lila 0a47538
feat(megatron): fused entropy dual-output → wire SFT + ALL RL losses …
dyurk-lila d7626c6
test(megatron): initialize mpu model-parallel state in the Triton ent…
dyurk-lila cfe0c87
chore(megatron): upstream-readiness cleanup for fused linear log-prob
dyurk-lila 91ce4db
Apply suggestions from code review
dyurk-lila File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| SkyRL | ||
| Copyright NovaSky-AI and contributors | ||
|
|
||
| This product includes software developed at third parties, redistributed under | ||
| the Apache License, Version 2.0: | ||
|
|
||
| - verl (https://github.com/volcengine/verl) | ||
| Copyright 2023-2024 Bytedance Ltd. and/or its affiliates | ||
|
|
||
| The fused linear-cross-entropy Triton kernels in | ||
| skyrl/backends/skyrl_train/distributed/megatron/fused_linear_logprob_triton.py | ||
| are adapted from verl/utils/kernel/{kernels.py,linear_cross_entropy.py}. | ||
| Portions of those kernels are: | ||
| Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
|
|
||
| - NeMo-Aligner / NeMo-RL (https://github.com/NVIDIA-NeMo/RL) | ||
| Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. | ||
|
|
||
| Portions of | ||
| skyrl/backends/skyrl_train/distributed/megatron/model_utils.py are ported | ||
| from NeMo-Aligner by way of NeMo-RL. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Claude suggested that this is a proper copyright notice but this should definitely be checked by someone more familiar with the repo's conventions around this