[PyTorch] Deprecate unused is_cg_capturable in parallel_cross_entropy - #41
Closed
pggPL wants to merge 3 commits into
Closed
[PyTorch] Deprecate unused is_cg_capturable in parallel_cross_entropy#41pggPL wants to merge 3 commits into
pggPL wants to merge 3 commits into
Conversation
Since NVIDIA#3273 the cross entropy backward no longer contains a synchronization point, so the operation is always CUDA graph capturable and the flag has no effect. Keep accepting it on the public API for backward compatibility (with a FutureWarning), drop the dead internal plumbing. Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Owner
Author
|
Superseded by NVIDIA#3455 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Since NVIDIA#3273 the fused cross entropy backward reconstructs the derivative from saved statistics and no longer contains the
torch.equal-based synchronization point. Theis_cg_capturableflag therefore has no effect — the operation is always CUDA graph capturable.This PR marks the flag as deprecated on the public
parallel_cross_entropyAPI (docstring note +FutureWarningwhen set) and removes the dead internal plumbing. The parameter is kept in the signature for backward compatibility, since Megatron-LM passes it explicitly.Should also be mentioned as deprecated in the v2.19 release notes.
Type of change
Changes
Please list the changes introduced in this PR:
is_cg_capturableinparallel_cross_entropy: docstring now states it is unused, and passingTrueemits aFutureWarning.CrossEntropyFunction,_parallel_cross_entropy_overwrite_inputand the Tritoncross_entropy_backwardwrapper, where it was already a no-op.Checklist: