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

Refactor Affine Quantized Tensor #1234

Merged
merged 17 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 test/dtypes/test_affine_quantized.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_to_device(self, apply_quant):

@unittest.skipIf(not torch.cuda.is_available(), "Need CUDA available")
def test_register_new_dispatch(self):
from torchao.dtypes.affine_quantized_tensor import (
from torchao.dtypes.affine_quantized_tensor_ops import (
register_aqt_quantized_linear_dispatch,
deregister_aqt_quantized_linear_dispatch,
)
Expand Down
15 changes: 11 additions & 4 deletions torchao/dtypes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .nf4tensor import NF4Tensor, to_nf4
# from ..prototype.dtypes.uint2 import UInt2Tensor, BitnetTensor
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we can remove this I think

from .uint4 import UInt4Tensor
from .uintx import UInt4Tensor
from .affine_quantized_tensor import (
AffineQuantizedTensor,
to_affine_quantized_intx,
Expand All @@ -9,15 +9,22 @@
to_affine_quantized_fpx,
to_affine_quantized_floatx,
to_affine_quantized_floatx_static,
PlainAQTTensorImpl,
)
from .affine_quantized_tensor_ops import *
from .utils import (
Layout,
PlainLayout,
SemiSparseLayout,
TensorCoreTiledLayout,
)
from .floatx import (
Float8Layout,
Float8AQTTensorImpl,
)
from .uintx import (
SemiSparseLayout,
TensorCoreTiledLayout,
MarlinSparseLayout,
)

__all__ = [
"NF4Tensor",
"to_nf4",
Expand Down
Loading