Skip to content

Commit c8f441d

Browse files
committed
manually undo changes
1 parent a9fa421 commit c8f441d

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

torchao/quantization/quantize_/workflows/float8/float8_tensor.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
preprocess_scale,
2424
)
2525
from torchao.quantization.granularity import PerRow, PerTensor
26+
from torchao.quantization.utils import get_block_size
2627
from torchao.quantization.quant_primitives import (
2728
_choose_scale_float8,
2829
_dequantize_affine_float8,
@@ -33,7 +34,6 @@
3334
QuantizeTensorKwargs,
3435
_choose_quant_func_and_quantize_tensor,
3536
)
36-
from torchao.quantization.utils import get_block_size
3737
from torchao.utils import (
3838
TorchAOBaseTensor,
3939
_is_fbgemm_genai_gpu_available,
@@ -617,28 +617,6 @@ def _(func, types, args, kwargs):
617617
return return_and_correct_aliasing(func, args, kwargs, new)
618618

619619

620-
@implements(aten.select.int)
621-
def _(func, types, args, kwargs):
622-
old_float8_tensor, dim, index = args
623-
assert dim == 0, f"Float8Tensor aten.select.int with {dim=} is not yet supported"
624-
assert len(old_float8_tensor.qdata.shape) == len(old_float8_tensor.scale.shape), (
625-
"unsupported"
626-
)
627-
assert len(old_float8_tensor.qdata.shape) == len(old_float8_tensor.block_size), (
628-
"unsupported"
629-
)
630-
new_float8_tensor = old_float8_tensor.__class__(
631-
old_float8_tensor.qdata[index],
632-
old_float8_tensor.scale[index],
633-
old_float8_tensor.block_size[1:],
634-
old_float8_tensor.mm_config,
635-
old_float8_tensor.act_quant_kwargs,
636-
old_float8_tensor.kernel_preference,
637-
old_float8_tensor.dtype,
638-
)
639-
return return_and_correct_aliasing(func, args, kwargs, new_float8_tensor)
640-
641-
642620
Float8Tensor.__module__ = "torchao.quantization"
643621

644622
# Allow a model with Float8Tensor weights to be loaded with `weights_only=True`

0 commit comments

Comments
 (0)