Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 124 additions & 0 deletions .github/workflows/win_webnn_rel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: Windows WebNN (Release)

on:
push:
branches: main
paths:
- 'src/**'
- 'scripts/webnn.deps'

pull_request:
branches: main
paths:
- 'src/**'
- 'scripts/webnn.deps'

jobs:

win_webnn_rel:

runs-on: windows-2019

steps:
- name: Git config
run: |
git config --global core.autocrlf false
git config --global core.eol lf

- name: Install depot_tools
shell: cmd
run: |
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git ..\depot_tools
set "PATH=%CD%\..\depot_tools;%PATH%"
gclient

- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: '3.x'

- uses: actions/checkout@v2
with:
ref: main
path: base
fetch-depth: 0

- name: Sync code for main branch
shell: cmd
run: |
set "PATH=%CD%\..\depot_tools;%PATH%"
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
cd base
copy scripts\webnn.deps DEPS
copy scripts\webnn.gclient .gclient
gclient sync

- name: Generate project for main branch
shell: cmd
run: |
set "PATH=%CD%\..\depot_tools;%PATH%"
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
cd base
gn gen out\Release --args="webnn_enable_dmlx=true is_debug=false gpgmm_enable_assert_on_warning=true"

- name: Build for main branch
shell: cmd
run: |
set "PATH=%CD%\..\depot_tools;%PATH%"
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
cd base
ninja -C out\Release

- name: Run webnn_end2end_tests
shell: cmd
continue-on-error: true
run: |
cd base
out\Release\webnn_end2end_tests.exe --gtest_output=json:${{ github.workspace }}\..\baseline_end2end_tests.json

- name: Clean baseline directory
shell: cmd
run: |
rmdir /s /q base

- uses: actions/checkout@v2
with:
path: test
fetch-depth: 0

- name: Sync code for main branch (with patch)
shell: cmd
run: |
set "PATH=%CD%\..\depot_tools;%PATH%"
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
cd test
copy scripts\webnn.deps DEPS
copy scripts\webnn.gclient .gclient
gclient sync

- name: Generate project for main branch (with patch)
shell: cmd
run: |
set "PATH=%CD%\..\depot_tools;%PATH%"
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
cd test
gn gen out\Release --args="webnn_enable_dmlx=true is_debug=false gpgmm_enable_assert_on_warning=true"

- name: Build for main branch (with patch)
shell: cmd
run: |
set "PATH=%CD%\..\depot_tools;%PATH%"
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
cd test
ninja -C out\Release

- name: Run webnn_end2end_tests (with patch)
shell: cmd
continue-on-error: true
run: |
cd test
out\Release\webnn_end2end_tests.exe --gtest_output=json:${{ github.workspace }}\..\test_end2end_tests.json || true

- name: Regression check end2end tests
run: |
python test\scripts\regression_check.py ${{ github.workspace }}\..\baseline_end2end_tests.json ${{ github.workspace }}\..\test_end2end_tests.json
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
/third_party/jsoncpp*
/third_party/llvm-build
/third_party/vulkan*
/third_party/webnn_native
/third_party/libFuzzer
/third_party/*benchmark*
/tools
Expand Down
7 changes: 7 additions & 0 deletions build_overrides/gpgmm_features.gni
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ if (!defined(checkout_dawn)) {
checkout_dawn = false
}

if (!defined(checkout_webnn)) {
checkout_webnn = false
}

declare_args() {
# Enable GPGMM's ASSERTs even in release builds
# Sets -dGPGMM_ENABLE_ASSERTS
Expand All @@ -37,6 +41,9 @@ declare_args() {
# Enables compilation of Dawn's end2end tests.
gpgmm_enable_dawn = checkout_dawn

# Enables compilation of WebNN's end2end tests.
gpgmm_enable_webnn = checkout_webnn

# Build GPGMM as a shared library.
# Sets -dGPGMM_SHARED_LIBRARY
gpgmm_shared_library = false
Expand Down
23 changes: 23 additions & 0 deletions build_overrides/webnn.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2022 The GPGMM Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# The paths to WebNN's dependencies
webnn_jinja2_dir = "//third_party/webnn_native/third_party/jinja2"

# TODO(webnn): WebNN hard codes //third_party/dawn paths within BUILD.gn
# files so we must use GPGMM-Dawn version instead of WebNN-Dawn version to
# workaround.
webnn_dawn_root = "//third_party/dawn"

webnn_gpgmm_dir = "//"
1 change: 1 addition & 0 deletions scripts/regression_check.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2021 The WebNN Authors
# Copyright 2022 The GPGMM Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Loading