Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a4729e3
draft
titaiwangms Nov 14, 2025
d65714e
fix kernel registration
titaiwangms Nov 15, 2025
ca12fbd
update onnx
titaiwangms Nov 15, 2025
0327d48
try -DONNX_USE_LITE_PROTO=OFF
titaiwangms Nov 18, 2025
f449e5b
try always using lite
titaiwangms Nov 18, 2025
97e2d76
add deterministic to custom ops
titaiwangms Nov 20, 2025
8f2d578
update tests
titaiwangms Nov 20, 2025
9dd0f69
removed deprecated onnx api
titaiwangms Nov 20, 2025
fc11d70
Merge branch 'main' into titaiwang/check_onnx_1_20
titaiwangms Nov 25, 2025
5d0ff1a
update to rc2
titaiwangms Nov 25, 2025
a4a74d0
update vcpkg to rc2
titaiwangms Nov 25, 2025
206a540
update SHA
titaiwangms Nov 25, 2025
a6cfd8e
fix op tests
titaiwangms Nov 26, 2025
06fdcf6
skip qnn tests and update webgl md
titaiwangms Nov 26, 2025
23a9bc9
Merge branch 'main' into titaiwang/check_onnx_1_20
titaiwangms Dec 1, 2025
5f2ea79
update to official 1.20.0 and pass in args.use_full_proto
titaiwangms Dec 3, 2025
1599ddd
Merge branch 'main' into titaiwang/check_onnx_1_20
titaiwangms Dec 3, 2025
51a3246
update triplets
titaiwangms Dec 3, 2025
6f9ad1a
fix regessions(mistake)
titaiwangms Dec 3, 2025
7daf13f
update op doc and cmake unittest onnx proto
titaiwangms Dec 5, 2025
eebe067
exclude new matmul test from webgpu and fix ios cmake
titaiwangms Dec 5, 2025
74c219a
add onnx patch and exclude another matmul 1d test
titaiwangms Dec 5, 2025
fcb4a73
Revert "add onnx patch and exclude another matmul 1d test"
titaiwangms Dec 5, 2025
db47821
disable new 1d matmul tests
titaiwangms Dec 5, 2025
03e83cc
exclude onnx/cmake/test/main.cc from libonnx.a
titaiwangms Dec 8, 2025
689817d
Merge branch 'main' into titaiwang/check_onnx_1_20
titaiwangms Dec 8, 2025
8d8a700
update vcpkg with fixed patch
titaiwangms Dec 8, 2025
f0d3ab9
revert a try for ios
titaiwangms Dec 8, 2025
cbd4cec
create onnx_proto from onnx_proto_object for xcode
titaiwangms Dec 10, 2025
0260a62
add static library of onnx onnx_proto for xcode
titaiwangms Dec 10, 2025
746a5d1
Merge branch 'main' into titaiwang/check_onnx_1_20
titaiwangms Jan 8, 2026
b6693cd
bump to onnx==1.20.1rc1
titaiwangms Jan 9, 2026
640fd5a
revert xcode cmake changes
titaiwangms Jan 9, 2026
eca92b7
update SHA in deps.txt
titaiwangms Jan 10, 2026
f5c86b0
official 1.20.1 release
titaiwangms Jan 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/deps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.250325.1.zip;826c8bd47c2258ec61b8b218e031e5b33d27f761
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.1.zip;c5215b5697dcdfd71799f001b8c4054a6bba6b09
onnx;https://github.com/onnx/onnx/archive/refs/tags/v1.20.1.zip;30b80c81a1a381188896e86abe460c3c3f3091fd
# 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
Expand Down
2 changes: 1 addition & 1 deletion cmake/external/onnx
Submodule onnx updated 852 files
2 changes: 1 addition & 1 deletion cmake/onnxruntime_unittests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ onnxruntime_add_static_library(onnx_test_data_proto ${TEST_SRC_DIR}/proto/tml.pr
add_dependencies(onnx_test_data_proto onnx_proto ${onnxruntime_EXTERNAL_DEPENDENCIES})
#onnx_proto target should mark this definition as public, instead of private
target_compile_definitions(onnx_test_data_proto PRIVATE "-DONNX_API=")
onnxruntime_add_include_to_target(onnx_test_data_proto onnx_proto)
onnxruntime_add_include_to_target(onnx_test_data_proto onnx_proto ${PROTOBUF_LIB})
if (MSVC)
# Cutlass code has an issue with the following:
# warning C4100: 'magic': unreferenced formal parameter
Expand Down
76 changes: 33 additions & 43 deletions cmake/patches/onnx/onnx.patch
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cc3ef140..f70312ba 100644
index 584c0419a..5d4ffff99 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,6 +57,7 @@ option(ONNX_USE_LITE_PROTO "Use lite protobuf instead of full." OFF)
@@ -52,6 +52,7 @@ option(ONNX_USE_LITE_PROTO "Use lite protobuf instead of full." OFF)
option(ONNX_DISABLE_EXCEPTIONS "Disable exception handling." OFF)
option(ONNX_DISABLE_STATIC_REGISTRATION "Disable static registration for ONNX operator schemas." OFF)
option(ONNX_USE_UNITY_BUILD "Enable Unity (Jumbo) build for" OFF)
+option(ONNX_MINIMAL_BUILD "Build only essential ONNX components" OFF)
if(WIN32)
option(ONNX_USE_MSVC_STATIC_RUNTIME "Build with MSVC static runtime" OFF)
endif()
@@ -409,14 +410,28 @@ relative_protobuf_generate_cpp(ONNX_PROTO_SRCS

add_library(onnx_proto ${ONNX_PROTO_SRCS})
@@ -397,14 +398,28 @@ relative_protobuf_generate_cpp(ONNX_PROTO_SRCS
onnx/onnx-operators.in.proto
onnx/onnx-data.in.proto)

-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"
- "${ONNX_ROOT}/onnx/backend/test/cpp/*.cc"
- "${ONNX_ROOT}/onnx/backend/test/cpp/*.h")
-list(REMOVE_ITEM __tmp_srcs "${ONNX_ROOT}/onnx/cpp2py_export.cc")
-list(REMOVE_ITEM __tmp_srcs ${onnx_gtests_src})
-list(REMOVE_ITEM __tmp_srcs ${onnx_gtests_src} "${ONNX_ROOT}/onnx/test/cmake/main.cc")
-list(APPEND ONNX_SRCS ${__tmp_srcs})
+if(ONNX_MINIMAL_BUILD)
+ message(STATUS "Configuring ONNX minimal build")
Expand All @@ -41,54 +41,44 @@ index cc3ef140..f70312ba 100644
+ "${ONNX_ROOT}/onnx/backend/test/cpp/*.cc"
+ "${ONNX_ROOT}/onnx/backend/test/cpp/*.h")
+ list(REMOVE_ITEM __tmp_srcs "${ONNX_ROOT}/onnx/cpp2py_export.cc")
+ list(REMOVE_ITEM __tmp_srcs ${onnx_gtests_src})
+ list(REMOVE_ITEM __tmp_srcs ${onnx_gtests_src} "${ONNX_ROOT}/onnx/test/cmake/main.cc")
+ list(APPEND ONNX_SRCS ${__tmp_srcs})
+endif()

