From 1439da36fe10df74dcaaf165d08999b15cd955a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Dupr=C3=A9?= Date: Fri, 3 Nov 2023 10:17:50 +0100 Subject: [PATCH] Partially disable QGemm tests for float 8 types (#18196) ### Description The quantization tool assumes QGemm is implemented for float 8 types but it is not yet supported. The condition partially disabling the test was not robust enough. This is changed by this PR. --- .../test/python/quantization/test_op_gemm.py | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/onnxruntime/test/python/quantization/test_op_gemm.py b/onnxruntime/test/python/quantization/test_op_gemm.py index 54ef1cc1d5..bac0f6d48e 100644 --- a/onnxruntime/test/python/quantization/test_op_gemm.py +++ b/onnxruntime/test/python/quantization/test_op_gemm.py @@ -192,24 +192,9 @@ class TestOpGemm(unittest.TestCase): check_qtype_by_node_type(self, model_int8_path, qnode_io_qtypes) data_reader.rewind() if activation_type_str == "f8e4m3fn" and weight_type_str == "f8e4m3fn": - # QGemm is not implemented for CPU. - try: - check_model_correctness( - self, - model_fp32_path, - model_int8_path, - data_reader.get_next(), - providers=["CUDAExecutionProvider", "CPUExecutionProvider"], - is_gemm=True, - ) - except Exception as e: - if ( - "Type 'tensor(float8e4m3fn)' of input parameter (input_quantized) of operator (QGemm) in node () is invalid." - in str(e) - ): - warnings.warn("Fix this test when QGemm is implemented.") - return - raise e + # QGemm for float 8 is not implemented. The test should be updated when it is. + warnings.warn("Fix this test when QGemm is implemented for float 8 types.") + return else: check_model_correctness(self, model_fp32_path, model_int8_path, data_reader.get_next(), is_gemm=True)