.github/workflows/windows.yml: update to hip 6.2.4; add support for g… #26
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
name: Build (Windows) | |
on: [push, workflow_dispatch] | |
jobs: | |
build-windows: | |
runs-on: windows-2022 | |
defaults: | |
run: | |
shell: cmd | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
# develop | |
ref: 6acc1f957bab2d2b23b3adffccd29f7e10178986 | |
fetch-depth: 0 | |
- name: Setup MSVC | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Cache dependencies | |
id: cache-depend | |
uses: actions/cache@v4 | |
with: | |
path: | | |
D:/a/AMDMIGraphX/AMDMIGraphX/depend/install | |
C:/vcpkg/packages/sqlite3_x64-windows-static | |
key: ${{ runner.os }}-depend | |
- name: Create depend folder | |
if: steps.cache-depend.outputs.cache-hit != 'true' | |
run: mkdir depend | |
- name: Setup ROCm CMake modules | |
if: steps.cache-depend.outputs.cache-hit != 'true' | |
run: | | |
cd depend | |
git clone https://github.com/ROCm/rocm-cmake --depth 1 | |
cd rocm-cmake | |
cmake -S . -B build | |
cmake --install build --prefix ../install | |
- name: Setup Half library | |
if: steps.cache-depend.outputs.cache-hit != 'true' | |
run: | | |
cd depend | |
git clone https://github.com/ROCm/half --depth 1 | |
cd half | |
cmake -S . -B build -D CMAKE_PREFIX_PATH="%cd%/../install" | |
cmake --install build --prefix ../install | |
- name: Setup json library | |
if: steps.cache-depend.outputs.cache-hit != 'true' | |
run: | | |
cd depend | |
git clone https://github.com/nlohmann/json | |
cd json | |
:: follows https://github.com/AmusementClub/AMDMIGraphX/blob/develop/requirements.txt | |
git checkout v3.8.0 | |
cmake -S . -B build -D BUILD_TESTING=OFF -Wno-dev | |
cmake --install build --prefix ../install | |
- name: Setup SQLite3 library | |
if: steps.cache-depend.outputs.cache-hit != 'true' | |
run: vcpkg install sqlite3[core]:x64-windows-static | |
- name: Setup MessagePack library | |
if: steps.cache-depend.outputs.cache-hit != 'true' | |
run: | | |
cd depend | |
git clone https://github.com/msgpack/msgpack-c | |
cd msgpack-c | |
:: follows https://github.com/AmusementClub/AMDMIGraphX/blob/develop/requirements.txt | |
git checkout cpp-3.3.0 | |
:: patch for cmake msvc rt flag | |
python -c "f=open('CMakeLists.txt');lines=f.readlines();lines[0]='cmake_minimum_required(VERSION 3.15)\n';f.close();f=open('CMakeLists.txt','w');f.writelines(lines);f.close()" | |
cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=Release -D MSGPACK_BUILD_TESTS=OFF -D MSGPACK_BUILD_EXAMPLES=OFF -D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -Wno-dev | |
cmake --build build --verbose | |
cmake --install build --prefix ../install | |
xcopy include\ ..\install\include\ /s /f /y | |
- name: Setup Protobuf library | |
if: steps.cache-depend.outputs.cache-hit != 'true' | |
run: | | |
cd depend | |
git clone https://github.com/google/protobuf | |
cd protobuf | |
:: follows onnx's recommended version | |
git checkout v3.21.12 | |
cmake -S . -B build_rel -G Ninja -D CMAKE_BUILD_TYPE=Release -D protobuf_BUILD_TESTS=OFF -D protobuf_MSVC_STATIC_RUNTIME=ON -Wno-dev | |
cmake --build build_rel --verbose | |
cmake --install build_rel --prefix ../install | |
- name: Setup rocMLIR library | |
if: steps.cache-depend.outputs.cache-hit != 'true' | |
run: | | |
cd depend | |
git clone https://github.com/ROCm/rocMLIR | |
cd rocMLIR | |
:: follows https://github.com/AmusementClub/AMDMIGraphX/blob/develop/requirements.txt | |
git checkout 13065c4b3a216e1b13dfb8f746b8a0d421f124e8 | |
cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=Release -D CMAKE_PREFIX_PATH="%cd%/../install" -D BUILD_FAT_LIBROCKCOMPILER=ON -D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -Wno-dev | |
cmake --build build | |
cmake --install build --prefix ../install | |
- name: Cache HIP SDK | |
id: cache-hip | |
uses: actions/cache@v4 | |
with: | |
path: C:\Program Files\AMD\ROCM | |
key: ${{ runner.os }}-rocm-6.2.4 | |
- name: Setup HIP | |
if: steps.cache-hip.outputs.cache-hit != 'true' | |
shell: pwsh | |
run: | | |
curl -s -o hip_installer.exe -L https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-24.Q4-WinSvr2022-For-HIP.exe | |
Start-Process hip_installer.exe -ArgumentList '-install' -NoNewWindow -Wait | |
- name: Setup MIGraphX | |
run: cmake -S . -B build -G Ninja -LA -Wno-dev | |
-D CMAKE_BUILD_TYPE=Release | |
-D CMAKE_C_COMPILER="C:/Program Files/AMD/ROCm/6.2/bin/clang.exe" | |
-D CMAKE_CXX_COMPILER="C:/Program Files/AMD/ROCm/6.2/bin/clang++.exe" | |
-D CMAKE_PREFIX_PATH="%cd%/depend/install;C:/vcpkg/packages/sqlite3_x64-windows-static" | |
-D BUILD_TESTING=OFF | |
-D hip_DIR="C:/Program Files/AMD/ROCm/6.2/lib/cmake/hip" | |
-D hiprtc_DIR="C:/Program Files/AMD/ROCm/6.2/lib/cmake/hiprtc" | |
-D HIP_PLATFORM=amd | |
-D GPU_TARGETS="gfx1030;gfx1031;gfx1032;gfx1100;gfx1101;gfx1102" | |
-D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded | |
- name: Build MIGraphX | |
run: cmake --build build --verbose | |
- name: Install MIGraphX | |
run: | | |
cmake --install build --prefix migraphx | |
xcopy build\src\include\migraphx\version.h migraphx\include\migraphx /f /y | |
- name: Show | |
run: ls -R migraphx | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: migraphx-win64 | |
retention-days: 1 | |
path: migraphx | |
- name: Package | |
shell: pwsh | |
run: Compress-Archive migraphx -DestinationPath migraphx-win64.zip | |
- name: Get description | |
shell: bash | |
run: | | |
echo MIGX_VERSION=`git describe` >> $GITHUB_ENV | |
echo TIME=`date -u +"%y%m%d-%H%M"` >> $GITHUB_ENV | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: migraphx-win64.zip | |
name: Build ${{ env.MIGX_VERSION }} | |
tag_name: ${{ env.MIGX_VERSION }}-${{ env.TIME }} | |
prerelease: true | |