Skip to content

Commit

Permalink
3
Browse files Browse the repository at this point in the history
  • Loading branch information
fs-eire committed Jan 26, 2024
1 parent 7fb9342 commit f920a7e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
3 changes: 3 additions & 0 deletions js/build_jsep.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ rem config Build configuration, "d" or "r"
rem threaded Build with threading support, "st" or "mt"
rem clean Perform a clean build, "clean" or empty

rem build --build_wasm --enable_wasm_simd --config Release --use_extensions --cmake_extra_defines onnxruntime_WEBASSEMBLY_DEFAULT_EXTENSION_FLAGS=ON
rem --cmake_extra_defines onnxruntime_ENABLE_WEBASSEMBLY_OUTPUT_OPTIMIZED_MODEL=1

setlocal enabledelayedexpansion

set ROOT=%~dp0..\
Expand Down
28 changes: 22 additions & 6 deletions tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,20 @@ jobs:
name: ${{ parameters.PoolName }}
variables:
buildArch: x64
CommonBuildArgs: '--parallel --config ${{ parameters.BuildConfig }} --skip_submodule_sync --build_wasm ${{ parameters.ExtraBuildArgs }}'

# command line arguments for all builds
ExtensionBuildArgs: '--use_extensions --cmake_extra_defines onnxruntime_WEBASSEMBLY_DEFAULT_EXTENSION_FLAGS=ON'
CommonBuildArgs: '--parallel --config ${{ parameters.BuildConfig }} --skip_submodule_sync --build_wasm $(ExtensionBuildArgs) ${{ parameters.ExtraBuildArgs }}'

# command line arguments for JSEP builds
JsepCommonBuildArgs: '--use_jsep --use_webnn --target onnxruntime_webassembly --skip_tests'
${{ if eq(parameters.BuildConfig, 'Debug') }}:
# Debug build
JsepBuildArgs: '$(JsepCommonBuildArgs) --cmake_extra_defines onnxruntime_ENABLE_WEBASSEMBLY_OUTPUT_OPTIMIZED_MODEL=1'
${{ else }}:
# Release build
JsepBuildArgs: '$(JsepCommonBuildArgs) --enable_wasm_api_exception_catching'

runCodesignValidationInjection: false
TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)]
ORT_CACHE_DIR: $(Agent.TempDirectory)/ort_ccache
Expand Down Expand Up @@ -80,6 +93,9 @@ jobs:
versionSpec: '3.8'
addToPath: true
architecture: $(buildArch)
- task: NodeTool@0
inputs:
versionSpec: '18.x'
- template: download-deps.yml

- task: PythonScript@0
Expand Down Expand Up @@ -136,7 +152,7 @@ jobs:
${{ else }}:
AdditionalKey: wasm_simd_threads | ${{ parameters.BuildConfig }}
CacheDir: $(ORT_CACHE_DIR)/wasm_simd_threads
Arguments: '$(CommonBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm_simd_threads --enable_wasm_simd --enable_wasm_threads --wasm_run_tests_in_browser'
Arguments: '$(CommonBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm_simd_threads --enable_wasm_simd --enable_wasm_threads --enable_wasm_native_eh --wasm_run_tests_in_browser'
DisplayName: 'Build and test (browser) (simd + threads)'
WithCache: ${{ parameters.WithCache }}

Expand All @@ -148,7 +164,7 @@ jobs:
${{ else }}:
AdditionalKey: wasm_simd | ${{ parameters.BuildConfig }}
CacheDir: $(ORT_CACHE_DIR)/wasm_simd
Arguments: '$(CommonBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm_simd --enable_wasm_simd'
Arguments: '$(CommonBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm_simd --enable_wasm_simd --enable_wasm_native_eh'
DisplayName: 'Build and test (node) (simd)'
WithCache: ${{ parameters.WithCache }}

Expand All @@ -161,7 +177,7 @@ jobs:
${{ else }}:
AdditionalKey: training_wasm_simd | ${{ parameters.BuildConfig }}
CacheDir: $(ORT_CACHE_DIR)/training_wasm_simd
Arguments: '$(CommonBuildArgs) --build_dir $(Build.BinariesDirectory)/training_wasm_simd --enable_training_apis --enable_wasm_simd --target onnxruntime_webassembly --skip_tests'
Arguments: '$(CommonBuildArgs) --build_dir $(Build.BinariesDirectory)/training_wasm_simd --enable_training_apis --enable_wasm_simd --enable_wasm_native_eh --target onnxruntime_webassembly --skip_tests'
DisplayName: 'Build (training + simd)'
WithCache: ${{ parameters.WithCache }}

Expand All @@ -174,7 +190,7 @@ jobs:
${{ else }}:
AdditionalKey: wasm_simd_jsep | ${{ parameters.BuildConfig }}
CacheDir: $(ORT_CACHE_DIR)/wasm_simd_jsep
Arguments: '$(CommonBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm_simd_jsep --enable_wasm_simd --use_jsep --use_webnn --target onnxruntime_webassembly --skip_tests'
Arguments: '$(CommonBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm_simd_jsep --enable_wasm_simd $(JsepBuildArgs)'
DisplayName: 'Build (simd + JSEP)'
WithCache: ${{ parameters.WithCache }}
- template: build-linux-wasm-step.yml
Expand All @@ -185,7 +201,7 @@ jobs:
${{ else }}:
AdditionalKey: wasm_simd_threads_jsep | ${{ parameters.BuildConfig }}
CacheDir: $(ORT_CACHE_DIR)/wasm_simd_threads_jsep
Arguments: '$(CommonBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm_simd_threads_jsep --enable_wasm_simd --enable_wasm_threads --use_jsep --use_webnn --target onnxruntime_webassembly --skip_tests'
Arguments: '$(CommonBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm_simd_threads_jsep --enable_wasm_simd --enable_wasm_threads $(JsepBuildArgs)'
DisplayName: 'Build (simd + threads + JSEP)'
WithCache: ${{ parameters.WithCache }}

Expand Down
4 changes: 2 additions & 2 deletions tools/ci_build/github/azure-pipelines/templates/web-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ stages:
parameters:
CommitOverride: true
BuildConfig: 'Debug'
ExtraBuildArgs: '--use_extensions --cmake_extra_defines onnxruntime_WEBASSEMBLY_DEFAULT_EXTENSION_FLAGS=ON ${{ parameters.ExtraBuildArgs }}'
ExtraBuildArgs: '${{ parameters.ExtraBuildArgs }}'
PoolName: ${{ parameters.PoolName }}
BuildJsep: ${{ parameters.BuildJsep }}
WithCache: ${{ parameters.WithCache }}
Expand Down Expand Up @@ -125,7 +125,7 @@ stages:
parameters:
CommitOverride: true
BuildConfig: 'Release'
ExtraBuildArgs: '--target onnxruntime_webassembly --skip_tests --enable_wasm_api_exception_catching --disable_rtti --use_extensions --cmake_extra_defines onnxruntime_WEBASSEMBLY_DEFAULT_EXTENSION_FLAGS=ON ${{ parameters.ExtraBuildArgs }}'
ExtraBuildArgs: '--disable_rtti ${{ parameters.ExtraBuildArgs }}'
PoolName: ${{ parameters.PoolName }}
BuildJsep: ${{ parameters.BuildJsep }}
WithCache: ${{ parameters.WithCache }}
Expand Down

0 comments on commit f920a7e

Please sign in to comment.