Skip to content

Commit 711d001

Browse files
committed
remove timing check
1 parent 5218d43 commit 711d001

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

test/quantization/test_quant_api.py

+1-10
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
import copy
5656
import tempfile
5757
import gc
58-
import time
5958
from torch.testing._internal.common_utils import TestCase
6059

6160

@@ -692,25 +691,17 @@ def reset_memory():
692691

693692
reset_memory()
694693
m = ToyLinearModel()
695-
time0 = time.perf_counter()
696-
m.to(device="cuda")
697-
quantize_(m, int8_weight_only())
698-
torch.cuda.synchronize()
699-
time_baseline = time.perf_counter() - time0
694+
quantize_(m.to(device="cuda"), int8_weight_only())
700695
memory_baseline = torch.cuda.max_memory_allocated()
701696

702697
del m
703698
reset_memory()
704699
m = ToyLinearModel()
705-
time0 = time.perf_counter()
706700
quantize_(m, int8_weight_only(), device="cuda")
707-
torch.cuda.synchronize()
708-
time_streaming = time.perf_counter() - time0
709701
memory_streaming = torch.cuda.max_memory_allocated()
710702

711703
for param in m.parameters():
712704
assert param.is_cuda
713-
self.assertLess(time_streaming, time_baseline * 1.5)
714705
self.assertLess(memory_streaming, memory_baseline)
715706

716707

0 commit comments

Comments
 (0)