Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
skip ut for specific version (#1532)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincyZhang authored May 8, 2024
1 parent dcc6043 commit 2434c64
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
4 changes: 3 additions & 1 deletion tests/CI/test_evaluation_bigcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import shutil
import unittest
import subprocess
import torch
import sys
from transformers import AutoModelForCausalLM, AutoTokenizer

class TestLmEvaluationHarness(unittest.TestCase):
Expand All @@ -36,6 +36,8 @@ def tearDownClass(self):
stderr=subprocess.PIPE, shell=True) # nosec
p.communicate()

@unittest.skipIf(sys.version_info >= (3, 11),
"bigcode-lmeval not support python version higher than 3.10")
def test_bigcode_lm_eval(self):
from intel_extension_for_transformers.transformers.llm.evaluation.bigcode_eval import evaluate as bigcode_evaluate
starcoder_tokenizer = AutoTokenizer.from_pretrained("bigcode/tiny_starcoder_py")
Expand Down
6 changes: 5 additions & 1 deletion tests/CI/test_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
import shutil
import torch
import unittest
import neural_compressor.adaptor.pytorch as nc_torch
from intel_extension_for_transformers.transformers.modeling.modeling_seq2seq import INCModelForSeq2SeqLM
from packaging.version import Version
from neural_compressor import PostTrainingQuantConfig, quantization
from optimum.intel.neural_compressor import INCConfig
from optimum.exporters import TasksManager
Expand All @@ -30,7 +32,7 @@
os.environ["WANDB_DISABLED"] = "true"
os.environ["DISABLE_MLFLOW_INTEGRATION"] = "true"
MODEL_NAME = "t5-small"

PT_VERSION = nc_torch.get_torch_version()

def get_seq2seq_example_inputs(model):
onnx_config_class = TasksManager.get_exporter_config_constructor(model_type=model.config.model_type, exporter="onnx", task="text2text-generation")
Expand Down Expand Up @@ -63,6 +65,8 @@ def tearDownClass(self):
shutil.rmtree('./mlruns', ignore_errors=True)
shutil.rmtree('./quantized_model', ignore_errors=True)

@unittest.skipIf(PT_VERSION.release < Version("2.1.0").release,
"Please use PyTroch 2.1.0 higher version for seq2seq_jit_model")
def test_seq2seq_jit_model(self):
model = INCModelForSeq2SeqLM.from_pretrained(MODEL_NAME)
input_ids = self.tokenizer(self.prompt_texts[0], return_tensors="pt").input_ids
Expand Down
4 changes: 2 additions & 2 deletions tests/CI/test_quantization.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@ def test_bf16_onnx(self):
self.assertEqual(tensor.data_type, TensorProto.BFLOAT16)
break

@unittest.skipIf(PT_VERSION.release < Version("2.1.0").release,
"Please use PyTroch 2.1.0 or higher version for executor backend")
@unittest.skipIf(PT_VERSION.release <= Version("2.1.0").release,
"Please use PyTroch 2.2.0 or higher version for executor backend")
def test_quantization_for_llm(self):
model_name_or_path = "hf-internal-testing/tiny-random-gptj"
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
Expand Down
1 change: 1 addition & 0 deletions tests/Nightly/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
../requirements.txt
git+https://github.com/huggingface/optimum.git@e38d40ad220a180213f99b1d93d0407a826c326d
4 changes: 2 additions & 2 deletions tests/Nightly/test_llm_smoothquant.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@


@unittest.skipIf(
PT_VERSION.release < Version("2.1.0").release,
"Please use PyTroch 2.1.0 or higher version for executor backend",
PT_VERSION.release <= Version("2.1.0").release,
"Please use PyTroch 2.2.0 or higher version for executor backend",
)
class TestLLMQuantization(unittest.TestCase):
def test_qwen(self):
Expand Down

0 comments on commit 2434c64

Please sign in to comment.