forked from ROCm/AMDMIGraphX
-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (112 loc) · 4.49 KB
/
windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
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:
fetch-depth: 0
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Create depend folder
run: mkdir depend
- name: Setup ROCm CMake modules
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
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
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
run: vcpkg install sqlite3[core]:x64-windows-static
- name: Setup MessagePack library
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
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
run: |
cd depend
git clone https://github.com/ROCm/rocMLIR
cd rocMLIR
:: follows https://github.com/AmusementClub/AMDMIGraphX/blob/develop/requirements.txt
git checkout 8f51edbff77499fbd4d14e38b3efda1d210f6f6e
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.1.2
- 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.Q3-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.1/bin/clang.exe"
-D CMAKE_CXX_COMPILER="C:/Program Files/AMD/ROCm/6.1/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.1/lib/cmake/hip"
-D HIP_PLATFORM=amd
-D GPU_TARGETS="gfx1030;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-windows
- name: Show
run: ls -R migraphx-windows
- name: Upload
uses: actions/upload-artifact@v4
with:
name: migraphx-windows
retention-days: 1
path: migraphx-windows