From 9d138da8f8ff8eebdf528775bae442c76bb9997b Mon Sep 17 00:00:00 2001 From: willfengg Date: Thu, 30 May 2024 16:42:33 -0700 Subject: [PATCH] [NF4][FSDP] return contiguous `quantization_factor` Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: --- torchao/dtypes/nf4tensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torchao/dtypes/nf4tensor.py b/torchao/dtypes/nf4tensor.py index 25c33417a..8d62a842f 100644 --- a/torchao/dtypes/nf4tensor.py +++ b/torchao/dtypes/nf4tensor.py @@ -596,7 +596,7 @@ def double_quantize_scalers( return ( quantized_scaler_blocks.flatten().to(torch.int8), - quantization_factor.view(n_scaler_blocks), + quantization_factor.view(n_scaler_blocks).contiguous(), scalers_1_mean, )