Skip to content

Commit 87a7ac0

Browse files
authored
Revert "Sync ORT main 16 07 25 (#744)" (#745)
This reverts commit bc3dc45.
1 parent bc3dc45 commit 87a7ac0

File tree

174 files changed

+877
-3985
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+877
-3985
lines changed

.github/workflows/windows_webgpu.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ jobs:
2222
strategy:
2323
matrix:
2424
vcpkg_option: [novcpkg, vcpkg]
25-
wgsl_template: [static, dynamic]
2625
env:
2726
OrtPackageId: Microsoft.ML.OnnxRuntime
2827
OnnxRuntimeBuildDirectory: ${{ github.workspace }}
@@ -124,7 +123,6 @@ jobs:
124123
--build_nodejs `
125124
--build_java `
126125
--use_webgpu `
127-
--wgsl_template ${{ matrix.wgsl_template }} `
128126
${{ matrix.vcpkg_option == 'vcpkg' && '--use_vcpkg' || '' }} `
129127
--cmake_extra_defines `
130128
onnxruntime_BUILD_UNIT_TESTS=ON `

cmake/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ option(onnxruntime_DISABLE_SPARSE_TENSORS "Disable sparse tensors data types" OF
151151
option(onnxruntime_DISABLE_OPTIONAL_TYPE "Disable optional type" OFF)
152152
option(onnxruntime_DISABLE_FLOAT8_TYPES "Disable float 8 types" OFF)
153153
option(onnxruntime_MINIMAL_BUILD "Exclude as much as possible from the build. Support ORT format models. No support for ONNX format models." OFF)
154-
option(onnxruntime_CLIENT_PACKAGE_BUILD "Enables default settings that are more appropriate for client/on-device workloads." OFF)
155154
cmake_dependent_option(onnxruntime_DISABLE_RTTI "Disable RTTI" ON "NOT onnxruntime_ENABLE_PYTHON;NOT onnxruntime_USE_CUDA" OFF)
156155
# For now onnxruntime_DISABLE_EXCEPTIONS will only work with onnxruntime_MINIMAL_BUILD, more changes (ONNX, non-CPU EP, ...) are required to run this standalone
157156
cmake_dependent_option(onnxruntime_DISABLE_EXCEPTIONS "Disable exception handling. Requires onnxruntime_MINIMAL_BUILD currently." ON "onnxruntime_MINIMAL_BUILD;NOT onnxruntime_ENABLE_PYTHON" OFF)

cmake/adjust_global_compile_flags.cmake

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@ if (onnxruntime_MINIMAL_BUILD)
9595
endif()
9696
endif()
9797

98-
# ORT build with default settings more appropriate for client/on-device workloads.
99-
if (onnxruntime_CLIENT_PACKAGE_BUILD)
100-
add_compile_definitions(ORT_CLIENT_PACKAGE_BUILD)
101-
endif()
102-
10398
if (onnxruntime_ENABLE_LTO)
10499
include(CheckIPOSupported)
105100
check_ipo_supported(RESULT ipo_enabled OUTPUT ipo_output)

cmake/external/onnxruntime_external_deps.cmake

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -774,24 +774,13 @@ if (onnxruntime_USE_WEBGPU)
774774
endif()
775775

776776
if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten" AND onnxruntime_WGSL_TEMPLATE STREQUAL "dynamic")
777-
if(onnxruntime_USE_VCPKG)
778-
find_package(unofficial-duktape CONFIG REQUIRED)
779-
add_library(duktape_static ALIAS unofficial::duktape::duktape)
780-
else()
781-
onnxruntime_fetchcontent_declare(
782-
duktape
783-
URL ${DEP_URL_duktape}
784-
URL_HASH SHA1=${DEP_SHA1_duktape}
785-
EXCLUDE_FROM_ALL
786-
)
787-
onnxruntime_fetchcontent_makeavailable(duktape)
788-
789-
if(NOT TARGET duktape_static)
790-
add_library(duktape_static STATIC "${duktape_SOURCE_DIR}/src/duktape.c")
791-
target_compile_features(duktape_static PRIVATE c_std_99)
792-
target_include_directories(duktape_static INTERFACE $<BUILD_INTERFACE:${duktape_SOURCE_DIR}/src>)
793-
endif()
794-
endif()
777+
onnxruntime_fetchcontent_declare(
778+
duktape
779+
URL ${DEP_URL_duktape}
780+
URL_HASH SHA1=${DEP_SHA1_duktape}
781+
EXCLUDE_FROM_ALL
782+
)
783+
onnxruntime_fetchcontent_makeavailable(duktape)
795784
endif()
796785
endif()
797786

cmake/onnxruntime_mlas.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ onnxruntime_add_static_library(onnxruntime_mlas
3131
${MLAS_SRC_DIR}/eltwise.cpp
3232
${MLAS_SRC_DIR}/erf.cpp
3333
${MLAS_SRC_DIR}/compute.cpp
34-
${MLAS_SRC_DIR}/dequantize.cpp
3534
${MLAS_SRC_DIR}/quantize.cpp
3635
${MLAS_SRC_DIR}/qgemm_kernel_default.cpp
3736
${MLAS_SRC_DIR}/qladd.cpp

cmake/onnxruntime_providers_tensorrt.cmake

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,26 @@
7272
endif()
7373

7474
# TensorRT 10 GA onwards, the TensorRT libraries will have major version appended to the end on Windows,
75-
# for example, nvinfer_10.dll, nvonnxparser_10.dll ...
75+
# for example, nvinfer_10.dll, nvinfer_plugin_10.dll, nvonnxparser_10.dll ...
7676
if (WIN32 AND TRT_GREATER_OR_EQUAL_TRT_10_GA)
7777
set(NVINFER_LIB "nvinfer_${NV_TENSORRT_MAJOR}")
78+
set(NVINFER_PLUGIN_LIB "nvinfer_plugin_${NV_TENSORRT_MAJOR}")
7879
set(PARSER_LIB "nvonnxparser_${NV_TENSORRT_MAJOR}")
7980
endif()
8081

8182
if (NOT NVINFER_LIB)
8283
set(NVINFER_LIB "nvinfer")
8384
endif()
8485

86+
if (NOT NVINFER_PLUGIN_LIB)
87+
set(NVINFER_PLUGIN_LIB "nvinfer_plugin")
88+
endif()
89+
8590
if (NOT PARSER_LIB)
8691
set(PARSER_LIB "nvonnxparser")
8792
endif()
8893

89-
MESSAGE(STATUS "Looking for ${NVINFER_LIB}")
94+
MESSAGE(STATUS "Looking for ${NVINFER_LIB} and ${NVINFER_PLUGIN_LIB}")
9095

9196
find_library(TENSORRT_LIBRARY_INFER ${NVINFER_LIB}
9297
HINTS ${TENSORRT_ROOT}
@@ -96,6 +101,14 @@
96101
MESSAGE(STATUS "Can't find ${NVINFER_LIB}")
97102
endif()
98103

104+
find_library(TENSORRT_LIBRARY_INFER_PLUGIN ${NVINFER_PLUGIN_LIB}
105+
HINTS ${TENSORRT_ROOT}
106+
PATH_SUFFIXES lib lib64 lib/x64)
107+
108+
if (NOT TENSORRT_LIBRARY_INFER_PLUGIN)
109+
MESSAGE(STATUS "Can't find ${NVINFER_PLUGIN_LIB}")
110+
endif()
111+
99112
if (onnxruntime_USE_TENSORRT_BUILTIN_PARSER)
100113
MESSAGE(STATUS "Looking for ${PARSER_LIB}")
101114

@@ -107,7 +120,7 @@
107120
MESSAGE(STATUS "Can't find ${PARSER_LIB}")
108121
endif()
109122

110-
set(TENSORRT_LIBRARY ${TENSORRT_LIBRARY_INFER} ${TENSORRT_LIBRARY_NVONNXPARSER})
123+
set(TENSORRT_LIBRARY ${TENSORRT_LIBRARY_INFER} ${TENSORRT_LIBRARY_INFER_PLUGIN} ${TENSORRT_LIBRARY_NVONNXPARSER})
111124
MESSAGE(STATUS "Find TensorRT libs at ${TENSORRT_LIBRARY}")
112125
else()
113126
if (TRT_GREATER_OR_EQUAL_TRT_10_GA)
@@ -140,15 +153,15 @@
140153
endif()
141154
# Static libraries are just nvonnxparser_static on all platforms
142155
set(onnxparser_link_libs nvonnxparser_static)
143-
set(TENSORRT_LIBRARY ${TENSORRT_LIBRARY_INFER})
156+
set(TENSORRT_LIBRARY ${TENSORRT_LIBRARY_INFER} ${TENSORRT_LIBRARY_INFER_PLUGIN})
144157
MESSAGE(STATUS "Find TensorRT libs at ${TENSORRT_LIBRARY}")
145158
endif()
146159

147160
# ${TENSORRT_LIBRARY} is empty if we link nvonnxparser_static.
148161
# nvonnxparser_static is linked against tensorrt libraries in onnx-tensorrt
149162
# See https://github.com/onnx/onnx-tensorrt/blob/8af13d1b106f58df1e98945a5e7c851ddb5f0791/CMakeLists.txt#L121
150163
# However, starting from TRT 10 GA, nvonnxparser_static doesn't link against tensorrt libraries.
151-
# Therefore, the above code finds ${TENSORRT_LIBRARY_INFER}.
164+
# Therefore, the above code finds ${TENSORRT_LIBRARY_INFER} and ${TENSORRT_LIBRARY_INFER_PLUGIN}.
152165
if(onnxruntime_CUDA_MINIMAL)
153166
set(trt_link_libs ${CMAKE_DL_LIBS} ${TENSORRT_LIBRARY})
154167
else()

cmake/onnxruntime_providers_webgpu.cmake

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,10 @@
172172
file(MAKE_DIRECTORY ${WGSL_GENERATED_DIR})
173173

174174
# Find all WGSL template input files
175-
file(GLOB_RECURSE WGSL_TEMPLATE_FILES
176-
"${ONNXRUNTIME_ROOT}/core/providers/webgpu/*.wgsl.template"
177-
"${ONNXRUNTIME_ROOT}/contrib_ops/webgpu/*.wgsl.template")
175+
file(GLOB_RECURSE WGSL_TEMPLATE_FILES "${ONNXRUNTIME_ROOT}/core/providers/webgpu/*.wgsl.template")
178176

179177
# Set wgsl-gen command line options as a list
180-
set(WGSL_GEN_OPTIONS "-i" "${ONNXRUNTIME_ROOT}/core/providers/webgpu/" "-i" "${ONNXRUNTIME_ROOT}/contrib_ops/webgpu/" "--output" "${WGSL_GENERATED_DIR}" "-I" "wgsl_template_gen/" "--preserve-code-ref" "--verbose")
178+
set(WGSL_GEN_OPTIONS "-i" "../" "--output" "${WGSL_GENERATED_DIR}" "-I" "wgsl_template_gen/" "--preserve-code-ref" "--verbose")
181179
if (onnxruntime_WGSL_TEMPLATE STREQUAL "static")
182180
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
183181
list(APPEND WGSL_GEN_OPTIONS "--generator" "static-cpp-literal")
@@ -209,9 +207,10 @@
209207
# Add the generated directory to include paths
210208
target_include_directories(onnxruntime_providers_webgpu PRIVATE ${WGSL_GENERATED_ROOT})
211209
elseif(onnxruntime_WGSL_TEMPLATE STREQUAL "dynamic")
210+
add_library(duktape_static STATIC "${duktape_SOURCE_DIR}/src/duktape.c")
211+
target_compile_features(duktape_static PRIVATE c_std_99)
212212
target_link_libraries(onnxruntime_providers_webgpu duktape_static)
213-
onnxruntime_add_include_to_target(onnxruntime_providers_webgpu duktape_static)
214-
213+
target_include_directories(onnxruntime_providers_webgpu PRIVATE ${duktape_SOURCE_DIR}/src)
215214
# Define the path to the generated templates.js file
216215
target_compile_definitions(onnxruntime_providers_webgpu PRIVATE
217216
"ORT_WGSL_TEMPLATES_JS_PATH=\"${WGSL_GENERATED_TEMPLATES_JS}\"")

cmake/vcpkg.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"ms-gsl",
4444
"nlohmann-json",
4545
"onnx",
46+
"optional-lite",
4647
{
4748
"name": "protobuf",
4849
"version>=": "3.21.12"
@@ -93,10 +94,6 @@
9394
"webgpu-ep": {
9495
"description": "Build with WebGPU EP",
9596
"dependencies": []
96-
},
97-
"webgpu-ep-wgsl-template-dynamic": {
98-
"description": "Build with WebGPU EP with dynamic WGSL template code generator",
99-
"dependencies": ["duktape"]
10097
}
10198
},
10299
"overrides": [
@@ -107,10 +104,6 @@
107104
{
108105
"name": "flatbuffers",
109106
"version": "23.5.26"
110-
},
111-
{
112-
"name": "duktape",
113-
"version": "2.7.0#2"
114107
}
115108
]
116109
}

csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests.Mobile/EndToEndTests.Mobile.Automation/Tests.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,10 @@ public void RunPlatformUnitTest()
4040
var serializedResultSummary = _app.Invoke(_getResultsBackdoorMethodName)?.ToString();
4141
Assert.IsNotEmpty(serializedResultSummary, "Test results were not returned");
4242

43-
// Fix security issue (overflow with too much nesting): GHSA-5crp-9r3c-p9vr
44-
JsonConvert.DefaultSettings = () => new JsonSerializerSettings { MaxDepth = 128 };
4543
var testSummary = JsonConvert.DeserializeObject<TestResultSummary>(serializedResultSummary);
4644
Assert.AreEqual(testSummary.Failed, 0, $"{testSummary.Failed} tests failed");
4745

4846
_app.Screenshot("Post-testing");
4947
}
5048
}
51-
}
49+
}

csharp/test/Microsoft.ML.OnnxRuntime.Tests.Devices/TestResultProcessor.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ public TestResultSummary GetResults()
4545
public string GetSerializedResults()
4646
{
4747
var resultSummary = GetResults();
48-
JsonConvert.DefaultSettings = () => new JsonSerializerSettings { MaxDepth = 128 };
4948
var serializedResultSummary = JsonConvert.SerializeObject(resultSummary, Formatting.Indented);
5049
return serializedResultSummary;
5150
}
5251
}
53-
}
52+
}

0 commit comments

Comments
 (0)