-
Notifications
You must be signed in to change notification settings - Fork 367
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
Recently I found that for _choose_scale_float8:
len(block_size) == 0 for per tensor:
ao/torchao/quantization/quant_primitives.py
Line 2303 in b4ec4cb
| if len(block_size) == 0: |
keepdim=True for others:
ao/torchao/quantization/quant_primitives.py
Line 2314 in b4ec4cb
| max_abs = tensor_reshaped.abs().amax(dim=reduction_dims, keepdim=True) |
While for _choose_qparams_affine (for int):
we use keepdim=False:
ao/torchao/quantization/quant_primitives.py
Lines 1552 to 1553 in b4ec4cb
| min_val = torch.amin(input, dim=reduction_dims, keepdim=False) | |
| max_val = torch.amax(input, dim=reduction_dims, keepdim=False) |
I think we should fix this discrepancy to reduce confusion, by aligning _choose_scale_float8 with the int one, i.e. change keepdim=True to keepdim=False and make sure the tests work.
we can also add some docs afterwards to both ops to clarify.
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers