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

Enable specifying alpha for PTQ INT8 SmoothQuant method #9423

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

janekl
Copy link
Collaborator

@janekl janekl commented Jun 10, 2024

What does this PR do ?

Allow users to specifying alpha for INT8 SmoothQuant method. For example, setting it to 0.8 improves Llama3 (8b, 70b) MMLU accuracy results compared to default alpha=1.0.

| MODEL      |   ALPHA |   MMLU |
|------------|---------|--------|
| LLAMA3-70B |    0    |  0.004 |
| LLAMA3-70B |    0.25 |  0.116 |
| LLAMA3-70B |    0.5  |  0.516 |
| LLAMA3-70B |    0.7  |  0.765 |
| LLAMA3-70B |    0.75 |  0.77  |
| LLAMA3-70B |    0.8  |  0.772 |
| LLAMA3-70B |    0.85 |  0.766 |
| LLAMA3-70B |    0.9  |  0.75  |
| LLAMA3-70B |    1    |  0.728 |
| LLAMA3-8B  |    0    |  0.062 |
| LLAMA3-8B  |    0.25 |  0.227 |
| LLAMA3-8B  |    0.5  |  0.379 |
| LLAMA3-8B  |    0.7  |  0.617 |
| LLAMA3-8B  |    0.75 |  0.624 |
| LLAMA3-8B  |    0.8  |  0.625 |
| LLAMA3-8B  |    0.85 |  0.62  |
| LLAMA3-8B  |    0.9  |  0.619 |
| LLAMA3-8B  |    0.95 |  0.612 |
| LLAMA3-8B  |    1    |  0.594 |

Collection: NLP

Changelog

  • Add specific line by line info of high level changes in this PR.

Usage

  • You can potentially add a usage example below
python megatron_quantization.py \
    ...   
    quantization.algorithm=int8_sq \
    quantization.alpha=0.5 \
    ....

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

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.

Additional Information

  • Related to # (issue)

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
@janekl janekl force-pushed the jlasek/add_smoothquant_alpha branch from aea58b6 to 625ea5b Compare June 11, 2024 09:23
@janekl janekl added Run CICD and removed Run CICD labels Jun 11, 2024
Copy link
Collaborator

@oyilmaz-nvidia oyilmaz-nvidia left a comment

Choose a reason for hiding this comment

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

LGTM.

@oyilmaz-nvidia oyilmaz-nvidia merged commit 97aa732 into main Jun 11, 2024
112 checks passed
@oyilmaz-nvidia oyilmaz-nvidia deleted the jlasek/add_smoothquant_alpha branch June 11, 2024 14:27
galv pushed a commit to galv/NeMo that referenced this pull request Jun 13, 2024
Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
JesusPaz pushed a commit to JesusPaz/NeMo that referenced this pull request Jun 18, 2024
Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
rohitrango pushed a commit to rohitrango/NeMo that referenced this pull request Jun 25, 2024
Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
@ko3n1g ko3n1g mentioned this pull request Jul 18, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants