From c9206e952a2ece5da9d9350bc7ef0ee0f93ff2b8 Mon Sep 17 00:00:00 2001 From: Ti-Tai Wang Date: Mon, 29 Sep 2025 23:02:01 +0000 Subject: [PATCH 01/17] test onnx rel-1.19.1 --- cmake/deps.txt | 2 +- cmake/vcpkg-ports/onnx/portfile.cmake | 4 ++-- cmake/vcpkg-ports/onnx/vcpkg.json | 2 +- docs/How_To_Update_ONNX_Dev_Notes.md | 2 +- onnxruntime/test/onnx/TestCase.cc | 2 -- .../onnx_backend_test_series_filters.jsonc | 15 --------------- .../aarch64/python/cpu/scripts/requirements.txt | 2 +- .../linux/docker/scripts/lort/requirements.txt | 2 +- .../docker/scripts/manylinux/requirements.txt | 2 +- .../github/linux/docker/scripts/requirements.txt | 2 +- .../ci_build/github/linux/python/requirements.txt | 2 +- .../github/windows/python/requirements.txt | 2 +- .../ci_build/requirements/pybind/requirements.txt | 2 +- 13 files changed, 12 insertions(+), 29 deletions(-) diff --git a/cmake/deps.txt b/cmake/deps.txt index 7b243ff15cd80..6c2cda635c1e1 100644 --- a/cmake/deps.txt +++ b/cmake/deps.txt @@ -34,7 +34,7 @@ microsoft_gsl;https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.zip;cf36 microsoft_wil;https://github.com/microsoft/wil/archive/refs/tags/v1.0.230629.1.zip;e4a542a323c070376f7c2d1973d0f7ddbc1d2fa5 mimalloc;https://github.com/microsoft/mimalloc/archive/refs/tags/v2.1.1.zip;d5ee7d34223d0567892db5179849939c8769dc41 mp11;https://github.com/boostorg/mp11/archive/refs/tags/boost-1.82.0.zip;9bc9e01dffb64d9e0773b2e44d2f22c51aace063 -onnx;https://github.com/onnx/onnx/archive/refs/tags/v1.19.0.zip;4c798b73e131438c196e6dcb9f3393968a8936f1 +onnx;https://github.com/onnx/onnx/archive/e11938a232432630e1ff8904bb80091af6823021.zip;987028d7881b44958f0a1eb9ccb3e75b05ac9948 # Use the latest commit of 10.9-GA onnx_tensorrt;https://github.com/onnx/onnx-tensorrt/archive/d5dce67db7c2e64b07e055571f5ec06f7f254de2.zip;01114d3b67650857281fa50faa2e412130a63b69 protobuf;https://github.com/protocolbuffers/protobuf/archive/refs/tags/v21.12.zip;7cf2733949036c7d52fda017badcab093fe73bfa diff --git a/cmake/vcpkg-ports/onnx/portfile.cmake b/cmake/vcpkg-ports/onnx/portfile.cmake index 27f5ea5fadd79..411a9f9a5810a 100644 --- a/cmake/vcpkg-ports/onnx/portfile.cmake +++ b/cmake/vcpkg-ports/onnx/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO onnx/onnx - REF "v${VERSION}" - SHA512 e6f7b5782a43a91783607549e4d0f0a9cbd46dfb67a602f81aaffc7bcdd8f450fe9c225f0bc314704f2923e396f0df5b03ea91af4a7887203c0b8372bc2749d0 + REF e11938a232432630e1ff8904bb80091af6823021 + SHA512 d600135bc8bb661149100b7aadd4caf41bdd0bb6acd8d4e193d6d0526571112a8b69969f65cf75cc08316ee6e3006e3c6a3d6944e7be72445fc946cc4ac75ff9 PATCHES fix-cmakelists.patch # Patch changes from https://github.com/onnx/onnx/pull/7253 to avoid unnecessary rebuilding. diff --git a/cmake/vcpkg-ports/onnx/vcpkg.json b/cmake/vcpkg-ports/onnx/vcpkg.json index 350db2e35061a..ad0d1aaf15f51 100644 --- a/cmake/vcpkg-ports/onnx/vcpkg.json +++ b/cmake/vcpkg-ports/onnx/vcpkg.json @@ -1,6 +1,6 @@ { "name": "onnx", - "version-semver": "1.19.0", + "version-semver": "1.19.1", "port-version": 1, "description": "Open standard for machine learning interoperability", "homepage": "https://onnx.ai", diff --git a/docs/How_To_Update_ONNX_Dev_Notes.md b/docs/How_To_Update_ONNX_Dev_Notes.md index 8da19ddc51cb7..8c1280431c384 100644 --- a/docs/How_To_Update_ONNX_Dev_Notes.md +++ b/docs/How_To_Update_ONNX_Dev_Notes.md @@ -35,7 +35,7 @@ git add onnx 1. Modify [cmake/vcpkg-ports/onnx/binskim.patch](/cmake/vcpkg-ports/onnx/binskim.patch) to be the same as [cmake/patches/onnx/onnx.patch](/cmake/patches/onnx/onnx.patch). 2. The other patches are required/created by vcpkg repository to build ONNX. We just need to re-run diff to makes sure the patches can be applied in the updated ONNX version. 3. Update [cmake/vcpkg-ports/onnx/portfile.cmake](/cmake/vcpkg-ports/onnx/portfile.cmake) with the correct commit id and SHA512. (alternatively, build it with the wrong SHA and ORT should tell you the expected one.) -4. Upload your package: [Follow the instructions](https://microsoft.sharepoint.com/teams/ONNX2/_layouts/15/Doc.aspx?sourcedoc={170774be-e1c6-4f8b-a3ae-984f211fe410}&action=edit&wd=target%28Development.)one%7C63d3ab47-51d1-4a62-9965-66882234bd44%2FAdd%20or%20Update%20a%20C%2B%2B%20dependency%7Cb6ae6a97-94fc-4436-8fc6-08c21ae895da%2F%29&wdorigin=NavigationUrl +4. Upload your package: [Follow the instructions](https://microsoft.sharepoint.com/:o:/r/teams/ONNX2/_layouts/15/Doc.aspx?sourcedoc=%7B170774BE-E1C6-4F8B-A3AE-984F211FE410%7D&wd=target(Development.one%7C63D3AB47-51D1-4A62-9965-66882234BD44%2FUpdate%20a%20VCPKG%20package%7CB6AE6A97-94FC-4436-8FC6-08C21AE895DA%2F)&wdpartid=%7BB5CF19CC-40FE-0EC7-32B6-8119B427B32A%7D%7B1%7D&wdsectionfileid=%7B9DD25660-A195-48EA-B9E0-DF8B902AFDD7%7D&ovuser=72f988bf-86f1-41af-91ab-2d7cd011db47%2Ctitaiwang%40microsoft.com&clickparams=eyJBcHBOYW1lIjoiVGVhbXMtRGVza3RvcCIsIkFwcFZlcnNpb24iOiI0OS8yNTA5MTExNjAxNiIsIkhhc0ZlZGVyYXRlZFVzZXIiOmZhbHNlfQ%3D%3D&CID=fb9dcaa1-c0b5-1000-5597-c19e3adf468c&cidOR=SPO)one%7C63d3ab47-51d1-4a62-9965-66882234bd44%2FAdd%20or%20Update%20a%20C%2B%2B%20dependency%7Cb6ae6a97-94fc-4436-8fc6-08c21ae895da%2F%29&wdorigin=NavigationUrl Alternatively, directly run Terrapin to upload ONNX package (need SHA512): diff --git a/onnxruntime/test/onnx/TestCase.cc b/onnxruntime/test/onnx/TestCase.cc index 6df98ff505fa1..e9fdf68264c44 100644 --- a/onnxruntime/test/onnx/TestCase.cc +++ b/onnxruntime/test/onnx/TestCase.cc @@ -1436,8 +1436,6 @@ std::unique_ptr> GetBrokenTests(const std::string& provider // Fails since ONNX==1.19.0 broken_tests->insert({"l2normalization_axis_0", "unknown version"}); broken_tests->insert({"attention_4d_diff_heads_mask4d_padded_kv", "need nonpad_kv_seqlen "}); - broken_tests->insert({"attention_4d_with_past_and_present_qk_matmul_bias_3d_mask_causal", "attention op implementation is wrong"}); - broken_tests->insert({"attention_4d_with_past_and_present_qk_matmul_bias_4d_mask_causal", "attention op implementation is wrong"}); } #ifdef DISABLE_CONTRIB_OPS diff --git a/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc b/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc index f5f6a3ae3bc39..2611a7a942e32 100644 --- a/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc +++ b/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc @@ -31,21 +31,6 @@ "current_failing_tests": [ "^test_adagrad", "^test_adagrad_multiple", - "^test_attention_4d_diff_heads_mask4d_padded_kv*", // pending onnx update - "^test_attention_3d_gqa*", // pending onnx update - "^test_attention_3d_gqa_causal", // pending onnx update - "^test_attention_3d_gqa_scaled", // pending onnx update - "^test_attention_3d_gqa_softcap", // pending onnx update - "^test_attention_3d_gqa_with_past_and_present", // pending onnx update - "^test_attention_4d_gqa*", // pending onnx update - "^test_attention_4d_gqa_causal", // pending onnx update - "^test_attention_4d_gqa_scaled", // pending onnx update - "^test_attention_4d_gqa_softcap", // pending onnx update - "^test_attention_4d_gqa_with_past_and_present", // pending onnx update - "^test_attention_*causal*", // pending onnx update - "^test_attention_4d_with_past_and_present_qk_matmul_bias_3d_mask_causal*", // pending onnx update - "^test_attention_4d_with_past_and_present_qk_matmul_bias_4d_mask_causal*", // pending onnx update - "^test_attention_4d_attn_mask_3d_causal_expanded*", // pending onnx update "^test_attention_4d_fp16*", // precision issue: 1 / 192 mismatched elements "^test_attention_4d_fp16_expanded*", // precision issue: 3 / 192 mismatched elements "^test_l2normalization*", // LpNormalization(22) not implemented diff --git a/tools/ci_build/github/linux/docker/inference/aarch64/python/cpu/scripts/requirements.txt b/tools/ci_build/github/linux/docker/inference/aarch64/python/cpu/scripts/requirements.txt index bae6f4cb51816..f821d8dcb038c 100644 --- a/tools/ci_build/github/linux/docker/inference/aarch64/python/cpu/scripts/requirements.txt +++ b/tools/ci_build/github/linux/docker/inference/aarch64/python/cpu/scripts/requirements.txt @@ -3,7 +3,7 @@ mypy pytest setuptools>=68.2.2 wheel -onnx==1.19.0 +onnx @ git+https://github.com/onnx/onnx@e11938a232432630e1ff8904bb80091af6823021 protobuf==4.25.8 sympy==1.14 flatbuffers diff --git a/tools/ci_build/github/linux/docker/scripts/lort/requirements.txt b/tools/ci_build/github/linux/docker/scripts/lort/requirements.txt index 2871f5cab2ea2..100df28763ef8 100644 --- a/tools/ci_build/github/linux/docker/scripts/lort/requirements.txt +++ b/tools/ci_build/github/linux/docker/scripts/lort/requirements.txt @@ -3,7 +3,7 @@ beartype==0.15.0 flatbuffers cerberus h5py -onnx==1.19.0 +onnx @ git+https://github.com/onnx/onnx@e11938a232432630e1ff8904bb80091af6823021 # Python dependencies required for pytorch development astunparse expecttest!=0.2.0 diff --git a/tools/ci_build/github/linux/docker/scripts/manylinux/requirements.txt b/tools/ci_build/github/linux/docker/scripts/manylinux/requirements.txt index 381d42831e715..5d9778c9432ab 100644 --- a/tools/ci_build/github/linux/docker/scripts/manylinux/requirements.txt +++ b/tools/ci_build/github/linux/docker/scripts/manylinux/requirements.txt @@ -3,7 +3,7 @@ mypy pytest setuptools>=68.2.2 wheel -onnx==1.19.0 +onnx @ git+https://github.com/onnx/onnx@e11938a232432630e1ff8904bb80091af6823021 protobuf==4.25.1 sympy==1.14 flatbuffers diff --git a/tools/ci_build/github/linux/docker/scripts/requirements.txt b/tools/ci_build/github/linux/docker/scripts/requirements.txt index 4cc94f9148656..a525c0e8ed3fc 100644 --- a/tools/ci_build/github/linux/docker/scripts/requirements.txt +++ b/tools/ci_build/github/linux/docker/scripts/requirements.txt @@ -4,7 +4,7 @@ mypy pytest setuptools==78.1.1 wheel==0.45.1 -onnx==1.19.0 +onnx @ git+https://github.com/onnx/onnx@e11938a232432630e1ff8904bb80091af6823021 argparse sympy==1.14 flatbuffers diff --git a/tools/ci_build/github/linux/python/requirements.txt b/tools/ci_build/github/linux/python/requirements.txt index d48fb66194f2a..90b93b7d0cc6b 100644 --- a/tools/ci_build/github/linux/python/requirements.txt +++ b/tools/ci_build/github/linux/python/requirements.txt @@ -3,7 +3,7 @@ mypy pytest setuptools>=68.2.2 wheel -onnx==1.19.0 +onnx @ git+https://github.com/onnx/onnx@e11938a232432630e1ff8904bb80091af6823021 protobuf==4.25.1 sympy==1.14 flatbuffers diff --git a/tools/ci_build/github/windows/python/requirements.txt b/tools/ci_build/github/windows/python/requirements.txt index 6ab2ab2b7b61f..11e919075769c 100644 --- a/tools/ci_build/github/windows/python/requirements.txt +++ b/tools/ci_build/github/windows/python/requirements.txt @@ -3,7 +3,7 @@ mypy pytest setuptools>=68.2.2 wheel -onnx==1.19.0 +onnx @ git+https://github.com/onnx/onnx@e11938a232432630e1ff8904bb80091af6823021 protobuf==4.25.1 sympy==1.14 flatbuffers diff --git a/tools/ci_build/requirements/pybind/requirements.txt b/tools/ci_build/requirements/pybind/requirements.txt index c26f80ce443ad..61ca3fab8ef17 100644 --- a/tools/ci_build/requirements/pybind/requirements.txt +++ b/tools/ci_build/requirements/pybind/requirements.txt @@ -2,7 +2,7 @@ setuptools flatbuffers wheel==0.45.1 pytest -numpy>=1.19.0 +onnx @ git+https://github.com/onnx/onnx@e11938a232432630e1ff8904bb80091af6823021 sympy>=1.10 packaging cerberus From f0f6b3ebe7c600a002135ab0da1530177af7f292 Mon Sep 17 00:00:00 2001 From: Ti-Tai Wang Date: Tue, 30 Sep 2025 00:08:36 +0000 Subject: [PATCH 02/17] update patches --- cmake/patches/onnx/onnx.patch | 18 ++++++++++-------- cmake/vcpkg-ports/onnx/binskim.patch | 18 ++++++++++-------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/cmake/patches/onnx/onnx.patch b/cmake/patches/onnx/onnx.patch index e8ae766062d08..08e19041cffa6 100644 --- a/cmake/patches/onnx/onnx.patch +++ b/cmake/patches/onnx/onnx.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 47995579..6cc439f6 100644 +index cc3ef140..8afc844c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,7 @@ option(ONNX_USE_LITE_PROTO "Use lite protobuf instead of full." OFF) @@ -10,10 +10,12 @@ index 47995579..6cc439f6 100644 if(WIN32) option(ONNX_USE_MSVC_STATIC_RUNTIME "Build with MSVC static runtime" OFF) endif() -@@ -411,14 +412,28 @@ relative_protobuf_generate_cpp(ONNX_PROTO_SRCS - - add_library(onnx_proto ${ONNX_PROTO_SRCS}) +@@ -407,16 +408,28 @@ relative_protobuf_generate_cpp(ONNX_PROTO_SRCS + onnx/onnx-operators.in.proto + onnx/onnx-data.in.proto) +-add_library(onnx_proto ${ONNX_PROTO_SRCS}) +- -file(GLOB_RECURSE __tmp_srcs "${ONNX_ROOT}/onnx/*.h" "${ONNX_ROOT}/onnx/*.cc") -file(GLOB_RECURSE onnx_gtests_src "${ONNX_ROOT}/onnx/test/cpp/*.h" - "${ONNX_ROOT}/onnx/test/cpp/*.cc" @@ -47,7 +49,7 @@ index 47995579..6cc439f6 100644 # Hide all symbols we don't need set_target_properties(onnx_proto PROPERTIES CXX_VISIBILITY_PRESET hidden) -@@ -440,19 +455,6 @@ add_onnx_global_defines(onnx_proto) +@@ -438,19 +451,6 @@ add_onnx_global_defines(onnx_proto) target_include_directories(onnx_proto PUBLIC $ $) @@ -68,10 +70,10 @@ index 47995579..6cc439f6 100644 if(CMAKE_SYSTEM_NAME STREQUAL "AIX") # whole-archive linker option not available on AIX. diff --git a/onnx/defs/nn/old.cc b/onnx/defs/nn/old.cc -index 40635f97..44770774 100644 +index ad6dd0c1..50259f32 100644 --- a/onnx/defs/nn/old.cc +++ b/onnx/defs/nn/old.cc -@@ -4090,7 +4090,6 @@ ONNX_OPERATOR_SET_SCHEMA( +@@ -4091,7 +4091,6 @@ ONNX_OPERATOR_SET_SCHEMA( GroupNormalization, 18, OpSchema() @@ -80,7 +82,7 @@ index 40635f97..44770774 100644 .Attr("epsilon", "The epsilon value to use to avoid division by zero.", AttributeProto::FLOAT, 1e-5f) .Attr( diff --git a/onnx/defs/schema.h b/onnx/defs/schema.h -index ddd95454..34647987 100644 +index 7e9bc27f..4b87c5a5 100644 --- a/onnx/defs/schema.h +++ b/onnx/defs/schema.h @@ -999,7 +999,7 @@ class OpSchemaRegistry final : public ISchemaRegistry { diff --git a/cmake/vcpkg-ports/onnx/binskim.patch b/cmake/vcpkg-ports/onnx/binskim.patch index e8ae766062d08..08e19041cffa6 100644 --- a/cmake/vcpkg-ports/onnx/binskim.patch +++ b/cmake/vcpkg-ports/onnx/binskim.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 47995579..6cc439f6 100644 +index cc3ef140..8afc844c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,7 @@ option(ONNX_USE_LITE_PROTO "Use lite protobuf instead of full." OFF) @@ -10,10 +10,12 @@ index 47995579..6cc439f6 100644 if(WIN32) option(ONNX_USE_MSVC_STATIC_RUNTIME "Build with MSVC static runtime" OFF) endif() -@@ -411,14 +412,28 @@ relative_protobuf_generate_cpp(ONNX_PROTO_SRCS - - add_library(onnx_proto ${ONNX_PROTO_SRCS}) +@@ -407,16 +408,28 @@ relative_protobuf_generate_cpp(ONNX_PROTO_SRCS + onnx/onnx-operators.in.proto + onnx/onnx-data.in.proto) +-add_library(onnx_proto ${ONNX_PROTO_SRCS}) +- -file(GLOB_RECURSE __tmp_srcs "${ONNX_ROOT}/onnx/*.h" "${ONNX_ROOT}/onnx/*.cc") -file(GLOB_RECURSE onnx_gtests_src "${ONNX_ROOT}/onnx/test/cpp/*.h" - "${ONNX_ROOT}/onnx/test/cpp/*.cc" @@ -47,7 +49,7 @@ index 47995579..6cc439f6 100644 # Hide all symbols we don't need set_target_properties(onnx_proto PROPERTIES CXX_VISIBILITY_PRESET hidden) -@@ -440,19 +455,6 @@ add_onnx_global_defines(onnx_proto) +@@ -438,19 +451,6 @@ add_onnx_global_defines(onnx_proto) target_include_directories(onnx_proto PUBLIC $ $) @@ -68,10 +70,10 @@ index 47995579..6cc439f6 100644 if(CMAKE_SYSTEM_NAME STREQUAL "AIX") # whole-archive linker option not available on AIX. diff --git a/onnx/defs/nn/old.cc b/onnx/defs/nn/old.cc -index 40635f97..44770774 100644 +index ad6dd0c1..50259f32 100644 --- a/onnx/defs/nn/old.cc +++ b/onnx/defs/nn/old.cc -@@ -4090,7 +4090,6 @@ ONNX_OPERATOR_SET_SCHEMA( +@@ -4091,7 +4091,6 @@ ONNX_OPERATOR_SET_SCHEMA( GroupNormalization, 18, OpSchema() @@ -80,7 +82,7 @@ index 40635f97..44770774 100644 .Attr("epsilon", "The epsilon value to use to avoid division by zero.", AttributeProto::FLOAT, 1e-5f) .Attr( diff --git a/onnx/defs/schema.h b/onnx/defs/schema.h -index ddd95454..34647987 100644 +index 7e9bc27f..4b87c5a5 100644 --- a/onnx/defs/schema.h +++ b/onnx/defs/schema.h @@ -999,7 +999,7 @@ class OpSchemaRegistry final : public ISchemaRegistry { From bf083f589a7848c2b0e922580fcb2dc134ba57cc Mon Sep 17 00:00:00 2001 From: Ti-Tai Wang Date: Tue, 30 Sep 2025 00:14:27 +0000 Subject: [PATCH 03/17] removed extra patches --- .../external/onnxruntime_external_deps.cmake | 8 +--- .../onnx/avoid_regenerating_proto_files.patch | 46 ------------------- .../onnx/avoid_regenerating_proto_files.patch | 46 ------------------- 3 files changed, 1 insertion(+), 99 deletions(-) delete mode 100644 cmake/patches/onnx/avoid_regenerating_proto_files.patch delete mode 100644 cmake/vcpkg-ports/onnx/avoid_regenerating_proto_files.patch diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onnxruntime_external_deps.cmake index 8e1a880579b34..96bd08b5f2d4c 100644 --- a/cmake/external/onnxruntime_external_deps.cmake +++ b/cmake/external/onnxruntime_external_deps.cmake @@ -498,13 +498,7 @@ else() endif() if(Patch_FOUND) - set(ONNXRUNTIME_ONNX_PATCH_COMMAND - ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/onnx/onnx.patch && - # Patch changes from https://github.com/onnx/onnx/pull/7253 to avoid unnecessary rebuilding. - # This change should be included in ONNX 1.19.1. - ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < - ${PROJECT_SOURCE_DIR}/patches/onnx/avoid_regenerating_proto_files.patch - ) + set(ONNXRUNTIME_ONNX_PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/onnx/onnx.patch) else() set(ONNXRUNTIME_ONNX_PATCH_COMMAND "") endif() diff --git a/cmake/patches/onnx/avoid_regenerating_proto_files.patch b/cmake/patches/onnx/avoid_regenerating_proto_files.patch deleted file mode 100644 index 804dfeb8f59c2..0000000000000 --- a/cmake/patches/onnx/avoid_regenerating_proto_files.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 479955793..cc3ef1400 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -321,7 +321,7 @@ function(RELATIVE_PROTOBUF_GENERATE_CPP SRCS) - set(${SRCS}) - - set(GEN_PROTO_PY "${ONNX_ROOT}/onnx/gen_proto.py") -- set(GENERATED_FILE_TARGETS) -+ set(GENERATED_FILES) - foreach(INFILE ${ARGN}) - set(ABS_FILE "${ONNX_ROOT}/${INFILE}") - get_filename_component(FILE_DIR ${ABS_FILE} DIRECTORY) -@@ -371,12 +371,11 @@ function(RELATIVE_PROTOBUF_GENERATE_CPP SRCS) - list(APPEND GEN_PROTO_ARGS "${ONNX_PROTOC_EXECUTABLE}") - endif() - -- add_custom_target("${GENERATED_FILE_WE}_proto_file" -- COMMAND ${ONNX_PYTHON_INTERPRETER} "${GEN_PROTO_PY}" ${GEN_PROTO_ARGS} -- BYPRODUCTS "${GENERATED_PROTO}" -- DEPENDS ${INFILE} -- COMMENT "Running gen_proto.py on ${INFILE}" -- ) -+ # Use add_custom_command to avoid re-generate of PROTO files -+ add_custom_command(OUTPUT "${GENERATED_PROTO}" -+ COMMAND ${ONNX_PYTHON_INTERPRETER} "${GEN_PROTO_PY}" ${GEN_PROTO_ARGS} -+ DEPENDS ${INFILE} -+ COMMENT "Running gen_proto.py on ${INFILE}") - message("Generated: ${GENERATED_PROTO}") - - set(PROTOC_ARGS -@@ -393,11 +392,10 @@ function(RELATIVE_PROTOBUF_GENERATE_CPP SRCS) - list(APPEND PROTOC_ARGS ${CMAKE_CURRENT_BINARY_DIR}) - endif() - endif() -- list(APPEND GENERATED_FILE_TARGETS ${GENERATED_FILE_WE}_proto_file) -- add_custom_target(${GENERATED_FILE_WE}_src -+ list(APPEND GENERATED_FILES "${GENERATED_PROTO}") -+ add_custom_command(OUTPUT "${OUTPUT_PB_SRC}" - COMMAND "${ONNX_PROTOC_EXECUTABLE}" ${PROTOC_ARGS} -- BYPRODUCTS "${OUTPUT_PB_SRC}" -- DEPENDS ${GENERATED_FILE_TARGETS} -+ DEPENDS ${GENERATED_FILES} - COMMENT "Running C++ protocol buffer compiler on ${GENERATED_PROTO}") - endforeach() - diff --git a/cmake/vcpkg-ports/onnx/avoid_regenerating_proto_files.patch b/cmake/vcpkg-ports/onnx/avoid_regenerating_proto_files.patch deleted file mode 100644 index 804dfeb8f59c2..0000000000000 --- a/cmake/vcpkg-ports/onnx/avoid_regenerating_proto_files.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 479955793..cc3ef1400 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -321,7 +321,7 @@ function(RELATIVE_PROTOBUF_GENERATE_CPP SRCS) - set(${SRCS}) - - set(GEN_PROTO_PY "${ONNX_ROOT}/onnx/gen_proto.py") -- set(GENERATED_FILE_TARGETS) -+ set(GENERATED_FILES) - foreach(INFILE ${ARGN}) - set(ABS_FILE "${ONNX_ROOT}/${INFILE}") - get_filename_component(FILE_DIR ${ABS_FILE} DIRECTORY) -@@ -371,12 +371,11 @@ function(RELATIVE_PROTOBUF_GENERATE_CPP SRCS) - list(APPEND GEN_PROTO_ARGS "${ONNX_PROTOC_EXECUTABLE}") - endif() - -- add_custom_target("${GENERATED_FILE_WE}_proto_file" -- COMMAND ${ONNX_PYTHON_INTERPRETER} "${GEN_PROTO_PY}" ${GEN_PROTO_ARGS} -- BYPRODUCTS "${GENERATED_PROTO}" -- DEPENDS ${INFILE} -- COMMENT "Running gen_proto.py on ${INFILE}" -- ) -+ # Use add_custom_command to avoid re-generate of PROTO files -+ add_custom_command(OUTPUT "${GENERATED_PROTO}" -+ COMMAND ${ONNX_PYTHON_INTERPRETER} "${GEN_PROTO_PY}" ${GEN_PROTO_ARGS} -+ DEPENDS ${INFILE} -+ COMMENT "Running gen_proto.py on ${INFILE}") - message("Generated: ${GENERATED_PROTO}") - - set(PROTOC_ARGS -@@ -393,11 +392,10 @@ function(RELATIVE_PROTOBUF_GENERATE_CPP SRCS) - list(APPEND PROTOC_ARGS ${CMAKE_CURRENT_BINARY_DIR}) - endif() - endif() -- list(APPEND GENERATED_FILE_TARGETS ${GENERATED_FILE_WE}_proto_file) -- add_custom_target(${GENERATED_FILE_WE}_src -+ list(APPEND GENERATED_FILES "${GENERATED_PROTO}") -+ add_custom_command(OUTPUT "${OUTPUT_PB_SRC}" - COMMAND "${ONNX_PROTOC_EXECUTABLE}" ${PROTOC_ARGS} -- BYPRODUCTS "${OUTPUT_PB_SRC}" -- DEPENDS ${GENERATED_FILE_TARGETS} -+ DEPENDS ${GENERATED_FILES} - COMMENT "Running C++ protocol buffer compiler on ${GENERATED_PROTO}") - endforeach() - From 18106f6c774af5ae6f438b16724eb6fb4e0bd654 Mon Sep 17 00:00:00 2001 From: Ti-Tai Wang Date: Tue, 30 Sep 2025 00:18:19 +0000 Subject: [PATCH 04/17] removed all patches related to onnx #7253 --- cmake/vcpkg-ports/onnx/portfile.cmake | 3 --- 1 file changed, 3 deletions(-) diff --git a/cmake/vcpkg-ports/onnx/portfile.cmake b/cmake/vcpkg-ports/onnx/portfile.cmake index 411a9f9a5810a..9fd1a568ff8e3 100644 --- a/cmake/vcpkg-ports/onnx/portfile.cmake +++ b/cmake/vcpkg-ports/onnx/portfile.cmake @@ -7,9 +7,6 @@ vcpkg_from_github( SHA512 d600135bc8bb661149100b7aadd4caf41bdd0bb6acd8d4e193d6d0526571112a8b69969f65cf75cc08316ee6e3006e3c6a3d6944e7be72445fc946cc4ac75ff9 PATCHES fix-cmakelists.patch - # Patch changes from https://github.com/onnx/onnx/pull/7253 to avoid unnecessary rebuilding. - # This change should be included in ONNX 1.19.1. - avoid_regenerating_proto_files.patch fix-dependency-protobuf.patch binskim.patch ) From ca238fd7769f2ef40469c624ebe8a797dd75eb7e Mon Sep 17 00:00:00 2001 From: Ti-Tai Wang Date: Tue, 30 Sep 2025 00:58:19 +0000 Subject: [PATCH 05/17] type --- cmake/patches/onnx/onnx.patch | 12 +++++------- cmake/vcpkg-ports/onnx/binskim.patch | 12 +++++------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/cmake/patches/onnx/onnx.patch b/cmake/patches/onnx/onnx.patch index 08e19041cffa6..047cb527bb4da 100644 --- a/cmake/patches/onnx/onnx.patch +++ b/cmake/patches/onnx/onnx.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index cc3ef140..8afc844c 100644 +index cc3ef140..f70312ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,7 @@ option(ONNX_USE_LITE_PROTO "Use lite protobuf instead of full." OFF) @@ -10,12 +10,10 @@ index cc3ef140..8afc844c 100644 if(WIN32) option(ONNX_USE_MSVC_STATIC_RUNTIME "Build with MSVC static runtime" OFF) endif() -@@ -407,16 +408,28 @@ relative_protobuf_generate_cpp(ONNX_PROTO_SRCS - onnx/onnx-operators.in.proto - onnx/onnx-data.in.proto) +@@ -409,14 +410,28 @@ relative_protobuf_generate_cpp(ONNX_PROTO_SRCS + + add_library(onnx_proto ${ONNX_PROTO_SRCS}) --add_library(onnx_proto ${ONNX_PROTO_SRCS}) -- -file(GLOB_RECURSE __tmp_srcs "${ONNX_ROOT}/onnx/*.h" "${ONNX_ROOT}/onnx/*.cc") -file(GLOB_RECURSE onnx_gtests_src "${ONNX_ROOT}/onnx/test/cpp/*.h" - "${ONNX_ROOT}/onnx/test/cpp/*.cc" @@ -49,7 +47,7 @@ index cc3ef140..8afc844c 100644 # Hide all symbols we don't need set_target_properties(onnx_proto PROPERTIES CXX_VISIBILITY_PRESET hidden) -@@ -438,19 +451,6 @@ add_onnx_global_defines(onnx_proto) +@@ -438,19 +453,6 @@ add_onnx_global_defines(onnx_proto) target_include_directories(onnx_proto PUBLIC $ $) diff --git a/cmake/vcpkg-ports/onnx/binskim.patch b/cmake/vcpkg-ports/onnx/binskim.patch index 08e19041cffa6..047cb527bb4da 100644 --- a/cmake/vcpkg-ports/onnx/binskim.patch +++ b/cmake/vcpkg-ports/onnx/binskim.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index cc3ef140..8afc844c 100644 +index cc3ef140..f70312ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,7 @@ option(ONNX_USE_LITE_PROTO "Use lite protobuf instead of full." OFF) @@ -10,12 +10,10 @@ index cc3ef140..8afc844c 100644 if(WIN32) option(ONNX_USE_MSVC_STATIC_RUNTIME "Build with MSVC static runtime" OFF) endif() -@@ -407,16 +408,28 @@ relative_protobuf_generate_cpp(ONNX_PROTO_SRCS - onnx/onnx-operators.in.proto - onnx/onnx-data.in.proto) +@@ -409,14 +410,28 @@ relative_protobuf_generate_cpp(ONNX_PROTO_SRCS + + add_library(onnx_proto ${ONNX_PROTO_SRCS}) --add_library(onnx_proto ${ONNX_PROTO_SRCS}) -- -file(GLOB_RECURSE __tmp_srcs "${ONNX_ROOT}/onnx/*.h" "${ONNX_ROOT}/onnx/*.cc") -file(GLOB_RECURSE onnx_gtests_src "${ONNX_ROOT}/onnx/test/cpp/*.h" - "${ONNX_ROOT}/onnx/test/cpp/*.cc" @@ -49,7 +47,7 @@ index cc3ef140..8afc844c 100644 # Hide all symbols we don't need set_target_properties(onnx_proto PROPERTIES CXX_VISIBILITY_PRESET hidden) -@@ -438,19 +451,6 @@ add_onnx_global_defines(onnx_proto) +@@ -438,19 +453,6 @@ add_onnx_global_defines(onnx_proto) target_include_directories(onnx_proto PUBLIC $ $) From a6cbbd34704e95dc692b9c6740a5716e5e1b5cbf Mon Sep 17 00:00:00 2001 From: Ti-Tai Wang Date: Tue, 30 Sep 2025 01:02:06 +0000 Subject: [PATCH 06/17] remove diabled tests in main.cc --- onnxruntime/test/onnx/main.cc | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/onnxruntime/test/onnx/main.cc b/onnxruntime/test/onnx/main.cc index b6f2cb2683677..463634b370d4c 100644 --- a/onnxruntime/test/onnx/main.cc +++ b/onnxruntime/test/onnx/main.cc @@ -795,24 +795,6 @@ select from 'TF8', 'TF16', 'UINT8', 'FLOAT', 'ITENSOR'. \n)"); // Please make no more changes to the list static const ORTCHAR_T* immutable_broken_tests[] = { - // pending ONNX update - ORT_TSTR("attention_3d_gqa"), - ORT_TSTR("attention_3d_gqa_attn_mask"), - ORT_TSTR("attention_3d_gqa_causal"), - ORT_TSTR("attention_3d_gqa_scaled"), - ORT_TSTR("attention_3d_gqa_softcap"), - ORT_TSTR("attention_3d_gqa_with_past_and_present"), - ORT_TSTR("attention_4d_gqa"), - ORT_TSTR("attention_4d_gqa_attn_mask"), - ORT_TSTR("attention_4d_gqa_causal"), - ORT_TSTR("attention_4d_gqa_scaled"), - ORT_TSTR("attention_4d_gqa_softcap"), - ORT_TSTR("attention_4d_gqa_with_past_and_present"), - ORT_TSTR("attention_4d_diff_heads_mask4d_padded_kv"), - ORT_TSTR("attention_4d_gqa_with_past_and_present_fp16"), - ORT_TSTR("attention_4d_with_past_and_present_qk_matmul_bias_3d_mask_causal"), - ORT_TSTR("attention_4d_with_past_and_present_qk_matmul_bias_4d_mask_causal"), - // unsupported case ORT_TSTR("AvgPool1d"), ORT_TSTR("AvgPool1d_stride"), ORT_TSTR("AvgPool2d"), From 67ce51b87ecbfba64e0aba8785681a1974cff92c Mon Sep 17 00:00:00 2001 From: Ti-Tai Wang Date: Wed, 1 Oct 2025 16:44:26 +0000 Subject: [PATCH 07/17] add disable tests to QNN --- onnxruntime/test/onnx/TestCase.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/onnxruntime/test/onnx/TestCase.cc b/onnxruntime/test/onnx/TestCase.cc index e9fdf68264c44..8b117f4dba6b3 100644 --- a/onnxruntime/test/onnx/TestCase.cc +++ b/onnxruntime/test/onnx/TestCase.cc @@ -1435,6 +1435,20 @@ std::unique_ptr> GetBrokenTests(const std::string& provider broken_tests->insert({"scatter_elements_with_negative_indices", "unknown version"}); // Fails since ONNX==1.19.0 broken_tests->insert({"l2normalization_axis_0", "unknown version"}); + broken_tests->insert({"attention_3d_gqa_attn_mask", "unknown version"}); + broken_tests->insert({"attention_3d_gqa_causal", "unknown version"}); + broken_tests->insert({"attention_3d_gqa_scaled", "unknown version"}); + broken_tests->insert({"attention_3d_gqa_softcap", "unknown version"}); + broken_tests->insert({"attention_3d_gqa_with_past_and_present", "unknown version"}); + broken_tests->insert({"attention_4d_gqa", "unknown version"}); + broken_tests->insert({"attention_4d_gqa_attn_mask", "unknown version"}); + broken_tests->insert({"attention_4d_gqa_causal", "unknown version"}); + broken_tests->insert({"attention_4d_gqa_scaled", "unknown version"}); + broken_tests->insert({"attention_4d_gqa_softcap", "unknown version"}); + broken_tests->insert({"attention_4d_gqa_with_past_and_present", "unknown version"}); + broken_tests->insert({"attention_4d_gqa_with_past_and_present_fp16", "unknown version"}); + broken_tests->insert({"attention_4d_with_past_and_present_qk_matmul_bias_3d_mask_causal", "unknown version"}); + broken_tests->insert({"attention_4d_with_past_and_present_qk_matmul_bias_4d_mask_causal", "unknown version"}); broken_tests->insert({"attention_4d_diff_heads_mask4d_padded_kv", "need nonpad_kv_seqlen "}); } From 37e8962f3de0494e79ebee187d3c8a59b9e55ac6 Mon Sep 17 00:00:00 2001 From: Ti-Tai Wang Date: Wed, 1 Oct 2025 19:00:40 +0000 Subject: [PATCH 08/17] missed one test --- onnxruntime/test/onnx/TestCase.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/onnxruntime/test/onnx/TestCase.cc b/onnxruntime/test/onnx/TestCase.cc index 8b117f4dba6b3..cbb25bb9b629e 100644 --- a/onnxruntime/test/onnx/TestCase.cc +++ b/onnxruntime/test/onnx/TestCase.cc @@ -1435,6 +1435,7 @@ std::unique_ptr> GetBrokenTests(const std::string& provider broken_tests->insert({"scatter_elements_with_negative_indices", "unknown version"}); // Fails since ONNX==1.19.0 broken_tests->insert({"l2normalization_axis_0", "unknown version"}); + broken_tests->insert({"attention_3d_gqa", "unknown version"}); broken_tests->insert({"attention_3d_gqa_attn_mask", "unknown version"}); broken_tests->insert({"attention_3d_gqa_causal", "unknown version"}); broken_tests->insert({"attention_3d_gqa_scaled", "unknown version"}); From 092edb3a17880b8f746eb52dd4de40105fef6a66 Mon Sep 17 00:00:00 2001 From: Ti-Tai Wang Date: Thu, 2 Oct 2025 20:47:30 +0000 Subject: [PATCH 09/17] update to 1.19.1rc --- .../inference/aarch64/python/cpu/scripts/requirements.txt | 2 +- .../ci_build/github/linux/docker/scripts/lort/requirements.txt | 2 +- .../github/linux/docker/scripts/manylinux/requirements.txt | 2 +- tools/ci_build/github/linux/docker/scripts/requirements.txt | 2 +- tools/ci_build/github/linux/python/requirements.txt | 2 +- tools/ci_build/github/windows/python/requirements.txt | 2 +- tools/ci_build/requirements/pybind/requirements.txt | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/ci_build/github/linux/docker/inference/aarch64/python/cpu/scripts/requirements.txt b/tools/ci_build/github/linux/docker/inference/aarch64/python/cpu/scripts/requirements.txt index f821d8dcb038c..eabc22abf2b97 100644 --- a/tools/ci_build/github/linux/docker/inference/aarch64/python/cpu/scripts/requirements.txt +++ b/tools/ci_build/github/linux/docker/inference/aarch64/python/cpu/scripts/requirements.txt @@ -3,7 +3,7 @@ mypy pytest setuptools>=68.2.2 wheel -onnx @ git+https://github.com/onnx/onnx@e11938a232432630e1ff8904bb80091af6823021 +onnx==1.19.1rc1 protobuf==4.25.8 sympy==1.14 flatbuffers diff --git a/tools/ci_build/github/linux/docker/scripts/lort/requirements.txt b/tools/ci_build/github/linux/docker/scripts/lort/requirements.txt index 100df28763ef8..dcdf5ef7c674a 100644 --- a/tools/ci_build/github/linux/docker/scripts/lort/requirements.txt +++ b/tools/ci_build/github/linux/docker/scripts/lort/requirements.txt @@ -3,7 +3,7 @@ beartype==0.15.0 flatbuffers cerberus h5py -onnx @ git+https://github.com/onnx/onnx@e11938a232432630e1ff8904bb80091af6823021 +onnx==1.19.1rc1 # Python dependencies required for pytorch development astunparse expecttest!=0.2.0 diff --git a/tools/ci_build/github/linux/docker/scripts/manylinux/requirements.txt b/tools/ci_build/github/linux/docker/scripts/manylinux/requirements.txt index 5d9778c9432ab..ab29fc9675e9b 100644 --- a/tools/ci_build/github/linux/docker/scripts/manylinux/requirements.txt +++ b/tools/ci_build/github/linux/docker/scripts/manylinux/requirements.txt @@ -3,7 +3,7 @@ mypy pytest setuptools>=68.2.2 wheel -onnx @ git+https://github.com/onnx/onnx@e11938a232432630e1ff8904bb80091af6823021 +onnx==1.19.1rc1 protobuf==4.25.1 sympy==1.14 flatbuffers diff --git a/tools/ci_build/github/linux/docker/scripts/requirements.txt b/tools/ci_build/github/linux/docker/scripts/requirements.txt index a525c0e8ed3fc..e280840dec222 100644 --- a/tools/ci_build/github/linux/docker/scripts/requirements.txt +++ b/tools/ci_build/github/linux/docker/scripts/requirements.txt @@ -4,7 +4,7 @@ mypy pytest setuptools==78.1.1 wheel==0.45.1 -onnx @ git+https://github.com/onnx/onnx@e11938a232432630e1ff8904bb80091af6823021 +onnx==1.19.1rc1 argparse sympy==1.14 flatbuffers diff --git a/tools/ci_build/github/linux/python/requirements.txt b/tools/ci_build/github/linux/python/requirements.txt index 90b93b7d0cc6b..78578fd87faca 100644 --- a/tools/ci_build/github/linux/python/requirements.txt +++ b/tools/ci_build/github/linux/python/requirements.txt @@ -3,7 +3,7 @@ mypy pytest setuptools>=68.2.2 wheel -onnx @ git+https://github.com/onnx/onnx@e11938a232432630e1ff8904bb80091af6823021 +onnx==1.19.1rc1 protobuf==4.25.1 sympy==1.14 flatbuffers diff --git a/tools/ci_build/github/windows/python/requirements.txt b/tools/ci_build/github/windows/python/requirements.txt index 11e919075769c..1b5a337c7fcbb 100644 --- a/tools/ci_build/github/windows/python/requirements.txt +++ b/tools/ci_build/github/windows/python/requirements.txt @@ -3,7 +3,7 @@ mypy pytest setuptools>=68.2.2 wheel -onnx @ git+https://github.com/onnx/onnx@e11938a232432630e1ff8904bb80091af6823021 +onnx==1.19.1rc1 protobuf==4.25.1 sympy==1.14 flatbuffers diff --git a/tools/ci_build/requirements/pybind/requirements.txt b/tools/ci_build/requirements/pybind/requirements.txt index 61ca3fab8ef17..5d30eea5f0896 100644 --- a/tools/ci_build/requirements/pybind/requirements.txt +++ b/tools/ci_build/requirements/pybind/requirements.txt @@ -2,7 +2,7 @@ setuptools flatbuffers wheel==0.45.1 pytest -onnx @ git+https://github.com/onnx/onnx@e11938a232432630e1ff8904bb80091af6823021 +onnx==1.19.1rc1 sympy>=1.10 packaging cerberus From ff5898563d7e4d24b90c02523431090a7b94e0ce Mon Sep 17 00:00:00 2001 From: Ti-Tai Wang Date: Fri, 3 Oct 2025 16:55:26 +0000 Subject: [PATCH 10/17] disable nonpad_kv_seqlen tests --- onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc | 1 + 1 file changed, 1 insertion(+) diff --git a/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc b/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc index 2611a7a942e32..280e25a34e5a9 100644 --- a/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc +++ b/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc @@ -33,6 +33,7 @@ "^test_adagrad_multiple", "^test_attention_4d_fp16*", // precision issue: 1 / 192 mismatched elements "^test_attention_4d_fp16_expanded*", // precision issue: 3 / 192 mismatched elements + "^test_attention_4d_diff_heads_mask4d_padded_kv*" // Need nonpad_kv_seqlen "^test_l2normalization*", // LpNormalization(22) not implemented "^test_l1normalization*", // LpNormalization(22) not implemented "^test_lpnormalization*", // LpNormalization(22) not implemented From ae9ec670d6908961f77a2f7de4c7b4a5ed55140b Mon Sep 17 00:00:00 2001 From: Ti-Tai Wang Date: Fri, 3 Oct 2025 18:12:52 +0000 Subject: [PATCH 11/17] type --- .../test/testdata/onnx_backend_test_series_filters.jsonc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc b/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc index 280e25a34e5a9..1f00148f492ce 100644 --- a/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc +++ b/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc @@ -33,7 +33,7 @@ "^test_adagrad_multiple", "^test_attention_4d_fp16*", // precision issue: 1 / 192 mismatched elements "^test_attention_4d_fp16_expanded*", // precision issue: 3 / 192 mismatched elements - "^test_attention_4d_diff_heads_mask4d_padded_kv*" // Need nonpad_kv_seqlen + "^test_attention_4d_diff_heads_mask4d_padded_kv*", // Need nonpad_kv_seqlen "^test_l2normalization*", // LpNormalization(22) not implemented "^test_l1normalization*", // LpNormalization(22) not implemented "^test_lpnormalization*", // LpNormalization(22) not implemented From a8e2fd53fc549219dbcaa9eb639ba5c14d7c79be Mon Sep 17 00:00:00 2001 From: Ti-Tai Wang Date: Fri, 3 Oct 2025 22:42:29 +0000 Subject: [PATCH 12/17] add onnx-ir into pybind requirements.txt --- tools/ci_build/requirements/pybind/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/ci_build/requirements/pybind/requirements.txt b/tools/ci_build/requirements/pybind/requirements.txt index 5d30eea5f0896..ed5919be03144 100644 --- a/tools/ci_build/requirements/pybind/requirements.txt +++ b/tools/ci_build/requirements/pybind/requirements.txt @@ -8,3 +8,4 @@ packaging cerberus psutil flatbuffers +onnx-ir From cecbe9dc4b51ffc47dfe9780f4ea51f7ca224343 Mon Sep 17 00:00:00 2001 From: Ti-Tai Wang Date: Mon, 6 Oct 2025 22:38:52 +0000 Subject: [PATCH 13/17] disable webgpu errors --- .../test/testdata/onnx_backend_test_series_filters.jsonc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc b/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc index 1f00148f492ce..d7df55aa5e5d1 100644 --- a/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc +++ b/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc @@ -33,6 +33,9 @@ "^test_adagrad_multiple", "^test_attention_4d_fp16*", // precision issue: 1 / 192 mismatched elements "^test_attention_4d_fp16_expanded*", // precision issue: 3 / 192 mismatched elements + "^test_attention_4d_gqa_with_past_and_present_fp16_expanded*", // webgpu mismatched elements 38 / 576 + "^test_attention_4d_with_past_and_present_qk_matmul_bias_3d_mask_causal_expanded*", // webgpu + "^test_attention_4d_attn_mask_3d_causal_expanded*", // webgpu "^test_attention_4d_diff_heads_mask4d_padded_kv*", // Need nonpad_kv_seqlen "^test_l2normalization*", // LpNormalization(22) not implemented "^test_l1normalization*", // LpNormalization(22) not implemented From f7cac193879ad2195dbf52a6d9d1264f148a27b6 Mon Sep 17 00:00:00 2001 From: Ti-Tai Wang Date: Tue, 7 Oct 2025 21:23:26 +0000 Subject: [PATCH 14/17] try mul_1.onnx model --- onnxruntime/test/python/onnxruntime_test_python_compile_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onnxruntime/test/python/onnxruntime_test_python_compile_api.py b/onnxruntime/test/python/onnxruntime_test_python_compile_api.py index e46cdb4f98850..37707e6462a04 100644 --- a/onnxruntime/test/python/onnxruntime_test_python_compile_api.py +++ b/onnxruntime/test/python/onnxruntime_test_python_compile_api.py @@ -428,7 +428,7 @@ def test_fail_load_uncompiled_model_and_then_compile(self): if "QNNExecutionProvider" not in available_providers: self.skipTest("Skipping test because it needs to run on a compiling EP") - input_model_path = get_name("nhwc_resize_scales_opset18.onnx") + input_model_path = get_name("mul_1.onnx") session_options = onnxrt.SessionOptions() session_options.add_session_config_entry("session.disable_model_compile", "1") # Disable JIT model compilation! From a54e3f489b14b075eef90fccc1be6fe17b1ac1d1 Mon Sep 17 00:00:00 2001 From: Ti-Tai Wang Date: Tue, 7 Oct 2025 23:25:58 +0000 Subject: [PATCH 15/17] enable rotary embedding tests --- .../testdata/onnx_backend_test_series_filters.jsonc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc b/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc index d7df55aa5e5d1..0558d008a2275 100644 --- a/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc +++ b/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc @@ -112,13 +112,9 @@ "^test_if_opt", "^test_loop16_seq_none", "^test_identity_opt", - // rotary dim should be fixed in onnx==1.19.1 - "^test_rotary_embedding_no_position_ids_rotary_dim", - "^test_rotary_embedding_with_interleaved_rotary_dim", - "^test_rotary_embedding_with_rotary_dim", - "^test_rotary_embedding_3d_input_expanded", - "^test_rotary_embedding_interleaved_expanded", - "^test_rotary_embedding_no_position_ids_interleaved_expanded", + "^test_rotary_embedding_3d_input_expanded", // win cuda fail + "^test_rotary_embedding_interleaved_expanded", // win cuda fail + "^test_rotary_embedding_no_position_ids_interleaved_expanded", // win cuda fail "^test_rotary_embedding_expanded", //webgpu "^test_rotary_embedding_no_position_ids_expanded", //webgpu // Following tests are for opset 16 ops and are not yet implemented in ORT From 301cb27407cf2414ac933201ec423304912bdbfc Mon Sep 17 00:00:00 2001 From: Ti-Tai Wang Date: Wed, 8 Oct 2025 21:20:15 +0000 Subject: [PATCH 16/17] revert pybind requirements.txt --- tools/ci_build/requirements/pybind/requirements.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/ci_build/requirements/pybind/requirements.txt b/tools/ci_build/requirements/pybind/requirements.txt index ed5919be03144..c26f80ce443ad 100644 --- a/tools/ci_build/requirements/pybind/requirements.txt +++ b/tools/ci_build/requirements/pybind/requirements.txt @@ -2,10 +2,9 @@ setuptools flatbuffers wheel==0.45.1 pytest -onnx==1.19.1rc1 +numpy>=1.19.0 sympy>=1.10 packaging cerberus psutil flatbuffers -onnx-ir From adc35cc03cdee45b24aec0575af9265467aa501d Mon Sep 17 00:00:00 2001 From: Ti-Tai Wang Date: Mon, 13 Oct 2025 17:24:17 +0000 Subject: [PATCH 17/17] bump to official 1.19.1 --- cmake/deps.txt | 2 +- cmake/vcpkg-ports/onnx/portfile.cmake | 4 ++-- .../test/python/onnxruntime_test_python_compile_api.py | 2 +- .../inference/aarch64/python/cpu/scripts/requirements.txt | 2 +- .../github/linux/docker/scripts/lort/requirements.txt | 2 +- .../github/linux/docker/scripts/manylinux/requirements.txt | 2 +- tools/ci_build/github/linux/docker/scripts/requirements.txt | 2 +- tools/ci_build/github/linux/python/requirements.txt | 2 +- tools/ci_build/github/windows/python/requirements.txt | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmake/deps.txt b/cmake/deps.txt index 6c2cda635c1e1..bf76753c1b3c0 100644 --- a/cmake/deps.txt +++ b/cmake/deps.txt @@ -34,7 +34,7 @@ microsoft_gsl;https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.zip;cf36 microsoft_wil;https://github.com/microsoft/wil/archive/refs/tags/v1.0.230629.1.zip;e4a542a323c070376f7c2d1973d0f7ddbc1d2fa5 mimalloc;https://github.com/microsoft/mimalloc/archive/refs/tags/v2.1.1.zip;d5ee7d34223d0567892db5179849939c8769dc41 mp11;https://github.com/boostorg/mp11/archive/refs/tags/boost-1.82.0.zip;9bc9e01dffb64d9e0773b2e44d2f22c51aace063 -onnx;https://github.com/onnx/onnx/archive/e11938a232432630e1ff8904bb80091af6823021.zip;987028d7881b44958f0a1eb9ccb3e75b05ac9948 +onnx;https://github.com/onnx/onnx/archive/refs/tags/v1.19.1.zip;c5215b5697dcdfd71799f001b8c4054a6bba6b09 # Use the latest commit of 10.9-GA onnx_tensorrt;https://github.com/onnx/onnx-tensorrt/archive/d5dce67db7c2e64b07e055571f5ec06f7f254de2.zip;01114d3b67650857281fa50faa2e412130a63b69 protobuf;https://github.com/protocolbuffers/protobuf/archive/refs/tags/v21.12.zip;7cf2733949036c7d52fda017badcab093fe73bfa diff --git a/cmake/vcpkg-ports/onnx/portfile.cmake b/cmake/vcpkg-ports/onnx/portfile.cmake index 9fd1a568ff8e3..882850963a0c0 100644 --- a/cmake/vcpkg-ports/onnx/portfile.cmake +++ b/cmake/vcpkg-ports/onnx/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO onnx/onnx - REF e11938a232432630e1ff8904bb80091af6823021 - SHA512 d600135bc8bb661149100b7aadd4caf41bdd0bb6acd8d4e193d6d0526571112a8b69969f65cf75cc08316ee6e3006e3c6a3d6944e7be72445fc946cc4ac75ff9 + REF "v${VERSION}" + SHA512 cf6ff4c0bb6cc16ce5f4d6267480d35f3c7a5fde94d10e1358928ff6e4ec6d756a7c5d34a500e60bbd8eb1912c8af21aa763719321b330f56a0eb6b9b810ef60 PATCHES fix-cmakelists.patch fix-dependency-protobuf.patch diff --git a/onnxruntime/test/python/onnxruntime_test_python_compile_api.py b/onnxruntime/test/python/onnxruntime_test_python_compile_api.py index 37707e6462a04..e46cdb4f98850 100644 --- a/onnxruntime/test/python/onnxruntime_test_python_compile_api.py +++ b/onnxruntime/test/python/onnxruntime_test_python_compile_api.py @@ -428,7 +428,7 @@ def test_fail_load_uncompiled_model_and_then_compile(self): if "QNNExecutionProvider" not in available_providers: self.skipTest("Skipping test because it needs to run on a compiling EP") - input_model_path = get_name("mul_1.onnx") + input_model_path = get_name("nhwc_resize_scales_opset18.onnx") session_options = onnxrt.SessionOptions() session_options.add_session_config_entry("session.disable_model_compile", "1") # Disable JIT model compilation! diff --git a/tools/ci_build/github/linux/docker/inference/aarch64/python/cpu/scripts/requirements.txt b/tools/ci_build/github/linux/docker/inference/aarch64/python/cpu/scripts/requirements.txt index eabc22abf2b97..1b1dadeaf8db2 100644 --- a/tools/ci_build/github/linux/docker/inference/aarch64/python/cpu/scripts/requirements.txt +++ b/tools/ci_build/github/linux/docker/inference/aarch64/python/cpu/scripts/requirements.txt @@ -3,7 +3,7 @@ mypy pytest setuptools>=68.2.2 wheel -onnx==1.19.1rc1 +onnx==1.19.1 protobuf==4.25.8 sympy==1.14 flatbuffers diff --git a/tools/ci_build/github/linux/docker/scripts/lort/requirements.txt b/tools/ci_build/github/linux/docker/scripts/lort/requirements.txt index dcdf5ef7c674a..dc394ff50f4f9 100644 --- a/tools/ci_build/github/linux/docker/scripts/lort/requirements.txt +++ b/tools/ci_build/github/linux/docker/scripts/lort/requirements.txt @@ -3,7 +3,7 @@ beartype==0.15.0 flatbuffers cerberus h5py -onnx==1.19.1rc1 +onnx==1.19.1 # Python dependencies required for pytorch development astunparse expecttest!=0.2.0 diff --git a/tools/ci_build/github/linux/docker/scripts/manylinux/requirements.txt b/tools/ci_build/github/linux/docker/scripts/manylinux/requirements.txt index ab29fc9675e9b..2d89aece56340 100644 --- a/tools/ci_build/github/linux/docker/scripts/manylinux/requirements.txt +++ b/tools/ci_build/github/linux/docker/scripts/manylinux/requirements.txt @@ -3,7 +3,7 @@ mypy pytest setuptools>=68.2.2 wheel -onnx==1.19.1rc1 +onnx==1.19.1 protobuf==4.25.1 sympy==1.14 flatbuffers diff --git a/tools/ci_build/github/linux/docker/scripts/requirements.txt b/tools/ci_build/github/linux/docker/scripts/requirements.txt index e280840dec222..2fc034d9c5ca2 100644 --- a/tools/ci_build/github/linux/docker/scripts/requirements.txt +++ b/tools/ci_build/github/linux/docker/scripts/requirements.txt @@ -4,7 +4,7 @@ mypy pytest setuptools==78.1.1 wheel==0.45.1 -onnx==1.19.1rc1 +onnx==1.19.1 argparse sympy==1.14 flatbuffers diff --git a/tools/ci_build/github/linux/python/requirements.txt b/tools/ci_build/github/linux/python/requirements.txt index 78578fd87faca..293aa49823d48 100644 --- a/tools/ci_build/github/linux/python/requirements.txt +++ b/tools/ci_build/github/linux/python/requirements.txt @@ -3,7 +3,7 @@ mypy pytest setuptools>=68.2.2 wheel -onnx==1.19.1rc1 +onnx==1.19.1 protobuf==4.25.1 sympy==1.14 flatbuffers diff --git a/tools/ci_build/github/windows/python/requirements.txt b/tools/ci_build/github/windows/python/requirements.txt index 1b5a337c7fcbb..b48f6c3c2784d 100644 --- a/tools/ci_build/github/windows/python/requirements.txt +++ b/tools/ci_build/github/windows/python/requirements.txt @@ -3,7 +3,7 @@ mypy pytest setuptools>=68.2.2 wheel -onnx==1.19.1rc1 +onnx==1.19.1 protobuf==4.25.1 sympy==1.14 flatbuffers