14
14
- main
15
15
16
16
jobs :
17
- build_nvidia_gpu :
18
- if : ${{ false }} # Disable the job for now
17
+ build_and_test_amd :
19
18
runs-on : ${{ matrix.os }}
20
19
defaults :
21
20
run :
@@ -24,13 +23,11 @@ jobs:
24
23
PRELUDE : .github/scripts/setup_env.bash
25
24
BUILD_ENV : build_binary
26
25
strategy :
27
- # Don't fast-fail all the other builds if one of the them fails
28
26
fail-fast : false
29
27
matrix :
30
28
os : [ ubuntu-20.04 ]
31
- python-version : [ "3.8" ]
32
- # As of version 2.0, PyTorch has dropped support for CUDA 11.6
33
- cuda-version : [ 11.7.1 ]
29
+ python-version : [ "3.10" ]
30
+ rocm-version : [ "5.3" ]
34
31
35
32
steps :
36
33
- name : Checkout the Repository
@@ -41,120 +38,52 @@ jobs:
41
38
- name : Display System Info
42
39
run : . $PRELUDE; print_system_info
43
40
41
+ - name : Display GPU Info
42
+ run : . $PRELUDE; print_gpu_info
43
+
44
+ - name : Free Disk Space
45
+ run : . $PRELUDE; free_disk_space
46
+
44
47
- name : Setup Miniconda
45
48
run : |
46
49
. $PRELUDE; setup_miniconda $HOME/miniconda
47
50
echo "${HOME}/miniconda/bin" >> $GITHUB_PATH
48
51
echo "CONDA=${HOME}/miniconda" >> $GITHUB_PATH
49
52
50
53
- name : Create Conda Environment
51
- run : |
52
- . $PRELUDE
53
- create_conda_environment $BUILD_ENV ${{ matrix.python-version }}
54
+ run : . $PRELUDE; create_conda_environment $BUILD_ENV ${{ matrix.python-version }}
54
55
55
- # This hack is needed to get builds running properly on Ubuntu 20.04
56
- echo "[SETUP] Creating symlink \$CONDA_PREFIX/lib64 -> \$CONDA_PREFIX/lib ..."
57
- conda_prefix=$(conda run -n "${env_name}" printenv CONDA_PREFIX)
58
- ln -s "${conda_prefix}/lib" "${conda_prefix}/lib64"
59
-
60
- # - name: Install C/C++ Compilers
61
- # run: . $PRELUDE; install_cxx_compiler $BUILD_ENV
56
+ - name : Install ROCm
57
+ run : . $PRELUDE; install_rocm_ubuntu $BUILD_ENV ${{ matrix.rocm-version }}
62
58
63
59
- name : Install Build Tools
64
60
run : . $PRELUDE; install_build_tools $BUILD_ENV
65
61
66
- - name : Install CUDA
67
- run : . $PRELUDE; install_cuda $BUILD_ENV "${{ matrix.cuda-version }}"
68
-
69
- - name : Install PyTorch
70
- run : . $PRELUDE; install_pytorch_pip $BUILD_ENV nightly cuda "${{ matrix.cuda-version }}"
71
-
72
- - name : Install cuDNN
73
- run : . $PRELUDE; install_cudnn $BUILD_ENV "$(pwd)/build_only/cudnn" "${{ matrix.cuda-version }}"
62
+ - name : Install PyTorch-ROCm Nightly
63
+ run : . $PRELUDE; install_pytorch_pip $BUILD_ENV nightly rocm ${{ matrix.rocm-version }}
74
64
75
65
- name : Prepare FBGEMM Build
76
66
run : . $PRELUDE; cd fbgemm_gpu; prepare_fbgemm_gpu_build $BUILD_ENV
77
67
78
- - name : Build and Install FBGEMM_GPU
79
- run : . $PRELUDE; cd fbgemm_gpu; build_fbgemm_gpu_install $BUILD_ENV
80
-
81
- - name : Test FBGEMM_GPU installation
82
- shell : bash
83
- run : |
84
- . $PRELUDE;
85
- cd fbgemm_gpu/test
86
- print_exec conda run -n $BUILD_ENV python input_combine_test.py -v
87
- print_exec conda run -n $BUILD_ENV python quantize_ops_test.py -v
88
- print_exec conda run -n $BUILD_ENV python sparse_ops_test.py -v
89
- conda run -n $BUILD_ENV python -c "import fbgemm_gpu"
90
- conda run -n $BUILD_ENV python -c "import fbgemm_gpu.split_embedding_codegen_lookup_invokers"
91
-
92
- build_amd_gpu :
93
- if : ${{ false }} # Disable the job for now
94
- runs-on : ${{ matrix.os }}
95
- strategy :
96
- matrix :
97
- os : [ubuntu-20.04]
98
- config : [[pip, 5.3]]
99
-
100
- steps :
101
- - name : Free space
102
- run : sudo rm -rf /usr/local/android /usr/share/dotnet /usr/local/share/boost /opt/ghc /usr/local/share/chrom* /usr/share/swift /usr/local/julia* /usr/local/lib/android
103
-
104
- - uses : actions/checkout@v3
105
-
106
- - name : Install ROCm
107
- shell : bash
108
- run : |
109
- sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10
110
- wget https://repo.radeon.com/amdgpu-install/5.3/ubuntu/focal/amdgpu-install_5.3.50300-1_all.deb
111
- export DEBIAN_FRONTEND=noninteractive
112
- sudo apt install -y ./amdgpu-install_5.3.50300-1_all.deb
113
- amdgpu-install -y --usecase=hiplibsdk,rocm --no-dkms
114
- sudo rm amdgpu-install_5.3.50300-1_all.deb
115
-
116
- - name : Install dependencies
117
- shell : bash
118
- run : |
119
- sudo apt-get update
120
- sudo apt-get install -y git pip python3-dev mesa-common-dev clang comgr libopenblas-dev jp intel-mkl-full locales libnuma-dev
121
- sudo apt-get install -y hipify-clang || true
122
- sudo apt-get install -y miopen-hip miopen-hip-dev
123
- sudo pip install cmake scikit-build ninja jinja2 numpy hypothesis --no-input
124
- sudo apt-get clean
125
- # Install PyTorch (nightly) as required by fbgemm_gpu
126
- sudo pip install --pre torch torchvision --extra-index-url https://download.pytorch.org/whl/nightly/rocm5.3/
127
-
128
- - name : Checkout submodules
129
- shell : bash
68
+ - name : Build FBGEMM_GPU-ROCM Nightly
130
69
run : |
70
+ . $PRELUDE
131
71
cd fbgemm_gpu
132
- git submodule sync
133
- git submodule update --init --recursive
134
72
135
- - name : Build fbgemm_gpu
136
- shell : bash
137
- run : |
138
- sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10
139
- cd fbgemm_gpu
140
- # build for MI250 only to save time.
141
- sudo PYTORCH_ROCM_ARCH=gfx90a python3 setup.py build develop
73
+ # Build for MI250 only to save time.
74
+ print_exec conda env config vars set -n $BUILD_ENV PYTORCH_ROCM_ARCH=gfx90a
75
+ print_exec conda run -n $BUILD_ENV python setup.py build develop
76
+
77
+ - name : Test FBGEMM_GPU-ROCM Nightly installation
78
+ timeout-minutes : 10
79
+ run : . $PRELUDE; cd fbgemm_gpu/test; run_fbgemm_gpu_tests $BUILD_ENV rocm
142
80
143
- - name : Test fbgemm_gpu installation
144
- shell : bash
145
- run : |
146
- cd fbgemm_gpu
147
- cd test
148
- python3 input_combine_test.py -v
149
- python3 quantize_ops_test.py -v
150
- python3 sparse_ops_test.py -v
151
- python3 -c "import fbgemm_gpu"
152
- python3 -c "import fbgemm_gpu.split_embedding_codegen_lookup_invokers"
153
81
154
82
test_amd_gpu :
155
83
if : ${{ false }} # Disable the job for now
156
84
runs-on : rocm
157
85
strategy :
86
+ fail-fast : false
158
87
matrix :
159
88
os : [ubuntu-latest]
160
89
@@ -200,71 +129,54 @@ jobs:
200
129
"
201
130
docker run $DOCKER_OPTIONS $DOCKER_IMAGE $JENKINS_REPO_DIR_DOCKER/.jenkins/rocm/build_and_test.sh $JENKINS_REPO_DIR_DOCKER
202
131
203
- test_nvidia_gpu :
204
- if : ${{ false }} # Disable the job for now
205
- uses : pytorch/test-infra/.github/workflows/linux_job.yml@main
206
- with :
207
- job-name : cuda 11.7, A10
208
- runner : linux.g5.4xlarge.nvidia.gpu # A10
209
- repository : pytorch/fbgemm
210
- gpu-arch-type : cuda
211
- gpu-arch-version : 11.7
212
- timeout : 150
213
- script : |
214
- set -x
215
- # Checkout FBGEMM_GPU
216
- git submodule update --init
217
-
218
- # Build FBGEMM_GPU with pytorch-nightly
219
- CUDA_VERSION="11.7.1"
220
- PYTHON_VERSION="3.10"
221
- bash .github/scripts/build_wheel.bash -v -p "$PYTHON_VERSION" -o fbgemm_gpu_test -P pytorch-nightly -c "$CUDA_VERSION" -m /opt/conda
222
-
223
- # Test FBGEMM_GPU using a generated wheel file
224
- WHEEL_PATH="$(ls fbgemm_gpu/dist/*.whl)"
225
- bash .github/scripts/test_wheel.bash -v -p "$PYTHON_VERSION" -P pytorch-nightly -c "$CUDA_VERSION" -w "$WHEEL_PATH" -m /opt/conda
226
-
227
- build_cpu_only :
132
+
133
+ build_and_test_cpu :
228
134
runs-on : ${{ matrix.os }}
135
+ defaults :
136
+ run :
137
+ shell : bash
138
+ env :
139
+ PRELUDE : .github/scripts/setup_env.bash
140
+ BUILD_ENV : build_binary
229
141
strategy :
142
+ fail-fast : false
230
143
matrix :
231
- os : [ubuntu-latest]
144
+ os : [ ubuntu-20.04, ubuntu-latest ]
145
+ python-version : [ "3.8", "3.9", "3.10" ]
232
146
233
147
steps :
234
- - uses : actions/checkout@v3
148
+ - name : Checkout the Repository
149
+ uses : actions/checkout@v3
150
+ with :
151
+ submodules : true
235
152
236
- - name : Install dependencies
237
- shell : bash
238
- run : |
239
- sudo apt-get update
240
- sudo apt-get -y install git pip python3-dev
241
- sudo pip install cmake scikit-build ninja jinja2 numpy hypothesis --no-input
242
- # Install PyTorch (nightly) as required by fbgemm_gpu
243
- sudo pip install --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
153
+ - name : Display System Info
154
+ run : . $PRELUDE; print_system_info
244
155
245
- - name : Checkout submodules
246
- shell : bash
247
- run : |
248
- cd fbgemm_gpu
249
- git submodule sync
250
- git submodule update --init --recursive
156
+ - name : Display GPU Info
157
+ run : . $PRELUDE; print_gpu_info
251
158
252
- - name : Build fbgemm_gpu
253
- shell : bash
159
+ - name : Setup Miniconda
254
160
run : |
255
- cd fbgemm_gpu
256
- # to avoid "Permission denied" error in '/usr/local/lib/python3.8/dist-packages/' folder
257
- sudo python setup.py install --cpu_only
161
+ . $PRELUDE; setup_miniconda $HOME/miniconda
162
+ echo "${HOME}/miniconda/bin" >> $GITHUB_PATH
163
+ echo "CONDA=${HOME}/miniconda" >> $GITHUB_PATH
258
164
259
- - name : Test fbgemm_gpu cpu-only installation
260
- shell : bash
261
- run : |
262
- cd fbgemm_gpu
263
- cd test
264
- python batched_unary_embeddings_test.py -v
265
- python input_combine_test.py -v
266
- python layout_transform_ops_test.py -v
267
- python merge_pooled_embeddings_test.py -v
268
- python permute_pooled_embedding_modules_test.py -v
269
- python quantize_ops_test.py -v
270
- python sparse_ops_test.py -v
165
+ - name : Create Conda Environment
166
+ run : . $PRELUDE; create_conda_environment $BUILD_ENV ${{ matrix.python-version }}
167
+
168
+ - name : Install Build Tools
169
+ run : . $PRELUDE; install_build_tools $BUILD_ENV
170
+
171
+ - name : Install PyTorch
172
+ run : . $PRELUDE; install_pytorch_pip $BUILD_ENV nightly cpu
173
+
174
+ - name : Prepare FBGEMM Build
175
+ run : . $PRELUDE; cd fbgemm_gpu; prepare_fbgemm_gpu_build $BUILD_ENV
176
+
177
+ - name : Build and Install FBGEMM_GPU (CPU version)
178
+ run : . $PRELUDE; cd fbgemm_gpu; build_fbgemm_gpu_install $BUILD_ENV cpu
179
+
180
+ - name : Test with PyTest
181
+ timeout-minutes : 10
182
+ run : . $PRELUDE; cd fbgemm_gpu/test; run_fbgemm_gpu_tests $BUILD_ENV cpu
0 commit comments