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

Add hardware check to fp8 quant #1314

Merged
merged 6 commits into from
Nov 26, 2024
Merged

Add hardware check to fp8 quant #1314

merged 6 commits into from
Nov 26, 2024

Conversation

jainapurva
Copy link
Contributor

@jainapurva jainapurva commented Nov 19, 2024

Add hardware check to ensure fp8 quantization only attempts runs on compatible hardware.

Test Plan: Ran float8_dynamic_quant on A100, MI300X, H100

Issue: #1188

Copy link

pytorch-bot bot commented Nov 19, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit 9624574 with merge base 8b1b168 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@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 Nov 19, 2024
@jainapurva jainapurva requested a review from drisspg November 19, 2024 21:57
@jainapurva jainapurva added the topic: bug fix Use this tag for PRs that fix bugs label Nov 19, 2024
@@ -939,6 +940,9 @@ def float8_dynamic_activation_float8_weight(
mm_config (Float8MMConfig): Configuration for the matrix multiplication. Default uses fast accumulation.

"""
assert (
is_cuda_8_9
), "Float8 dynamic activation quantization is only supported on CUDA 8.9 and above"
Copy link
Contributor

Choose a reason for hiding this comment

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

This should also be supported on AMD. We should probably update this check.

cc @jeffdaily

Summary:

Test Plan: Tested on AMD Instinct MI300X

Reviewers:

Subscribers:

Tasks:

Tags:
@jainapurva jainapurva marked this pull request as ready for review November 22, 2024 20:05
@@ -939,6 +941,9 @@ def float8_dynamic_activation_float8_weight(
mm_config (Float8MMConfig): Configuration for the matrix multiplication. Default uses fast accumulation.

"""
assert (
is_cuda_8_9 or is_MI300()
Copy link
Contributor

Choose a reason for hiding this comment

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

if granularity is PerTensor then it is sm89 if it is PerRow then it is currenlty sm90 or higher

@jainapurva jainapurva linked an issue Nov 25, 2024 that may be closed by this pull request
@jainapurva jainapurva merged commit 478d15b into main Nov 26, 2024
18 checks passed
yanbing-j pushed a commit to yanbing-j/ao that referenced this pull request Dec 9, 2024
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. topic: bug fix Use this tag for PRs that fix bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FLOAT8] Add Hardware Compatibility Check for FP8 Quantization
4 participants