# Hide all symbols we don't need
set_target_properties(onnx_proto PROPERTIES CXX_VISIBILITY_PRESET hidden)
@@ -438,19 +453,6 @@ add_onnx_global_defines(onnx_proto)
target_include_directories(onnx_proto PUBLIC
$<BUILD_INTERFACE:${ONNX_ROOT}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
-if(MSVC)
- # For disabling Protobuf related warnings
- target_compile_options(onnx_proto PUBLIC
- /wd4146 # unary minus operator applied to unsigned type,
- # result still unsigned
- /wd4244 # 'argument': conversion from 'google::
- # protobuf::uint64' to 'int', possible
- # loss of data
- /wd4267 # Conversion from 'size_t' to 'int',
- # possible loss of data
- /wd4141 # 'inline': used more than once
- )
-endif()
set(LINKED_PROTOBUF_TARGET protobuf::libprotobuf)
if(ONNX_USE_LITE_PROTO)
diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake
index 07f2b9071..388d9f7a3 100644
--- a/cmake/Utils.cmake
+++ b/cmake/Utils.cmake
@@ -31,18 +31,7 @@ endfunction()

if(CMAKE_SYSTEM_NAME STREQUAL "AIX")
# whole-archive linker option not available on AIX.
function(add_onnx_compile_options target)
if(MSVC)
- # For disabling Protobuf related warnings
- set(protobuf_warnings
- /wd4146 # unary minus operator applied to unsigned type, result still
- # unsigned
- /wd4244 # 'argument': conversion from 'google::protobuf::uint64' to
- # 'int', possible loss of data
- /wd4267 # Conversion from 'size_t' to 'int', possible loss of data
- /wd4141 # 'inline': used more than once
- /wd4047 # '=': 'uintptr_t' differs in levels of indirection from 'void *'
- )
add_msvc_runtime_flag(${target})
- target_compile_options(${target} PUBLIC ${protobuf_warnings})
if(ONNX_WERROR)
target_compile_options(${target} PRIVATE "/WX")
endif()
diff --git a/onnx/defs/nn/old.cc b/onnx/defs/nn/old.cc
index ad6dd0c1..50259f32 100644
index 887151217..ac2e8c463 100644
--- a/onnx/defs/nn/old.cc
+++ b/onnx/defs/nn/old.cc
@@ -4091,7 +4091,6 @@ ONNX_OPERATOR_SET_SCHEMA(
@@ -4152,7 +4152,6 @@ ONNX_OPERATOR_SET_SCHEMA(
GroupNormalization,
18,
OpSchema()
- .Deprecate()
.SetDoc(GroupNormalization_ver18_doc)
.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 7e9bc27f..4b87c5a5 100644
--- a/onnx/defs/schema.h
+++ b/onnx/defs/schema.h
@@ -999,7 +999,7 @@ class OpSchemaRegistry final : public ISchemaRegistry {
class OpSchemaRegisterOnce final {
public:
// Export to cpp custom register macro
- explicit OpSchemaRegisterOnce(
+ OpSchemaRegisterOnce(
OpSchema op_schema,
int opset_version_to_load = 0,
bool fail_duplicate_schema = true) {
76 changes: 33 additions & 43 deletions cmake/vcpkg-ports/onnx/binskim.patch
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cc3ef140..f70312ba 100644
index 584c0419a..5d4ffff99 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,6 +57,7 @@ option(ONNX_USE_LITE_PROTO "Use lite protobuf instead of full." OFF)
@@ -52,6 +52,7 @@ option(ONNX_USE_LITE_PROTO "Use lite protobuf instead of full." OFF)
option(ONNX_DISABLE_EXCEPTIONS "Disable exception handling." OFF)
option(ONNX_DISABLE_STATIC_REGISTRATION "Disable static registration for ONNX operator schemas." OFF)
option(ONNX_USE_UNITY_BUILD "Enable Unity (Jumbo) build for" OFF)
+option(ONNX_MINIMAL_BUILD "Build only essential ONNX components" OFF)
if(WIN32)
option(ONNX_USE_MSVC_STATIC_RUNTIME "Build with MSVC static runtime" OFF)
endif()
@@ -409,14 +410,28 @@ relative_protobuf_generate_cpp(ONNX_PROTO_SRCS

add_library(onnx_proto ${ONNX_PROTO_SRCS})
@@ -397,14 +398,28 @@ relative_protobuf_generate_cpp(ONNX_PROTO_SRCS
onnx/onnx-operators.in.proto
onnx/onnx-data.in.proto)

-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"
- "${ONNX_ROOT}/onnx/backend/test/cpp/*.cc"
- "${ONNX_ROOT}/onnx/backend/test/cpp/*.h")
-list(REMOVE_ITEM __tmp_srcs "${ONNX_ROOT}/onnx/cpp2py_export.cc")
-list(REMOVE_ITEM __tmp_srcs ${onnx_gtests_src})
-list(REMOVE_ITEM __tmp_srcs ${onnx_gtests_src} "${ONNX_ROOT}/onnx/test/cmake/main.cc")
-list(APPEND ONNX_SRCS ${__tmp_srcs})
+if(ONNX_MINIMAL_BUILD)
+ message(STATUS "Configuring ONNX minimal build")
Expand All @@ -41,54 +41,44 @@ index cc3ef140..f70312ba 100644
+ "${ONNX_ROOT}/onnx/backend/test/cpp/*.cc"
+ "${ONNX_ROOT}/onnx/backend/test/cpp/*.h")
+ list(REMOVE_ITEM __tmp_srcs "${ONNX_ROOT}/onnx/cpp2py_export.cc")
+ list(REMOVE_ITEM __tmp_srcs ${onnx_gtests_src})
+ list(REMOVE_ITEM __tmp_srcs ${onnx_gtests_src} "${ONNX_ROOT}/onnx/test/cmake/main.cc")
+ list(APPEND ONNX_SRCS ${__tmp_srcs})
+endif()

# Hide all symbols we don't need
set_target_properties(onnx_proto PROPERTIES CXX_VISIBILITY_PRESET hidden)
@@ -438,19 +453,6 @@ add_onnx_global_defines(onnx_proto)
target_include_directories(onnx_proto PUBLIC
$<BUILD_INTERFACE:${ONNX_ROOT}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
-if(MSVC)
- # For disabling Protobuf related warnings
- target_compile_options(onnx_proto PUBLIC
- /wd4146 # unary minus operator applied to unsigned type,
- # result still unsigned
- /wd4244 # 'argument': conversion from 'google::
- # protobuf::uint64' to 'int', possible
- # loss of data
- /wd4267 # Conversion from 'size_t' to 'int',
- # possible loss of data
- /wd4141 # 'inline': used more than once
- )
-endif()
set(LINKED_PROTOBUF_TARGET protobuf::libprotobuf)
if(ONNX_USE_LITE_PROTO)
diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake
index 07f2b9071..388d9f7a3 100644
--- a/cmake/Utils.cmake
+++ b/cmake/Utils.cmake
@@ -31,18 +31,7 @@ endfunction()

if(CMAKE_SYSTEM_NAME STREQUAL "AIX")
# whole-archive linker option not available on AIX.
function(add_onnx_compile_options target)
if(MSVC)
- # For disabling Protobuf related warnings
- set(protobuf_warnings
- /wd4146 # unary minus operator applied to unsigned type, result still
- # unsigned
- /wd4244 # 'argument': conversion from 'google::protobuf::uint64' to
- # 'int', possible loss of data
- /wd4267 # Conversion from 'size_t' to 'int', possible loss of data
- /wd4141 # 'inline': used more than once
- /wd4047 # '=': 'uintptr_t' differs in levels of indirection from 'void *'
- )
add_msvc_runtime_flag(${target})
- target_compile_options(${target} PUBLIC ${protobuf_warnings})
if(ONNX_WERROR)
target_compile_options(${target} PRIVATE "/WX")
endif()
diff --git a/onnx/defs/nn/old.cc b/onnx/defs/nn/old.cc
index ad6dd0c1..50259f32 100644
index 887151217..ac2e8c463 100644
--- a/onnx/defs/nn/old.cc
+++ b/onnx/defs/nn/old.cc
@@ -4091,7 +4091,6 @@ ONNX_OPERATOR_SET_SCHEMA(
@@ -4152,7 +4152,6 @@ ONNX_OPERATOR_SET_SCHEMA(
GroupNormalization,
18,
OpSchema()
- .Deprecate()
.SetDoc(GroupNormalization_ver18_doc)
.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 7e9bc27f..4b87c5a5 100644
--- a/onnx/defs/schema.h
+++ b/onnx/defs/schema.h
@@ -999,7 +999,7 @@ class OpSchemaRegistry final : public ISchemaRegistry {
class OpSchemaRegisterOnce final {
public:
// Export to cpp custom register macro
- explicit OpSchemaRegisterOnce(
+ OpSchemaRegisterOnce(
OpSchema op_schema,
int opset_version_to_load = 0,
bool fail_duplicate_schema = true) {
8 changes: 4 additions & 4 deletions cmake/vcpkg-ports/onnx/fix-dependency-protobuf.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 47995579..1542b11f 100644
index 4a7df7d71..257d77e61 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -169,6 +169,7 @@ if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE)
@@ -159,6 +159,7 @@ if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()

Expand All @@ -11,14 +11,14 @@ index 47995579..1542b11f 100644
if(NOT ONNX_BUILD_CUSTOM_PROTOBUF)
if((ONNX_USE_LITE_PROTO AND TARGET protobuf::libprotobuf-lite) OR ((NOT ONNX_USE_LITE_PROTO) AND TARGET protobuf::libprotobuf))
diff --git a/cmake/ONNXConfig.cmake.in b/cmake/ONNXConfig.cmake.in
index a5129bfd..d450b51e 100644
index aa1ef47d9..d450b51e5 100644
--- a/cmake/ONNXConfig.cmake.in
+++ b/cmake/ONNXConfig.cmake.in
@@ -4,9 +4,8 @@
# library version information
set(ONNX_VERSION "@ONNX_VERSION@")

-if((NOT @@ONNX_USE_PROTOBUF_SHARED_LIBS@@) AND @@Build_Protobuf@@)
-if(NOT @ONNX_USE_PROTOBUF_SHARED_LIBS@)
- find_package(Protobuf REQUIRED CONFIG)
-endif()
+include(CMakeFindDependencyMacro)
Expand Down
2 changes: 1 addition & 1 deletion cmake/vcpkg-ports/onnx/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO onnx/onnx
REF "v${VERSION}"
SHA512 cf6ff4c0bb6cc16ce5f4d6267480d35f3c7a5fde94d10e1358928ff6e4ec6d756a7c5d34a500e60bbd8eb1912c8af21aa763719321b330f56a0eb6b9b810ef60
SHA512 4bbc4c09e4bb3eb6049d653ce49200564e8c5dcf1154a30f894f24e15f1986d1f2fe2f4ca32fe383c559e2a0b20681f33d649376bf63e4345df6972a2c78eac8
PATCHES
fix-cmakelists.patch
fix-dependency-protobuf.patch
Expand Down
2 changes: 1 addition & 1 deletion cmake/vcpkg-ports/onnx/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "onnx",
"version-semver": "1.19.1",
"version-semver": "1.20.1",
"port-version": 1,
"description": "Open standard for machine learning interoperability",
"homepage": "https://onnx.ai",
Expand Down
1 change: 1 addition & 0 deletions docs/How_To_Update_ONNX_Dev_Notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,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.
a. VCPKG relies these patches to build ONNX.
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/: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

Expand Down
Loading
Loading