Skip to content

Commit 2f6ec9d

Browse files
committed
fix unit test to use no grad
1 parent 2a89491 commit 2f6ec9d

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

benchmarks/benchmark_uintx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
from copy import deepcopy
77

88
import torch
9-
109
from torchao.prototype.uintx import (
1110
uintx_affine_weight_only,
1211
unpack_cpu,
1312
)
13+
1414
from torchao.quantization.quant_api import quantize_
1515

1616

test/quantization/quantize_/workflows/float8/test_float8_tensor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def forward(self, x):
8080
class TestFloat8Tensor(TorchAOIntegrationTestCase):
8181
def setUp(self):
8282
self.GPU_DEVICES = ["cuda"] if torch.cuda.is_available() else []
83+
torch.set_grad_enabled(False)
8384

8485
@unittest.skipIf(not torch.cuda.is_available(), "Need CUDA available")
8586
@unittest.skipIf(

test/test_low_bit_optim.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
common_utils.SEED = 1234
3131

3232
from packaging.version import Version
33+
3334
from torchao import optim
3435
from torchao.optim.quant_utils import (
3536
_fp32_to_bf16_sr,

0 commit comments

Comments
 (0)