diff --git a/torchao/quantization/autoquant.py b/torchao/quantization/autoquant.py index f1f387d7b5..ccffb988cd 100644 --- a/torchao/quantization/autoquant.py +++ b/torchao/quantization/autoquant.py @@ -10,7 +10,11 @@ safe_int_mm, ) import torch.nn.functional as F -from torch._inductor.utils import do_bench +try: + from torch._inductor.utils import do_bench +except: + from torch._inductor.runtime.runtime_utils import do_bench + aten = torch.ops.aten AUTOQUANT_CACHE = {}