Skip to content

Conversation

danielvegamyhre
Copy link
Contributor

@danielvegamyhre danielvegamyhre commented Sep 27, 2025

Fixes #3069

Discussed issue with @vkuzo offline, references to Float8Linear in quant_api.py conversion code are technical debt that can be removed.

Copy link

pytorch-bot bot commented Sep 27, 2025

🔗 Helpful Links

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

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

❌ 2 New Failures

As of commit 5e88d65 with merge base d2fae7a (image):

NEW FAILURES - The following jobs have failed:

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

@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 Sep 27, 2025
@danielvegamyhre danielvegamyhre added topic: not user facing Use this tag if you don't want this PR to show up in release notes and removed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Sep 27, 2025
Copy link
Contributor

@vkuzo vkuzo left a comment

Choose a reason for hiding this comment

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

lg if CI is green

@jerryzh168
Copy link
Contributor

I don't think it's as simple as just removing it? @jainapurva might have more context on why this is needed IIRC

@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 Sep 27, 2025
@jainapurva
Copy link
Contributor

jainapurva commented Sep 30, 2025

I don't think it's as simple as just removing it? @jainapurva might have more context on why this is needed IIRC

This code was added to enable quantization using quantize_ api of torchao's fp8 trained model, which is a Float8Linear Tensor. To remove this, we need to test the following flow: TorchAO's Fp8 pre-trained model (model will have Float8Linear layer), then quantize the model using quantize_ api.

@danielvegamyhre
Copy link
Contributor Author

I don't think it's as simple as just removing it? @jainapurva might have more context on why this is needed IIRC

This code was added to enable quantization using quantize_ api of torchao's fp8 trained model, which is a Float8Linear Tensor. To remove this, we need to test the following flow: TorchAO's Fp8 pre-trained model (model will have Float8Linear layer), then quantize the model using quantize_ api.

The code being removed dequantizes the model (swaps Float8Linear -> nn.Linear) using the quantize_ api. Why do we need the quantize_ api to do this?

@jainapurva
Copy link
Contributor

jainapurva commented Sep 30, 2025 via email

@vkuzo
Copy link
Contributor

vkuzo commented Sep 30, 2025

It does not make sense to me to put workflow-specific logic in a general utility such as _replace_with_custom_fn_if_matches_filter. IMO we should land this PR to remove the technical debt and re-enable the "quantize a float8 trained model for inferen) logic in a follow-up PR, if needed.

@danielvegamyhre
Copy link
Contributor Author

It does not make sense to me to put workflow-specific logic in a general utility such as _replace_with_custom_fn_if_matches_filter. IMO we should land this PR to remove the technical debt and re-enable the "quantize a float8 trained model for inferen) logic in a follow-up PR, if needed.

I agree with this.... I will look into the test failures and fix before landing

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: 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.

Conversion of dense vs MoE order should not matter
4 participants