Skip to content

Commit 57ddd02

Browse files
authored
Add DNNL github workflow (#24011)
### Description Add DNNL github workflow which is migrated from "Windows CPU CI pipeline" from Azure DevOps. This PR also adds "--build_nuget" to test the C# part. However, then I hit an error when building the tests in "test\Microsoft.ML.OnnxRuntime.Tests.NetCoreApp\Microsoft.ML.OnnxRuntime.Tests.NetCoreApp.csproj". The error message was: ``` D:\a\_work\onnxruntime\onnxruntime\csharp\test\Microsoft.ML.OnnxRuntime.Tests.Common\TrainingTest.cs(34,81): error CS0103: The name 'CheckpointState' does not exist in the current context [D:\a\_work\onnxruntime\onnxruntime\csharp\test\Microsoft.ML.OnnxRuntime.Tests.NetCoreApp\Microsoft.ML.OnnxRuntime.Tests.NetCoreApp.csproj] ``` Then I checked the code. I couldn't understand how it worked before. In this build, `__TRAINING_ENABLED_NATIVE_BUILD__` is not defined. But the "CheckpointState" class is defined in https://github.com/microsoft/onnxruntime/blob/main/csharp/src/Microsoft.ML.OnnxRuntime/Training/CheckpointState.shared.cs#L21 And the file is empty when __TRAINING_ENABLED_NATIVE_BUILD__ is not defined. So I don't understand how it could work in a normal build without dnnl. Here is my build command: ``` python tools\ci_build\build.py --config RelWithDebInfo --build_dir dnnlbuild --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --build_wheel --msbuild_extra_options "IncludeMobileTargets=false" --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache --use_dnnl ``` This PR removes the failed test.
1 parent 5e05729 commit 57ddd02

13 files changed

+173
-58
lines changed

.github/workflows/ios.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: macos-13
1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919
with:
2020
submodules: false
2121
- name: Use Xcode ${{ env.XCODE_VERSION }}

.github/workflows/mac.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: macos-13
2424
steps:
2525
- name: Checkout repository
26-
uses: actions/checkout@v3
26+
uses: actions/checkout@v4
2727
with:
2828
submodules: false
2929

.github/workflows/macos_coreml.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
steps:
2424
- name: Checkout code
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626

2727
- name: Install coreutils and ninja
2828
run: brew install coreutils ninja

.github/workflows/windows_build_x64_asan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818

1919
steps:
2020
- name: Checkout repository
21-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
2222
with:
2323
submodules: false
2424

2525
- name: Setup Python
26-
uses: actions/setup-python@v4
26+
uses: actions/setup-python@v5
2727
with:
2828
python-version: '3.12'
2929
architecture: x64

.github/workflows/windows_x64_debug_build_x64_debug.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ jobs:
1717

1818
steps:
1919
- name: Checkout repository
20-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2121
with:
2222
submodules: false
2323

2424
- name: Setup Python
25-
uses: actions/setup-python@v4
25+
uses: actions/setup-python@v5
2626
with:
2727
python-version: '3.12'
2828
architecture: x64
@@ -37,12 +37,12 @@ jobs:
3737
run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt"
3838

3939
- name: Setup Node.js
40-
uses: actions/setup-node@v3
40+
uses: actions/setup-node@v4
4141
with:
4242
node-version: '20.x'
4343

4444
- name: Setup Java
45-
uses: actions/setup-java@v3
45+
uses: actions/setup-java@v4
4646
with:
4747
distribution: 'temurin'
4848
java-version: '17'
@@ -59,14 +59,14 @@ jobs:
5959
working-directory: ${{ github.workspace }}
6060

6161
- name: Use .NET 8.x
62-
uses: actions/setup-dotnet@v3
62+
uses: actions/setup-dotnet@v4
6363
with:
6464
dotnet-version: '8.x'
6565
env:
6666
PROCESSOR_ARCHITECTURE: x64
6767

6868
- name: Use Nuget 6.x
69-
uses: nuget/setup-nuget@v1 # Use the official NuGet setup action
69+
uses: nuget/setup-nuget@v2 # Use the official NuGet setup action
7070
with:
7171
nuget-version: '6.x'
7272

.github/workflows/windows_x64_release_build_x64_release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ jobs:
1717

1818
steps:
1919
- name: Checkout repository
20-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2121
with:
2222
submodules: false
2323

2424
- name: Setup Python
25-
uses: actions/setup-python@v4
25+
uses: actions/setup-python@v5
2626
with:
2727
python-version: '3.12'
2828
architecture: x64
@@ -37,12 +37,12 @@ jobs:
3737
run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt"
3838

3939
- name: Setup Node.js
40-
uses: actions/setup-node@v3
40+
uses: actions/setup-node@v4
4141
with:
4242
node-version: '20.x'
4343

4444
- name: Setup Java
45-
uses: actions/setup-java@v3
45+
uses: actions/setup-java@v4
4646
with:
4747
distribution: 'temurin'
4848
java-version: '17'
@@ -59,14 +59,14 @@ jobs:
5959
working-directory: ${{ github.workspace }}
6060

6161
- name: Use .NET 8.x
62-
uses: actions/setup-dotnet@v3
62+
uses: actions/setup-dotnet@v4
6363
with:
6464
dotnet-version: '8.x'
6565
env:
6666
PROCESSOR_ARCHITECTURE: x64
6767

6868
- name: Use Nuget 6.x
69-
uses: nuget/setup-nuget@v1
69+
uses: nuget/setup-nuget@v2
7070
with:
7171
nuget-version: '6.x'
7272

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: windows_x64_dnnl_release
2+
3+
on:
4+
push:
5+
branches: [ main, 'rel-*']
6+
pull_request:
7+
branches: [ main ]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build_x64_dnnl_release:
15+
runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"]
16+
timeout-minutes: 300
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
submodules: false
23+
24+
- name: Setup Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.12'
28+
architecture: x64
29+
30+
- name: Locate vcvarsall and Setup Env
31+
uses: ./.github/actions/locate-vcvarsall-and-setup-env
32+
with:
33+
architecture: x64
34+
35+
- name: Install python modules
36+
shell: cmd
37+
run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt"
38+
39+
- name: Setup Node.js
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: '20.x'
43+
44+
- name: Setup Java
45+
uses: actions/setup-java@v4
46+
with:
47+
distribution: 'temurin'
48+
java-version: '17'
49+
architecture: x64
50+
51+
- name: API Documentation Check and generate
52+
shell: cmd
53+
run: |
54+
set ORT_DOXY_SRC=${{ github.workspace }}
55+
set ORT_DOXY_OUT=${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo
56+
mkdir %ORT_DOXY_SRC%
57+
mkdir %ORT_DOXY_OUT%
58+
"C:\Program Files\doxygen\bin\doxygen.exe" ${{ github.workspace }}\tools\ci_build\github\Doxyfile_csharp.cfg
59+
working-directory: ${{ github.workspace }}
60+
61+
- name: Use .NET 8.x
62+
uses: actions/setup-dotnet@v4
63+
with:
64+
dotnet-version: '8.x'
65+
env:
66+
PROCESSOR_ARCHITECTURE: x64
67+
68+
- name: Use Nuget 6.x
69+
uses: nuget/setup-nuget@v2
70+
with:
71+
nuget-version: '6.x'
72+
73+
- name: NuGet restore
74+
shell: cmd
75+
run: |
76+
nuget restore ${{ github.workspace }}\packages.config -PackagesDirectory ${{ github.workspace }}\build\RelWithDebInfo -ConfigFile ${{ github.workspace }}\NuGet.config
77+
78+
- name: Export GitHub Actions cache environment variables
79+
uses: actions/github-script@v7
80+
with:
81+
script: |
82+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
83+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
84+
85+
- name: Build and Test
86+
shell: pwsh
87+
run: |
88+
python.exe "${{ github.workspace }}\tools\ci_build\build.py" --config RelWithDebInfo --build_dir "${{ github.workspace }}\build" --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --build_wheel --build_java --build_nodejs --msbuild_extra_options "IncludeMobileTargets=false" --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache --use_dnnl
89+
if ($LASTEXITCODE -ne 0) {
90+
exit $LASTEXITCODE
91+
}
92+
Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse
93+
env:
94+
ALLOW_RELEASED_ONNX_OPSET_ONLY: '0'
95+
96+
- name: Validate C# native delegates
97+
shell: cmd
98+
run: python tools\ValidateNativeDelegateAttributes.py
99+
working-directory: ${{ github.workspace }}\\csharp
100+
101+
- name: Install onnxruntime wheel
102+
shell: pwsh
103+
run: |
104+
python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq
105+
Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname}
106+
working-directory: "${{ github.workspace }}\\build\\RelWithDebInfo\\RelWithDebInfo"
107+
108+
- name: Publish OperatorKernels.md (Conditional)
109+
uses: actions/upload-artifact@v4
110+
if: failure() && env.DocUpdateNeeded == 'true'
111+
with:
112+
name: OperatorKernels.md
113+
path: ${{ github.workspace }}/docs/OperatorKernels.md
114+
115+
- name: Publish ContribOperators.md (Conditional)
116+
uses: actions/upload-artifact@v4
117+
if: failure() && env.DocUpdateNeeded == 'true'
118+
with:
119+
name: ContribOperators.md
120+
path: ${{ github.workspace }}/docs/ContribOperators.md
121+
122+
env:
123+
OrtPackageId: Microsoft.ML.OnnxRuntime
124+
OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build
125+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true'

.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ jobs:
1717

1818
steps:
1919
- name: Checkout repository
20-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2121
with:
2222
submodules: false
2323

2424
- name: Setup Python
25-
uses: actions/setup-python@v4
25+
uses: actions/setup-python@v5
2626
with:
2727
python-version: '3.12'
2828
architecture: x64
@@ -37,12 +37,12 @@ jobs:
3737
run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt"
3838

3939
- name: Setup Node.js
40-
uses: actions/setup-node@v3
40+
uses: actions/setup-node@v4
4141
with:
4242
node-version: '20.x'
4343

4444
- name: Setup Java
45-
uses: actions/setup-java@v3
45+
uses: actions/setup-java@v4
4646
with:
4747
distribution: 'temurin'
4848
java-version: '17'
@@ -59,14 +59,14 @@ jobs:
5959
working-directory: ${{ github.workspace }}
6060

6161
- name: Use .NET 8.x
62-
uses: actions/setup-dotnet@v3
62+
uses: actions/setup-dotnet@v4
6363
with:
6464
dotnet-version: '8.x'
6565
env:
6666
PROCESSOR_ARCHITECTURE: x64
6767

6868
- name: Use Nuget 6.x
69-
uses: nuget/setup-nuget@v1
69+
uses: nuget/setup-nuget@v2
7070
with:
7171
nuget-version: '6.x'
7272

.github/workflows/windows_x64_release_vitisai_build_x64_release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ jobs:
1717

1818
steps:
1919
- name: Checkout repository
20-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2121
with:
2222
submodules: false
2323

2424
- name: Setup Python
25-
uses: actions/setup-python@v4
25+
uses: actions/setup-python@v5
2626
with:
2727
python-version: '3.12'
2828
architecture: x64
@@ -37,12 +37,12 @@ jobs:
3737
run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt"
3838

3939
- name: Setup Node.js
40-
uses: actions/setup-node@v3
40+
uses: actions/setup-node@v4
4141
with:
4242
node-version: '20.x'
4343

4444
- name: Setup Java
45-
uses: actions/setup-java@v3
45+
uses: actions/setup-java@v4
4646
with:
4747
distribution: 'temurin'
4848
java-version: '17'
@@ -59,14 +59,14 @@ jobs:
5959
working-directory: ${{ github.workspace }}
6060

6161
- name: Use .NET 8.x
62-
uses: actions/setup-dotnet@v3
62+
uses: actions/setup-dotnet@v4
6363
with:
6464
dotnet-version: '8.x'
6565
env:
6666
PROCESSOR_ARCHITECTURE: x64
6767

6868
- name: Use Nuget 6.x
69-
uses: nuget/setup-nuget@v1
69+
uses: nuget/setup-nuget@v2
7070
with:
7171
nuget-version: '6.x'
7272

0 commit comments

Comments
 (0)