Skip to content

Conversation

@howardzhang-cv
Copy link
Contributor

Motivation: TorchAO removing floatx support
Changes summary: added version guard in quantization_config.py
added version guard in quantization tests in test_torchao.py
added new test for version guarding in test_torchao.py (test_floatx_quantization)

Testing:
pytest tests/quantization/torchao/test_torchao.py -k test_floatx_quantization

howardzhang-cv and others added 5 commits January 6, 2026 17:42
Summary: TorchAO removing floatx support, added version guard in quantization_config.py
Summary: TorchAO removing floatx support, added version guard in quantization_config.py
Altered tests in test_torchao.py to version guard floatx
Created new test to verify version guard of floatx support
Summary: TorchAO removing floatx support, added version guard in quantization_config.py
Altered tests in test_torchao.py to version guard floatx
Created new test to verify version guard of floatx support
Summary: TorchAO removing floatx support, added version guard in quantization_config.py
Altered tests in test_torchao.py to version guard floatx
Created new test to verify version guard of floatx support
@howardzhang-cv
Copy link
Contributor Author

Also wanted to note that it seems like a lot of the tests in test_torchao (like test_quantization for example) were failing in the main branch

("fp4", np.array([0.4668, 0.5195, 0.5547, 0.4199, 0.4434, 0.6445, 0.4316, 0.4531, 0.5625])),
("fp6", np.array([0.4668, 0.5195, 0.5547, 0.4199, 0.4434, 0.6445, 0.4316, 0.4531, 0.5625])),
])
if version.parse(importlib.metadata.version("torchao")) <= version.Version("0.14.0"):

Choose a reason for hiding this comment

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

use is_torchao_version here as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The import would be a bit ugly for it lives in a different folder, also it seemed like other torchao version checks in that file seemed to use this syntax. Should I still change it?

Summary: TorchAO removing floatx support, added version guard in quantization_config.py
Altered tests in test_torchao.py to version guard floatx
Created new test to verify version guard of floatx support
Copy link

@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

@yiyixuxu yiyixuxu requested a review from sayakpaul January 7, 2026 22:37
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

Thank you!

`float8_e4m3_tensor`, `float8_e4m3_row`,
- **Floating point X-bit quantization:**
- **Floating point X-bit quantization:** (in torchao <= 0.14.1, not supported in torchao >= 0.15.0)
Copy link
Member

Choose a reason for hiding this comment

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

Can we also provide a recommendation on what needs to be done if a user wants to use X-bit ops in torchao >= 0.15.0?

Choose a reason for hiding this comment

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

they will need to downgrade to 0.14.1 or lower, we are removing this because we didn't see much usage for this feature

Copy link
Member

Choose a reason for hiding this comment

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

Can we make that clear in the error message then?

they will need to downgrade to 0.14.1 or lower

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's an error message for this in line 541 for if the user is trying to use the floatx in version >0.14.1. Is there a better place for it?

)
self._test_quant_type(quantization_config, expected_slice, model_id)

def test_floatx_quantization(self):
Copy link
Member

Choose a reason for hiding this comment

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

I don't think floatX is used much so we can avoid this test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a skip flag for this. We can also just remove it entirely if you think that's better.

Summary: TorchAO removing floatx support, added version guard in quantization_config.py
Altered tests in test_torchao.py to version guard floatx
Created new test to verify version guard of floatx support
@sayakpaul sayakpaul merged commit 2f66edc into huggingface:main Jan 9, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants