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

config migration: float8* #1694

Merged
merged 19 commits into from
Feb 14, 2025
Prev Previous commit
Next Next commit
Update
[ghstack-poisoned]
vkuzo committed Feb 5, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 26850dae92bdcf6535fcf30ca4fc21f4074bde44
5 changes: 4 additions & 1 deletion torchao/quantization/quant_api.py
Original file line number Diff line number Diff line change
@@ -779,6 +779,7 @@ class Int4WeightOnlyConfig(AOBaseConfig):
use_hqq: bool = False
zero_point_domain: Optional[ZeroPointDomain] = ZeroPointDomain.NONE


# for BC
# TODO maybe change other callsites
int4_weight_only = Int4WeightOnlyConfig
@@ -812,7 +813,9 @@ def _int4_weight_only_transform(
quant_max = 15
eps = 1e-6
preserve_zero = LAYOUT_TO_PRESERVE_ZEROS[type(layout)]
zero_point_dtype = torch.bfloat16
zero_point_dtype = (
weight.dtype if isinstance(layout, Int4CPULayout) else torch.bfloat16
)

# nonlocal zero_point_domain
assert (