Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmarks/benchmark_fp6.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from tqdm import tqdm

from torchao.dtypes import to_affine_quantized_fpx
from torchao.dtypes.floatx import FloatxTensorCoreLayout
from torchao.prototype.dtypes.floatx import FloatxTensorCoreLayout
from torchao.utils import benchmark_torch_function_in_microseconds


Expand Down
2 changes: 1 addition & 1 deletion docs/source/api_ref_dtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Layouts and Tensor Subclasses
TensorCoreTiledLayout
Float8Layout
FloatxTensor
FloatxTensorCoreLayout
MarlinSparseLayout
Int4CPULayout
CutlassSemiSparseLayout
Expand Down Expand Up @@ -52,6 +51,7 @@ Prototype
Int8DynamicActInt4WeightCPULayout
MarlinQQQTensor
MarlinQQQLayout
FloatxTensorCoreLayout
UintxLayout

..
Expand Down
12 changes: 6 additions & 6 deletions test/dtypes/test_floatx.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
run_tests,
)

from torchao.dtypes.floatx import (
from torchao.prototype.custom_fp_utils import (
_f32_to_floatx_unpacked,
_floatx_unpacked_to_f32,
)
from torchao.prototype.dtypes.floatx import (
FloatxTensorCoreLayout,
from_scaled_tc_floatx,
to_scaled_tc_floatx,
)
from torchao.dtypes.floatx.floatx_tensor_core_layout import (
from torchao.prototype.dtypes.floatx.floatx_tensor_core_layout import (
FloatxTensorCoreAQTTensorImpl,
_pack_tc_floatx,
_pack_tc_fp6,
)
from torchao.prototype.custom_fp_utils import (
_f32_to_floatx_unpacked,
_floatx_unpacked_to_f32,
)
from torchao.quantization import (
FPXWeightOnlyConfig,
quantize_,
Expand Down
5 changes: 3 additions & 2 deletions torchao/dtypes/affine_quantized_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ def dequantize(self, output_dtype: Optional[torch.dtype] = None) -> torch.Tensor
if output_dtype is None:
output_dtype = self.dtype

from torchao.dtypes.floatx import Float8Layout, FloatxTensorCoreLayout
from torchao.dtypes.floatx import Float8Layout
from torchao.prototype.dtypes.floatx import FloatxTensorCoreLayout

if isinstance(self._layout, FloatxTensorCoreLayout):
int_data, scale = self.tensor_impl.get_plain()
Expand Down Expand Up @@ -539,7 +540,7 @@ def from_hp_to_fpx(
_layout: Layout,
):
"""Create a floatx AffineQuantizedTensor from a high precision tensor. Floatx is represented as ebits and mbits, and supports the representation of float1-float7."""
from torchao.dtypes.floatx import FloatxTensorCoreLayout
from torchao.prototype.dtypes.floatx import FloatxTensorCoreLayout

assert isinstance(_layout, FloatxTensorCoreLayout), (
f"Only FloatxTensorCoreLayout is supported for floatx, got {_layout}"
Expand Down
8 changes: 4 additions & 4 deletions torchao/dtypes/affine_quantized_tensor_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
_linear_fp_act_fp8_weight_check,
_linear_fp_act_fp8_weight_impl,
)
from torchao.dtypes.floatx.floatx_tensor_core_layout import (
_linear_f16_bf16_act_floatx_weight_check,
_linear_f16_bf16_act_floatx_weight_impl,
)
from torchao.dtypes.uintx.int4_cpu_layout import (
_linear_fp_act_uint4_weight_cpu_check,
_linear_fp_act_uint4_weight_cpu_impl,
Expand Down Expand Up @@ -72,6 +68,10 @@
_linear_bf16_act_uint4_weight_check,
_linear_bf16_act_uint4_weight_impl,
)
from torchao.prototype.dtypes.floatx.floatx_tensor_core_layout import (
_linear_f16_bf16_act_floatx_weight_check,
_linear_f16_bf16_act_floatx_weight_impl,
)
from torchao.prototype.dtypes.uintx.block_sparse_layout import (
_linear_int8_act_int8_weight_block_sparse_check,
_linear_int8_act_int8_weight_block_sparse_impl,
Expand Down
Loading
Loading