Skip to content

Commit 28ea0dd

Browse files
committed
Add CI for DML backend
1 parent 294de6b commit 28ea0dd

File tree

4 files changed

+364
-13
lines changed

4 files changed

+364
-13
lines changed
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: DirectML backend (Windows)
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
7+
job:
8+
9+
runs-on: windows-2019
10+
11+
steps:
12+
- name: Git config
13+
run: |
14+
git config --global core.autocrlf false
15+
git config --global core.eol lf
16+
17+
- name: Install depot_tools
18+
shell: cmd
19+
run: |
20+
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git ..\depot_tools
21+
set "PATH=%CD%\..\depot_tools;%PATH%"
22+
gclient
23+
24+
- name: Set up Python 3.x
25+
uses: actions/setup-python@v2
26+
with:
27+
python-version: '3.x'
28+
29+
- uses: actions/checkout@v2
30+
with:
31+
ref: main
32+
path: baseline
33+
fetch-depth: 0
34+
35+
- name: Update DEPS for main branch
36+
shell: pwsh
37+
run: |
38+
cd baseline
39+
(Get-Content -path .\DEPS -Raw) -replace "'checkout_onnxruntime': True", "'checkout_onnxruntime': False" | Set-Content -path .\DEPS
40+
(Get-Content -path .\DEPS -Raw) -replace "'checkout_samples': True", "'checkout_samples': False" | Set-Content -path .\DEPS
41+
42+
- name: Sync code for main branch
43+
shell: cmd
44+
run: |
45+
set "PATH=%CD%\..\depot_tools;%PATH%"
46+
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
47+
cd baseline
48+
copy scripts\standalone.gclient .gclient
49+
gclient sync
50+
51+
- name: Generate project for main branch
52+
shell: cmd
53+
run: |
54+
set "PATH=%CD%\..\depot_tools;%PATH%"
55+
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
56+
cd baseline
57+
gn gen out\Release --args="webnn_enable_dml=true is_debug=false gpgmm_enable_device_checks=true"
58+
59+
- name: Build for main branch
60+
shell: cmd
61+
run: |
62+
set "PATH=%CD%\..\depot_tools;%PATH%"
63+
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
64+
cd baseline
65+
ninja -C out\Release
66+
67+
- name: Test for main branch
68+
shell: cmd
69+
run: |
70+
cd baseline
71+
echo "Run End2End Tests..."
72+
out\Release\webnn_end2end_tests.exe --gtest_output=json:${{ github.workspace }}\..\baseline_end2endtests.json
73+
cd ..
74+
rmdir /s /q baseline
75+
76+
- uses: actions/checkout@v2
77+
with:
78+
path: update
79+
fetch-depth: 0
80+
81+
- name: Update DEPS for update branch
82+
shell: pwsh
83+
run: |
84+
cd update
85+
(Get-Content -path .\DEPS -Raw) -replace "'checkout_onnxruntime': True", "'checkout_onnxruntime': False" | Set-Content -path .\DEPS
86+
(Get-Content -path .\DEPS -Raw) -replace "'checkout_samples': True", "'checkout_samples': False" | Set-Content -path .\DEPS
87+
88+
- name: Sync latest code
89+
shell: cmd
90+
run: |
91+
set "PATH=%CD%\..\depot_tools;%PATH%"
92+
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
93+
cd update
94+
copy scripts\standalone.gclient .gclient
95+
gclient sync
96+
97+
- name: Generate project for update branch
98+
shell: cmd
99+
run: |
100+
set "PATH=%CD%\..\depot_tools;%PATH%"
101+
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
102+
cd update
103+
gn gen out\Release --args="webnn_enable_dml=true webnn_enable_wire=true is_debug=false gpgmm_enable_device_checks=true"
104+
105+
- name: Build for update branch
106+
shell: cmd
107+
run: |
108+
set "PATH=%CD%\..\depot_tools;%PATH%"
109+
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
110+
cd update
111+
ninja -C out\Release
112+
113+
- name: Test for update branch
114+
shell: cmd
115+
run: |
116+
cd update
117+
echo "Run End2End Tests..."
118+
out\Release\webnn_end2end_tests.exe --gtest_output=json:${{ github.workspace }}\..\update_end2endtests.json || true
119+
120+
- name: Regression check
121+
run: |
122+
echo "Regression checking..."
123+
python update\workflow_scripts\regression_check.py ${{ github.workspace }}\..\baseline_end2endtests.json ${{ github.workspace }}\..\update_end2endtests.json
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
name: Node Binding (DirectML backend / Windows)
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
7+
job:
8+
9+
runs-on: windows-2019
10+
11+
steps:
12+
- name: Git config
13+
run: |
14+
git config --global core.autocrlf false
15+
git config --global core.eol lf
16+
17+
- name: Install depot_tools
18+
shell: cmd
19+
run: |
20+
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git ..\depot_tools
21+
set "PATH=%CD%\..\depot_tools;%PATH%"
22+
gclient
23+
24+
- name: Set up Python 3.x
25+
uses: actions/setup-python@v2
26+
with:
27+
python-version: '3.x'
28+
29+
- uses: actions/setup-node@v2
30+
with:
31+
node-version: '14'
32+
33+
- uses: actions/checkout@v2
34+
with:
35+
ref: main
36+
path: baseline
37+
fetch-depth: 0
38+
39+
- name: Update DEPS for main branch
40+
shell: pwsh
41+
run: |
42+
cd baseline
43+
(Get-Content -path .\DEPS -Raw) -replace "'checkout_onnxruntime': True", "'checkout_onnxruntime': False" | Set-Content -path .\DEPS
44+
(Get-Content -path .\DEPS -Raw) -replace "'checkout_samples': True", "'checkout_samples': False" | Set-Content -path .\DEPS
45+
46+
- name: Sync code for main branch
47+
shell: cmd
48+
run: |
49+
set "PATH=%CD%\..\depot_tools;%PATH%"
50+
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
51+
cd baseline
52+
copy scripts\standalone.gclient .gclient
53+
gclient sync
54+
55+
- name: Generate project for main branch
56+
shell: cmd
57+
run: |
58+
set "PATH=%CD%\..\depot_tools;%PATH%"
59+
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
60+
cd baseline
61+
gn gen out\Release --args="webnn_enable_dml=true is_debug=false gpgmm_enable_device_checks=true"
62+
63+
- name: Build for main branch
64+
shell: cmd
65+
run: |
66+
set "PATH=%CD%\..\depot_tools;%PATH%"
67+
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
68+
cd baseline
69+
ninja -C out\Release
70+
71+
- name: Run 'npm install' command under node folder of main branch
72+
shell: cmd
73+
run: |
74+
set "PATH=%CD%\..\depot_tools;%CD%\baseline\out\Release;%PATH%"
75+
cd baseline\node
76+
npm install --webnn_native_lib_path="../out/Release"
77+
78+
- name: Run 'npm run build' command under node folder of main branch
79+
shell: cmd
80+
run: |
81+
set "PATH=%CD%\..\depot_tools;%CD%\baseline\out\Release;%PATH%"
82+
cd baseline\node
83+
npm run build --webnn_native_lib_path="../out/Release"
84+
85+
- name: Run 'npm run report' command under node folder of main branch
86+
shell: cmd
87+
run: |
88+
set "PATH=%CD%\baseline\out\Release;%PATH%"
89+
cd baseline\node
90+
npm run report || true
91+
92+
- name: Prepare baseline result file for regression checking
93+
shell: cmd
94+
run: |
95+
echo "Baseline node test result:"
96+
type baseline\node\result.xml
97+
copy baseline\node\result.xml ${{ github.workspace }}\..\baseline.xml
98+
rmdir /s /q baseline
99+
100+
- uses: actions/checkout@v2
101+
with:
102+
path: update
103+
fetch-depth: 0
104+
105+
- name: Update DEPS for update branch
106+
shell: pwsh
107+
run: |
108+
cd update
109+
(Get-Content -path .\DEPS -Raw) -replace "'checkout_onnxruntime': True", "'checkout_onnxruntime': False" | Set-Content -path .\DEPS
110+
(Get-Content -path .\DEPS -Raw) -replace "'checkout_samples': True", "'checkout_samples': False" | Set-Content -path .\DEPS
111+
112+
- name: Sync latest code
113+
shell: cmd
114+
run: |
115+
set "PATH=%CD%\..\depot_tools;%PATH%"
116+
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
117+
cd update
118+
copy scripts\standalone.gclient .gclient
119+
gclient sync
120+
121+
- name: Generate project for update branch
122+
shell: cmd
123+
run: |
124+
set "PATH=%CD%\..\depot_tools;%PATH%"
125+
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
126+
cd update
127+
gn gen out\Release --args="webnn_enable_dml=true is_debug=false gpgmm_enable_device_checks=true"
128+
129+
- name: Build for update branch
130+
shell: cmd
131+
run: |
132+
set "PATH=%CD%\..\depot_tools;%PATH%"
133+
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
134+
cd update
135+
ninja -C out\Release
136+
137+
- name: Run 'npm install' command under node folder of update branch
138+
shell: cmd
139+
run: |
140+
set "PATH=%CD%\..\depot_tools;%CD%\update\out\Release;%PATH%"
141+
cd update\node
142+
npm install --webnn_native_lib_path="../out/Release"
143+
144+
- name: Run 'npm run build' command under node folder of update branch
145+
shell: cmd
146+
run: |
147+
set "PATH=%CD%\..\depot_tools;%CD%\update\out\Release;%PATH%"
148+
cd update\node
149+
npm run build --webnn_native_lib_path="../out/Release"
150+
151+
- name: Run 'npm run report' command under node folder of update branch
152+
shell: cmd
153+
run: |
154+
set "PATH=%CD%\update\out\Release;%PATH%"
155+
cd update\node
156+
npm run report || true
157+
158+
- name: Prepare latest result file for regression checking
159+
shell: cmd
160+
run: |
161+
echo "Latest node test result:"
162+
type update\node\result.xml
163+
copy update\node\result.xml ${{ github.workspace }}\..\update.xml
164+
165+
- name: Regression check
166+
run: |
167+
echo "Regression checking..."
168+
python update\workflow_scripts\regression_check.py ${{ github.workspace }}\..\baseline.xml ${{ github.workspace }}\..\update.xml
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Check memory leak for DirectML backend (Windows)
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
7+
job:
8+
9+
runs-on: windows-2019
10+
11+
steps:
12+
- name: Git config
13+
run: |
14+
git config --global core.autocrlf false
15+
git config --global core.eol lf
16+
- name: Install depot_tools
17+
shell: cmd
18+
run: |
19+
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git ..\depot_tools
20+
set "PATH=%CD%\..\depot_tools;%PATH%"
21+
gclient
22+
- name: Set up Python 3.x
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: '3.x'
26+
27+
- uses: actions/checkout@v2
28+
with:
29+
path: update
30+
fetch-depth: 0
31+
32+
- name: Sync latest code
33+
shell: cmd
34+
run: |
35+
set "PATH=%CD%\..\depot_tools;%PATH%"
36+
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
37+
cd update
38+
copy scripts\standalone.gclient .gclient
39+
gclient sync
40+
- name: Generate project for update branch
41+
shell: cmd
42+
run: |
43+
set "PATH=%CD%\..\depot_tools;%PATH%"
44+
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
45+
cd update
46+
gn gen out\Debug --args="webnn_enable_dml=true is_debug=true"
47+
- name: Build for update branch
48+
shell: cmd
49+
run: |
50+
set "PATH=%CD%\..\depot_tools;%PATH%"
51+
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
52+
cd update
53+
ninja -C out\Debug
54+
- name: Check memory leak for update branch
55+
shell: cmd
56+
run: |
57+
cd update
58+
echo "Run End2End Tests..."
59+
out\Debug\webnn_end2end_tests.exe --gtest_filter=-GemmTests.ScalarBias:Pool2dTests.MaxPool2dDilationsDefault:Pool2dTests.MaxPool2dDilationsNhwc:Pool2dTests.*Pool2dAutoPadExplicitOutputSizes4x4Nhwc:Pool2dTests.*Pool2dAutoPadExplicitRoundingTypeCeilNhwc > update_end2endtests.txt || true
60+
python workflow_scripts\memory_leak_check.py update_end2endtests.txt

0 commit comments

Comments
 (0)