Skip to content

Commit c1799f8

Browse files
committed
oneDNN GH actions
1 parent 8d4413c commit c1799f8

File tree

2 files changed

+62
-1
lines changed

2 files changed

+62
-1
lines changed

.github/workflows/ubuntu.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,34 @@ jobs:
107107
working-directory: build
108108
run: make -j2
109109

110+
- name: Configure CMake (oneDNN)
111+
if: matrix.cpu == true && matrix.gpu == false
112+
id: cmake-onednn
113+
run: |
114+
mkdir -p build-onednn
115+
cd build-onednn
116+
CC=/usr/bin/gcc-${{ matrix.gcc }} CXX=/usr/bin/g++-${{ matrix.gcc }} CUDAHOSTCXX=/usr/bin/g++-${{ matrix.gcc }} \
117+
cmake .. \
118+
-DBoost_ARCHITECTURE=-x64 \
119+
-DCMAKE_BUILD_TYPE=Debug \
120+
-DCOMPILE_CPU=${{ matrix.cpu }} \
121+
-DCOMPILE_CUDA=${{ matrix.gpu }} \
122+
-DCOMPILE_EXAMPLES=${{ matrix.examples }} \
123+
-DCOMPILE_SERVER=on \
124+
-DCOMPILE_TESTS=${{ matrix.unit_tests }} \
125+
-DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-${{ matrix.cuda }} \
126+
-DDETERMINISTIC=on \
127+
-DUSE_FBGEMM=${{ matrix.cpu }} \
128+
-DUSE_SENTENCEPIECE=on \
129+
-DUSE_STATIC_LIBS=on \
130+
-DUSE_MKL=OFF -DUSE_DNNL=ON
131+
132+
- name: Compile (oneDNN)
133+
if: steps.cmake-onednn.conclusion == 'success'
134+
working-directory: build-onednn
135+
run: make -j2 && make clean
136+
137+
110138
# TODO: add a flag to CMake to compile unit tests only on CPU
111139
- name: Run unit tests
112140
working-directory: build

.github/workflows/windows.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
echo "$env:CUDA_PATH/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
5252
shell: powershell
5353
if: matrix.gpu == true
54-
# Cache boost install
54+
# Cache boost install
5555
- name: Cache Boost
5656
id: cache-boost
5757
uses: actions/cache@v3
@@ -109,6 +109,39 @@ jobs:
109109
working-directory: ${{ github.workspace }}/build/Debug
110110
run: cmake --build . --target clean
111111

112+
- name: Build Debug (oneDNN)
113+
id: build-debug-onednn
114+
uses: lukka/run-cmake@v3
115+
with:
116+
buildDirectory: ${{ github.workspace }}/build/Debug-oneDNN
117+
cmakeAppendedArgs: '-G Ninja
118+
-DCMAKE_BUILD_TYPE="Debug"
119+
-DOPENSSL_USE_STATIC_LIBS="TRUE"
120+
-DOPENSSL_MSVC_STATIC_RT="TRUE"
121+
-DCOMPILE_CPU="TRUE"
122+
-DCOMPILE_CUDA="${{ matrix.gpu }}"
123+
-DCOMPILE_SERVER="FALSE"
124+
-DCOMPILE_TESTS="TRUE"
125+
-DDETERMINISTIC="TRUE"
126+
-DUSE_FBGEMM="TRUE"
127+
-DUSE_DNNL="TRUE" -DUSE_MKL="FALSE"
128+
-DUSE_MPI="FALSE"
129+
-DUSE_NCCL="FALSE"
130+
-DUSE_SENTENCEPIECE="TRUE"
131+
-DUSE_STATIC_LIBS="TRUE"'
132+
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
133+
cmakeListsTxtPath: ${{ github.workspace }}/CMakeLists.txt
134+
useVcpkgToolchainFile: true
135+
# Building in Debug is sufficient for the all-in CPU+GPU compilation;
136+
# its main purpose is to detect warnings that the Release build is not
137+
# able to find sometimes.
138+
if: matrix.gpu == false
139+
140+
- name: Cleanup Debug
141+
if: steps.build-debug-onednn.conclusion == 'success'
142+
working-directory: ${{ github.workspace }}/build/Debug-oneDNN
143+
run: cmake --build . --target clean
144+
112145
# Windows CUDA builds use USE_NCCL=off due to compilation errors
113146
- name: Build Release
114147
uses: lukka/run-cmake@v3

0 commit comments

Comments
 (0)