Distributed optimizer support for experimental FP8 tensors#7469
Closed
timmoon10 wants to merge 6 commits intoNVIDIA-NeMo:mainfrom
Closed
Distributed optimizer support for experimental FP8 tensors#7469timmoon10 wants to merge 6 commits intoNVIDIA-NeMo:mainfrom
timmoon10 wants to merge 6 commits intoNVIDIA-NeMo:mainfrom
Conversation
Signed-off-by: Tim Moon <tmoon@nvidia.com>
Signed-off-by: Tim Moon <tmoon@nvidia.com>
Signed-off-by: Tim Moon <tmoon@nvidia.com>
Signed-off-by: Tim Moon <tmoon@nvidia.com>
for more information, see https://pre-commit.ci
| bucket_id = fragment.bucket_id | ||
| bucket_start, bucket_end = fragment.bucket_range | ||
| param_start, param_end = fragment.param_range | ||
| if param_end <= param_start or bucket_id not in self._params_buckets: |
Check notice
Code scanning / CodeQL
Unused local variable
| HAVE_TE_FP8TENSOR = False | ||
| try: | ||
| from transformer_engine.pytorch import Float8Tensor | ||
| from transformer_engine.pytorch.cpp_extensions import cast_to_fp8 |
Check notice
Code scanning / CodeQL
Empty except
This was referenced Sep 28, 2023
Contributor
|
This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days. |
Contributor
|
This PR was closed because it has been inactive for 7 days since being marked as stale. |
This was referenced Nov 14, 2023
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.
What does this PR do ?
This PR integrates with experimental
Float8Tensors from the Transformer Engine float8tensor_experiments branch. This allows the model to only store FP8 weight matrices. The distributed optimizer will store an FP32 master copy of the weights and will perform param all-gathers in FP8.Collection: NLP
Changelog
Usage
Enable FP8 support:
https://github.com/NVIDIA/NeMo/blob/19a3b7015fe353199af97903df1814e3a470b503/examples/nlp/language_modeling/conf/megatron_gpt_config.yaml#L169
Use Megatron-core model:
https://github.com/NVIDIA/NeMo/blob/19a3b7015fe353199af97903df1814e3a470b503/examples/nlp/language_modeling/conf/megatron_gpt_config.yaml#L49
Set the optimizer to
distributed_fused_adam:https://github.com/NVIDIA/NeMo/blob/f8be40b75ee1f8437b56fcc9602dc2aaddfb0643/examples/nlp/language_modeling/conf/megatron_gpt_config.yaml#L228
Before your PR is "Ready for review"
Pre checks:
PR Type:
If you haven't finished some of the above items you can still open "Draft" PR.
Who can review?
Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.
Pinging @sudhakarsingh27.
Additional Information