Skip to content

Commit 26b10fa

Browse files
committed
Merge branch 'kaihui/save_and_load' of https://github.com/intel/neural-compressor into kaihui/save_and_load
2 parents 6fc00fd + 992c40a commit 26b10fa

File tree

7 files changed

+8
-11
lines changed

7 files changed

+8
-11
lines changed

test/3x/torch/quantization/test_smooth_quant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import copy
2+
import shutil
23

34
import pytest
45
import torch
5-
import shutil
66

77
from neural_compressor.torch.quantization import SmoothQuantConfig, get_default_sq_config, quantize
88
from neural_compressor.torch.utils import is_ipex_available

test/3x/torch/quantization/test_static_quant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import copy
2+
import shutil
23

34
import pytest
45
import torch
5-
import shutil
66

77
from neural_compressor.torch.quantization import (
88
StaticQuantConfig,

test/3x/torch/quantization/weight_only/test_autoround.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import copy
2+
import shutil
23

34
import pytest
45
import torch
56
import transformers
6-
import shutil
77

88
from neural_compressor.torch.algorithms.weight_only.autoround import AutoRoundQuantizer, get_autoround_default_run_fn
99
from neural_compressor.torch.quantization import (
@@ -38,7 +38,7 @@ def setup_class(self):
3838

3939
def teardown_class(self):
4040
shutil.rmtree("saved_results", ignore_errors=True)
41-
41+
4242
def setup_method(self, method):
4343
logger.info(f"Running TestAutoRound test: {method.__name__}")
4444

test/3x/torch/quantization/weight_only/test_awq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import copy
2+
import shutil
23

34
import pytest
45
import torch
56
import transformers
6-
import shutil
77

88
from neural_compressor.common import Logger
99

test/3x/torch/quantization/weight_only/test_gptq.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import copy
2+
import shutil
23

34
import pytest
45
import torch
56
import transformers
6-
import shutil
77

88
from neural_compressor.torch.algorithms.weight_only.modules import WeightOnlyLinear
99
from neural_compressor.torch.quantization import (
@@ -41,7 +41,6 @@ def setup_class(self):
4141
def teardown_class(self):
4242
shutil.rmtree("saved_results", ignore_errors=True)
4343

44-
4544
def test_accuracy_improvement(self):
4645
# test_default_rtn_config
4746
model = copy.deepcopy(self.tiny_gptj)

test/3x/torch/quantization/weight_only/test_rtn.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import copy
2+
import shutil
23

34
import pytest
45
import torch
56
import transformers
6-
import shutil
77

88
from neural_compressor.torch.algorithms.weight_only.modules import WeightOnlyLinear
99
from neural_compressor.torch.quantization import (
@@ -35,7 +35,6 @@ def setup_class(self):
3535
def teardown_class(self):
3636
shutil.rmtree("saved_results", ignore_errors=True)
3737

38-
3938
# TODO: (4, True, 32, 0), group_dim=0, format not supported
4039
@pytest.mark.parametrize(
4140
"bits, use_sym, group_size, group_dim",

test/3x/torch/quantization/weight_only/test_teq.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import copy
2+
import shutil
23
import unittest
34

45
import torch
56
import transformers
6-
import shutil
77

88
from neural_compressor.common import logger
99
from neural_compressor.torch.quantization import convert, prepare, quantize
@@ -113,7 +113,6 @@ def setUpClass(self):
113113
def tearDownClass(self):
114114
shutil.rmtree("saved_results", ignore_errors=True)
115115

116-
117116
def test_teq(self):
118117
test_input = torch.ones([1, 512], dtype=torch.long)
119118
model = copy.deepcopy(self.gptj)

0 commit comments

Comments
 (0)