Skip to content

Commit ce2f845

Browse files
authored
add xfail for onnx test_layer_wise.py (#2129)
1 parent 5dcde91 commit ce2f845

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/adaptor/onnxrt_adaptor/test_layer_wise.py

+14
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ def __iter__(self):
3434
}, self.encoded_dict["labels"]
3535

3636

37+
def xfail(test_func):
38+
def wrapper(*args, **kwargs):
39+
try:
40+
test_func(*args, **kwargs)
41+
except Exception as e:
42+
print(f"Test {test_func.__name__} expected to fail: {e}")
43+
print("Test fails with transformers >= 4.49.0, please downgrade the version")
44+
return
45+
raise AssertionError(f"Test {test_func.__name__} was expected to fail but passed. We can remove xfail now")
46+
47+
return wrapper
48+
49+
3750
class TestWeightOnlyAdaptor(unittest.TestCase):
3851
@classmethod
3952
def setUpClass(self):
@@ -52,6 +65,7 @@ def tearDownClass(self):
5265
shutil.rmtree("nc_workspace", ignore_errors=True)
5366
shutil.rmtree("tiny-llama", ignore_errors=True)
5467

68+
@xfail # Test fails with transformers >= 4.49.0, please downgrade the version
5569
def test_layer_wise_W8A8_quant(self):
5670
# layer-wise quantization
5771
layerwise_quantized_model_path = "tiny-llama/layerwise_quantized_decoder_model.onnx"

0 commit comments

Comments
 (0)