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

[Float8Quant] Add rowwise scaling option to float8 dyanmic quant #819

Merged
merged 1 commit into from
Sep 7, 2024

Conversation

drisspg
Copy link
Contributor

@drisspg drisspg commented Sep 5, 2024

Stacked PRs:


[Float8Quant] Add rowwise scaling option to float8 dyanmic quant

Summary

Adds an option to do PerRow scaling of the activation and weight, which can provide faster activation quantization and better numerics.

The api for calling this is:

import torch
import torch.nn as nn
from torchao.quantization.quant_api import quantize_, PerRow, float8_dynamic_activation_float8_weight

linear_module = nn.Linear(16, 32).to("cuda")

quantize_(linear_module, float8_dynamic_activation_float8_weight(granularity=PerRow())) 

Copy link

pytorch-bot bot commented Sep 5, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/819

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit 0405f9e with merge base 65d86c6 (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

drisspg added a commit that referenced this pull request Sep 5, 2024
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 5, 2024
drisspg added a commit that referenced this pull request Sep 5, 2024
drisspg added a commit that referenced this pull request Sep 5, 2024
drisspg added a commit that referenced this pull request Sep 6, 2024
drisspg added a commit that referenced this pull request Sep 6, 2024
drisspg added a commit that referenced this pull request Sep 6, 2024
drisspg added a commit that referenced this pull request Sep 6, 2024
drisspg added a commit that referenced this pull request Sep 6, 2024
drisspg added a commit that referenced this pull request Sep 6, 2024
@drisspg drisspg changed the title [Float8Quant] Add rowwise scaling option to float8 dyanmic quant [Float8Quant] Add PerRow scaling option to float8 dyanmic quant Sep 6, 2024
@drisspg drisspg changed the title [Float8Quant] Add PerRow scaling option to float8 dyanmic quant [Float8Quant] Add PerRow scaling option to float8 dynamic quant Sep 6, 2024
drisspg added a commit that referenced this pull request Sep 6, 2024
@drisspg drisspg changed the title [Float8Quant] Add PerRow scaling option to float8 dynamic quant [Float8Quant] Add rowwise scaling option to float8 dyanmic quant Sep 6, 2024
Copy link
Contributor

@jerryzh168 jerryzh168 left a comment

Choose a reason for hiding this comment

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

LGTM!

drisspg added a commit that referenced this pull request Sep 7, 2024
drisspg added a commit that referenced this pull request Sep 7, 2024
@drisspg drisspg merged commit e3ce0b9 into main Sep 7, 2024
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants