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

Fix import error in torchtune due to bc breaking changes in torchao #1817

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions torchtune/training/quantization.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from typing import Callable, Optional

from torchao.dtypes import TensorCoreTiledLayoutType
from torchao.dtypes import TensorCoreTiledLayout
from torchao.quantization import (
int4_weight_only,
int8_dynamic_activation_int4_weight,
Expand Down Expand Up @@ -88,7 +88,7 @@ def __init__(self, groupsize: int = 128, inner_k_tiles: int = 8):
self.inner_k_tiles = inner_k_tiles

def quantize(self, model):
layout_type = TensorCoreTiledLayoutType(self.inner_k_tiles)
layout_type = TensorCoreTiledLayout(self.inner_k_tiles)
quantize_fn = int4_weight_only(self.groupsize, layout_type)
quantize_(model, quantize_fn)
return model
Expand Down
Loading