From a2abbafa81806d60f9ae4441f4d5095d314ae2cf Mon Sep 17 00:00:00 2001 From: Yi Zhang Date: Tue, 25 Jun 2024 11:42:40 +0800 Subject: [PATCH 1/3] throw excepiton while parity_check failed --- .../python/tools/transformers/models/llama/convert_to_onnx.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onnxruntime/python/tools/transformers/models/llama/convert_to_onnx.py b/onnxruntime/python/tools/transformers/models/llama/convert_to_onnx.py index 8a33544654e05..7015b8a91b054 100644 --- a/onnxruntime/python/tools/transformers/models/llama/convert_to_onnx.py +++ b/onnxruntime/python/tools/transformers/models/llama/convert_to_onnx.py @@ -1052,8 +1052,8 @@ def main(): logger.info(f"check parity with cmd: {parity_cmd}") parity_check(parity_cmd) except Exception as e: - logger.warning(f"An error occurred while verifying parity: {e}", exc_info=True) - + logger.exception(f"An error occurred while verifying parity: {e}", exc_info=True) + sys.exit(-1) if __name__ == "__main__": main() From c27fb91482430c0ecaba3e641a8e935ca271e58a Mon Sep 17 00:00:00 2001 From: Yi Zhang Date: Tue, 25 Jun 2024 13:14:53 +0800 Subject: [PATCH 2/3] fix hint --- .../python/tools/transformers/models/llama/convert_to_onnx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onnxruntime/python/tools/transformers/models/llama/convert_to_onnx.py b/onnxruntime/python/tools/transformers/models/llama/convert_to_onnx.py index 7015b8a91b054..3fda9e41a142d 100644 --- a/onnxruntime/python/tools/transformers/models/llama/convert_to_onnx.py +++ b/onnxruntime/python/tools/transformers/models/llama/convert_to_onnx.py @@ -1052,7 +1052,7 @@ def main(): logger.info(f"check parity with cmd: {parity_cmd}") parity_check(parity_cmd) except Exception as e: - logger.exception(f"An error occurred while verifying parity: {e}", exc_info=True) + logger.exception(f"An error occurred while verifying parity: {e}") sys.exit(-1) if __name__ == "__main__": From eef05422908cb418e9d99bf9dd289b66aa77770f Mon Sep 17 00:00:00 2001 From: Yi Zhang Date: Tue, 25 Jun 2024 13:32:11 +0800 Subject: [PATCH 3/3] fix lint --- .../python/tools/transformers/models/llama/convert_to_onnx.py | 1 + 1 file changed, 1 insertion(+) diff --git a/onnxruntime/python/tools/transformers/models/llama/convert_to_onnx.py b/onnxruntime/python/tools/transformers/models/llama/convert_to_onnx.py index 3fda9e41a142d..f701e465b9153 100644 --- a/onnxruntime/python/tools/transformers/models/llama/convert_to_onnx.py +++ b/onnxruntime/python/tools/transformers/models/llama/convert_to_onnx.py @@ -1055,5 +1055,6 @@ def main(): logger.exception(f"An error occurred while verifying parity: {e}") sys.exit(-1) + if __name__ == "__main__": main()