Skip to content

Commit 6b786d3

Browse files
committed
fixing regressions
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
1 parent 6bc64aa commit 6b786d3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

test/integration/test_integration.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,8 @@ def _test_lin_weight_subclass_api_impl(
877877
api(mod)
878878

879879
# test get_plain()
880-
mod[0].weight.tensor_impl.get_plain()
880+
if hasattr(mod[0].weight, "tensor_impl"):
881+
mod[0].weight.tensor_impl.get_plain()
881882

882883
test = mod(x)
883884
self.assertGreater(

torchao/dtypes/affine_quantized_tensor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,15 @@ def from_hp_to_intx(
235235
compute_dtype=compute_dtype,
236236
device=device,
237237
verbose=False,
238-
raw_output=not isinstance(_layout, TensorCoreTiledLayout),
238+
raw_output=not isinstance(
239+
_layout, (TensorCoreTiledLayout, PlainLayout)
240+
),
239241
# raw_output=False is basically the 'convert to TensorCoreTiledLayout zero_point version' option (add scale*midpoint)
240242
# note in choose_qparams_affine, preserve_zero = False does this same thing while also controlling whether
241243
# zero is preserved.
242244
# TODO uncouple preserve_zero and conversion of zero_point to TensorCoreTiledLayout version
243245
# TODO move the conversion of zero_point out of quant_primitives and into TensorCoreTiledLayout.from_plain
246+
# TODO change PlainLayout to use raw_output.
244247
)
245248
data = data.to(target_dtype)
246249
else:

0 commit comments

Comments
 (0)