-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8b9c73e
commit e7150ec
Showing
13 changed files
with
332 additions
and
86 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
name: CI Windows | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
pull_request: | ||
merge_group: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
# A PR number if a pull request and otherwise the commit hash. This cancels | ||
# queued and in-progress runs for the same PR (presubmit) or commit | ||
# (postsubmit). | ||
group: ci-build-test-cpp-windows-${{ github.event.number || github.sha }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
# force bash for windows | ||
shell: bash | ||
|
||
jobs: | ||
build_test_windows: | ||
name: Build and Test (Windows, ASSERTIONS) | ||
runs-on: windows-2019 | ||
strategy: | ||
fail-fast: true | ||
env: | ||
CACHE_DIR: ${{ github.workspace }}/.container-cache | ||
steps: | ||
- name: "Checking out repository" | ||
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Setup Cpp | ||
uses: aminya/setup-cpp@v1 | ||
with: | ||
compiler: msvc | ||
vcvarsall: true | ||
cmake: true | ||
ninja: true | ||
cppcheck: false | ||
clangtidy: false | ||
clangformat: false | ||
|
||
- name: Install boost | ||
uses: MarkusJx/[email protected] | ||
id: install-boost | ||
with: | ||
boost_install_dir: ${{ github.workspace }} | ||
boost_version: 1.78.0 | ||
platform_version: 2019 | ||
toolset: msvc | ||
|
||
- name: Sync source deps | ||
run: | | ||
pip install numpy pyyaml | ||
python ./sync_deps.py | ||
- name: Enable cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: "${{ github.workspace }}/.ccache" | ||
key: windows-build-test-cpp-asserts-v1-${{ github.sha }} | ||
restore-keys: | | ||
windows-build-test-cpp- | ||
- name: Build packages | ||
run: | | ||
export cache_dir="${{ github.workspace }}/.ccache" | ||
# switch to linux paths instead of windows paths | ||
# also make into abs path | ||
export BOOST_ROOT="/$(echo "${{ steps.install-boost.outputs.BOOST_ROOT }}" | sed -e 's/\\/\//g' -e 's/://')" | ||
bash build_tools/ci/build_test_cpp_windows.sh | ||
- name: Create artifacts | ||
if: ${{ !cancelled() }} | ||
run: | | ||
# TODO: https://github.com/openxla/iree/issues/16230 | ||
# We should not be packaging clang and llvm-link in the default dist | ||
# installs. | ||
rm -f iree-install/bin/clang* | ||
rm -f iree-install/bin/llvm-link* | ||
tar cf iree-dist.tar -C iree-install . -C ../iree-build tools/testing/e2e/iree-e2e-matmul-test | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: windows_x86_64_release_packages | ||
path: | | ||
iree-dist-win64.tar | ||
if-no-files-found: warn | ||
|
||
- name: Save cache | ||
uses: actions/cache/save@v3 | ||
if: ${{ !cancelled() }} | ||
with: | ||
path: ${{ env.CACHE_DIR }} | ||
key: windows-build-test-cpp-asserts-v1-${{ github.sha }} |
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,102 @@ | ||
#!/bin/bash | ||
|
||
set -eu -o errtrace | ||
|
||
this_dir="$(cd $(dirname $0) && pwd)" | ||
repo_root="$(cd $this_dir/../.. && pwd)" | ||
iree_dir="$(cd $repo_root/../iree && pwd)" | ||
build_dir="$repo_root/iree-build" | ||
install_dir="$repo_root/iree-install" | ||
mkdir -p "$build_dir" | ||
build_dir="$(cd $build_dir && pwd)" | ||
cache_dir="${cache_dir:-}" | ||
|
||
# Setup cache dir. | ||
if [ -z "${cache_dir}" ]; then | ||
cache_dir="${repo_root}/.build-cache" | ||
mkdir -p "${cache_dir}" | ||
cache_dir="$(cd ${cache_dir} && pwd)" | ||
fi | ||
echo "Caching to ${cache_dir}" | ||
mkdir -p "${cache_dir}/ccache" | ||
mkdir -p "${cache_dir}/pip" | ||
|
||
python="$(which python)" | ||
echo "Using python: $python" | ||
|
||
#export CCACHE_DIR="${cache_dir}/ccache" | ||
#export CCACHE_MAXSIZE="700M" | ||
#export CMAKE_C_COMPILER_LAUNCHER=ccache | ||
#export CMAKE_CXX_COMPILER_LAUNCHER=ccache | ||
# | ||
## Clear ccache stats. | ||
#ccache -z | ||
# | ||
## Build XRT. | ||
#XRT_BUILD_DIR=$repo_root/xrt-build | ||
#XRT_INSTALL_DIR=$repo_root/xrt-install | ||
#$this_dir/build_xrt.sh $XRT_BUILD_DIR $XRT_INSTALL_DIR | ||
|
||
echo "Building IREE" | ||
echo "=============" | ||
echo '{ | ||
"version": 4, | ||
"cmakeMinimumRequired": { | ||
"major": 3, | ||
"minor": 23, | ||
"patch": 0 | ||
}, | ||
"include": [ | ||
"build_tools/cmake/presets/all.json" | ||
] | ||
}' > $iree_dir/CMakeUserPresets.json | ||
|
||
cd $iree_dir | ||
|
||
pip download -q mlir -f https://makslevental.github.io/wheels | ||
unzip -q mlir*whl | ||
python3 -m pip install "numpy<2" pyyaml "pybind11[global]" nanobind | ||
|
||
cmake -S "$iree_dir" -B "$build_dir" \ | ||
-GNinja \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_PREFIX="$install_dir" \ | ||
-DCMAKE_INSTALL_LIBDIR=lib \ | ||
-DIREE_ENABLE_ASSERTIONS=ON \ | ||
-DIREE_BUILD_SAMPLES=OFF \ | ||
-DIREE_BUILD_PYTHON_BINDINGS=OFF \ | ||
-DIREE_BUILD_BINDINGS_TFLITE=OFF \ | ||
-DIREE_HAL_DRIVER_DEFAULTS=OFF \ | ||
-DIREE_HAL_DRIVER_LOCAL_SYNC=ON \ | ||
-DIREE_HAL_DRIVER_LOCAL_TASK=ON \ | ||
-DIREE_TARGET_BACKEND_DEFAULTS=OFF \ | ||
-DIREE_TARGET_BACKEND_LLVM_CPU=ON \ | ||
-DIREE_INPUT_TOSA=OFF \ | ||
-DIREE_INPUT_STABLEHLO=OFF \ | ||
-DIREE_INPUT_TORCH=OFF \ | ||
-DIREE_CMAKE_PLUGIN_PATHS=../iree-amd-aie \ | ||
-DCMAKE_OBJECT_PATH_MAX=4096 \ | ||
-DBoost_INCLUDE_DIR=${BOOST_ROOT}/include\ | ||
-DBoost_LIBRARY_DIRS=${BOOST_ROOT}/lib \ | ||
-DIREE_ERROR_ON_MISSING_SUBMODULES=OFF \ | ||
-DIREE_BUILD_BUNDLED_LLVM=OFF \ | ||
-DCMAKE_PREFIX_PATH=$PWD/mlir \ | ||
-DPython3_EXECUTABLE=$(which python3) | ||
# -DIREE_EXTERNAL_HAL_DRIVERS=xrt \ | ||
# -DXRT_DIR=$XRT_INSTALL_DIR/opt/xilinx/xrt/share/cmake/XRT | ||
|
||
echo "Building all" | ||
echo "------------" | ||
cmake --build "$build_dir" -- -k 0 | ||
|
||
echo "Installing" | ||
echo "----------" | ||
echo "Install to: $install_dir" | ||
cmake --build "$build_dir" --target iree-install-dist | ||
|
||
echo "CTest" | ||
echo "-----" | ||
ctest --test-dir "$build_dir" -R amd-aie --output-on-failure -j | ||
|
||
# Show ccache stats. | ||
#ccache --show-stats |
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,5 @@ | ||
# https://stackoverflow.com/a/68353105 | ||
# Cannot open compiler generated file: '': Invalid argument | ||
# -DCMAKE_OBJECT_PATH_MAX=4096 | ||
# The registry value will be cached by the system (per process) after the first call to an affected Win32 file or directory function (see below for the list of functions). The registry value will not be reloaded during the lifetime of the process. In order for all apps on the system to recognize the value, a reboot might be required because some processes may have started before the key was set. | ||
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force |
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
Oops, something went wrong.