-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade emsdk version to v4.0.3 (#23633)
### Description Upgrade EMSDK to v4.0.3 ### File Size Comparison: Baseline: e666503 [[Build]](https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=1613209) This change: bb9f747 [[Build]](https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=1613180) |File | Baseline | This Change | Diff | |--|--|---|---| | ort-wasm-simd-threaded.jsep.mjs | 49,240 | 44,230 | -5,010 | | ort-wasm-simd-threaded.jsep.wasm | 22,921,505 | 21,236,866 | -1,684,639 | | ort-wasm-simd-threaded.mjs | 25,539 | 20,890 | -4,649 | | ort-wasm-simd-threaded.wasm | 11,771,161 | 10,942,193 | -828,968 | | ort.min.mjs | 345,608 | 345,608 | 0 | | ort.bundle.min.mjs | 392,960 | 388,426 | -4,534 | ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> - EMSDK 3.1.62-3.1.74 is not working because of an linker issue (wasm-ld) that causes out-of-memory or crash. - EMSDK > 3.1.69 requires a change as a post-process of the generated JS file otherwise it will fails onnxruntime-web (as a NPM package) to be consumed in user's web application because of an unexpected webpack behavior. - EMSDK >= 4.0.1 fixes the out-of-memory issue but brought new issues causes build break of an indirect dependency of ORT (ORT -> ORT-extensions -> dlib). - EMSDK 4.0.3 introduces a change that allows a previous workaround to be removed. In this PR, all of the above issues are addressed: - the linker issue (wasm-ld) is fixed in 4.0.1+ - the post-process is added in `onnxruntime_webassembly.cmake` as a `POST_BUILD` event of target `onnxruntime_webassembly`. It's done by a Node.js script that uses Regex match and replace. - `dlib` not working with EMSDK v4: - the issue is tracked at davisking/dlib#3045 - Currently no active user is using ORT extension. In this PR, removed ORT extension from the build. - file `gen_struct_info.py` is moved from `${DAWN_EMSCRIPTEN_TOOLCHAIN}/tools/maint` to `${DAWN_EMSCRIPTEN_TOOLCHAIN}/tools`. This helped to remove the patch.tgz for emscripten. This change also requires a change in Dawn, so patched the change needed for Dawn in this PR.
- Loading branch information
Showing
8 changed files
with
94 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule emsdk
updated
43 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
diff --git a/src/emdawnwebgpu/CMakeLists.txt b/src/emdawnwebgpu/CMakeLists.txt | ||
index 6e8ae37593..633af91eef 100644 | ||
--- a/src/emdawnwebgpu/CMakeLists.txt | ||
+++ b/src/emdawnwebgpu/CMakeLists.txt | ||
@@ -77,9 +77,17 @@ if (${DAWN_ENABLE_EMSCRIPTEN}) | ||
"${arg_UNPARSED_ARGUMENTS}") | ||
endif() | ||
|
||
+ # since Emscripten 4.0.3, file gen_struct_info.py is moved to outside of directory maint. | ||
+ if (EXISTS "${DAWN_EMSCRIPTEN_TOOLCHAIN}/tools/gen_struct_info.py") | ||
+ set(EM_GEN_STRUCT_INFO_SCRIPT "${DAWN_EMSCRIPTEN_TOOLCHAIN}/tools/gen_struct_info.py") | ||
+ elseif (EXISTS "${DAWN_EMSCRIPTEN_TOOLCHAIN}/tools/maint/gen_struct_info.py") | ||
+ set(EM_GEN_STRUCT_INFO_SCRIPT "${DAWN_EMSCRIPTEN_TOOLCHAIN}/tools/maint/gen_struct_info.py") | ||
+ else() | ||
+ message(FATAL_ERROR "Dawn: Failed to locate file gen_struct_info.py from Emscripten.") | ||
+ endif() | ||
set(ARGS | ||
${Python3_EXECUTABLE} | ||
- "${DAWN_EMSCRIPTEN_TOOLCHAIN}/tools/maint/gen_struct_info.py" | ||
+ "${EM_GEN_STRUCT_INFO_SCRIPT}" | ||
-q | ||
"${EM_BUILD_GEN_DIR}/struct_info_webgpu.json" | ||
"-I=${EM_BUILD_GEN_DIR}/include" |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters