Skip to content

Unify float8 scale selection for per-tensor quantization#3635

Merged
jerryzh168 merged 2 commits intopytorch:mainfrom
MagellaX:fix/issue-3414-choose-scale-float8
Jan 24, 2026
Merged

Unify float8 scale selection for per-tensor quantization#3635
jerryzh168 merged 2 commits intopytorch:mainfrom
MagellaX:fix/issue-3414-choose-scale-float8

Conversation

@MagellaX
Copy link
Copy Markdown
Contributor

Summary

  • Remove the per-tensor special case in _choose_scale_float8 and use the unified reduction path
  • Update float8 tests to use per-tensor block_size == input_tensor.shape

#3414

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Jan 14, 2026

🔗 Helpful Links

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

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

✅ No Failures

As of commit 0dc6470 with merge base c6d21f9 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@meta-cla
Copy link
Copy Markdown

meta-cla bot commented Jan 14, 2026

Hi @MagellaX!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla meta-cla 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 Jan 14, 2026
@meta-cla
Copy link
Copy Markdown

meta-cla bot commented Jan 14, 2026

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

torch.uint7: 7,
}
)
_SUB_BYTE_UINT_BOUNDS = {}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

could you split this change to a separate PR? seems it's not related to the fp8 choose_scale op change right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks! You’re right, that change is unrelated. I’m cleaning the branch now and will update the PR with only the float8 scale change.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@MagellaX seems still not updated yet

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i think it is now!!!

@MagellaX MagellaX force-pushed the fix/issue-3414-choose-scale-float8 branch from b7cf506 to 92b74d8 Compare January 14, 2026 20:46
@MagellaX MagellaX requested a review from jerryzh168 January 15, 2026 07:36
@MagellaX MagellaX requested a review from jerryzh168 January 23, 2026 08:02
@jerryzh168 jerryzh168 added the module: not user facing Use this tag if you don't want this PR to show up in release notes label Jan 23, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Jan 23, 2026

@jerryzh168 has imported this pull request. If you are a Meta employee, you can view this in D91344844.

@jerryzh168
Copy link
Copy Markdown
Contributor

this breaks BC for _choose_scale_float8 for per tensor block_size but since _choose_scale_float8 is a private op, we don't need to mark it as BC breaking

@jerryzh168 jerryzh168 merged commit d169423 into pytorch:main Jan 24, 2026
21 of 23 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. module: not user facing Use this tag if you don't want this PR to show up in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants