-
Notifications
You must be signed in to change notification settings - Fork 501
206 lines (171 loc) · 5.6 KB
/
fbgemm_ci.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
name: FBGEMM CI
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
# Cancel previous runs in the PR if a new commit is pushed
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-linux:
if: ${{ github.repository_owner == 'pytorch' }}
runs-on: ${{ matrix.host-machine.instance }}
container:
image: amazonlinux:2023
options: --user root
defaults:
run:
shell: bash
env:
PRELUDE: .github/scripts/setup_env.bash
BUILD_ENV: build_${{ matrix.library-type }}
BUILD_DIR: build_${{ matrix.library-type }}
strategy:
fail-fast: false
matrix:
host-machine: [
{ arch: x86, instance: "linux.12xlarge" },
]
library-type: [ static, shared ]
compiler: [ "gcc", "clang" ]
steps:
- name: Setup Build Container
run: yum update -y; yum install -y binutils findutils git pciutils sudo wget which
- name: Checkout the Repository
uses: actions/checkout@v4
with:
submodules: true
- name: Display System Info
run: . $PRELUDE; print_system_info
- name: Setup Miniconda
run: . $PRELUDE; setup_miniconda $HOME/miniconda
- name: Create Conda Environment
run: . $PRELUDE; create_conda_environment $BUILD_ENV 3.12
- name: Install C/C++ Compilers
run: . $PRELUDE; install_cxx_compiler $BUILD_ENV ${{ matrix.compiler }}
- name: Install Build Tools
run: . $PRELUDE; install_build_tools $BUILD_ENV
- name: Build FBGEMM Library (${{ matrix.library-type }})
run: . $PRELUDE; build_fbgemm_library $BUILD_ENV cmake $BUILD_DIR ${{ matrix.library-type }}
- name: Test FBGEMM Library (${{ matrix.library-type }})
run: . $PRELUDE; test_fbgemm_library $BUILD_ENV $BUILD_DIR
build-macos:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
PRELUDE: .github/scripts/setup_env.bash
BUILD_DIR: build_${{ matrix.library-type }}
strategy:
fail-fast: false
matrix:
os: [ macos-13 ]
library-type: [ static, shared ]
steps:
- name: Checkout the Repository
uses: actions/checkout@v4
with:
submodules: true
- name: Display System Info
run: . $PRELUDE; print_system_info
# Build but skip tests due to lack of support for AVX2
- name: Build FBGEMM Library (${{ matrix.library-type }})
run: |
set -e
mkdir $BUILD_DIR; cd $BUILD_DIR
cmake --version
cmake -DUSE_SANITIZER=address -DFBGEMM_LIBRARY_TYPE=${{ matrix.library-type }} ..
make -j VERBOSE=1
build-bazel:
if: ${{ github.repository_owner == 'pytorch' }}
runs-on: ${{ matrix.host-machine.instance }}
container:
image: amazonlinux:2023
options: --user root
defaults:
run:
shell: bash
env:
PRELUDE: .github/scripts/setup_env.bash
BUILD_ENV: build_bazel
strategy:
fail-fast: false
matrix:
host-machine: [
{ arch: x86, instance: "linux.12xlarge" },
]
compiler: [ "gcc", "clang" ]
steps:
- name: Setup Build Container
run: yum update -y; yum install -y binutils findutils git pciutils sudo wget which
- name: Checkout the Repository
uses: actions/checkout@v4
with:
submodules: true
- name: Display System Info
run: . $PRELUDE; print_system_info
- name: Setup Miniconda
run: . $PRELUDE; setup_miniconda $HOME/miniconda
- name: Create Conda Environment
run: . $PRELUDE; create_conda_environment $BUILD_ENV 3.12
- name: Install C/C++ Compilers
run: . $PRELUDE; install_cxx_compiler $BUILD_ENV ${{ matrix.compiler }}
- name: Install Build Tools
run: . $PRELUDE; install_build_tools $BUILD_ENV
- name: Build FBGEMM Library
run: . $PRELUDE; build_fbgemm_library $BUILD_ENV bazel
- name: Test FBGEMM Library
run: . $PRELUDE; print_exec conda run --no-capture-output -n $BUILD_ENV bazel test -s :*
build-windows:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: cmd
env:
BUILD_DIR: build_${{ matrix.library-type }}
strategy:
fail-fast: false
matrix:
os: [ windows-2022 ]
library-type: [ static, shared ]
steps:
- name: Checkout the Repository
uses: actions/checkout@v4
with:
submodules: true
- name: Get CPU info on Windows
shell: cmd
run: |
wmic cpu list full
- name: Build FBGEMM Library (${{ matrix.library-type }})
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
echo "INSTALL NINJA:"
pip install ninja
which ninja
mkdir %BUILD_DIR%
cd %BUILD_DIR%
echo "STARTING CMAKE"
cmake --version
cmake -G Ninja -DFBGEMM_BUILD_BENCHMARKS=OFF -DFBGEMM_LIBRARY_TYPE=${{ matrix.library-type }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" ..
ninja -v all
echo "Build Success"
- name: Test FBGEMM Library (${{ matrix.library-type }})
shell: cmd
run: |
echo %cd%
cd %BUILD_DIR%
set PATH=%PATH%;%cd%;%cd%\asmjit
echo %PATH%
ctest --rerun-failed --output-on-failure
if errorlevel 1 exit /b 1