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

Optimize performance by fuse adding high precision tensor to fp8 tensor #132

Merged
merged 6 commits into from
Nov 24, 2023

Conversation

tocean
Copy link
Contributor

@tocean tocean commented Nov 22, 2023

Description
Optimize performance by fuse add high precision tensor to fp8 tensor

Major Revision

  • Add an extension msamp_arithmetic
  • Add fuse kernel for adding high precision tensor to FP8 in extension
  • Move common header files to msamp/common/include
  • Add UT
  • Apply it megatron-FP8DistributedDataParallel

@cp5555 cp5555 mentioned this pull request Nov 22, 2023
9 tasks
wkcn

This comment was marked as outdated.

Copy link
Contributor

@wkcn wkcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please declare the source and license of msamp/operators/arithmetic/vectorized_pointwise.h, msamp/common/include/concurrency.h and msamp/common/include/poll.h

An example:
Adapted from xxx, xxx license.

@wkcn wkcn self-requested a review November 22, 2023 11:40
@tocean
Copy link
Contributor Author

tocean commented Nov 23, 2023

Please declare the source and license of msamp/operators/arithmetic/vectorized_pointwise.h, msamp/common/include/concurrency.h and msamp/common/include/poll.h

An example: Adapted from xxx, xxx license.

Good suggestion. Fixed.

msamp/common/include/common.h Outdated Show resolved Hide resolved
tests/operators/test_arithmetic.py Outdated Show resolved Hide resolved
tests/operators/test_arithmetic.py Outdated Show resolved Hide resolved
@tocean tocean changed the title Optimize performance by fuse add high precision tensor to fp8 tensor Optimize performance by fuse adding high precision tensor to fp8 tensor Nov 24, 2023
@tocean
Copy link
Contributor Author

tocean commented Nov 24, 2023

Verified correctness using GPT3-345m:

baseline:
validation loss at iteration 1000 | lm loss value: 6.059220E+00 | lm loss PPL: 4.280416E+02 |

exp:
validation loss at iteration 1000 | lm loss value: 6.059220E+00 | lm loss PPL: 4.280416E+02 |

@tocean tocean enabled auto-merge (squash) November 24, 2023 03:35
@tocean tocean merged commit 4480ffa into main Nov 24, 2023
9 checks passed
@tocean tocean deleted the yuxiang/perf_opt_ext branch November 24, 2023 09:39
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