Skip to content

Commit 0d572d2

Browse files
David Revemanfacebook-github-bot
David Reveman
authored andcommitted
build(ci): Add breeze build and test job (facebookincubator#11637)
Summary: Pull Request resolved: facebookincubator#11637 Reviewed By: Yuhta Differential Revision: D66560387 Pulled By: xiaoxmeng fbshipit-source-id: b82a544d4f6a2e37abaa5bcc9dba4af4e7cba6c6
1 parent 7e4656f commit 0d572d2

File tree

12 files changed

+871
-106
lines changed

12 files changed

+871
-106
lines changed

.github/workflows/breeze.yml

+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Copyright (c) Facebook, Inc. and its affiliates.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Breeze Linux Build
16+
17+
on:
18+
push:
19+
branches:
20+
- "main"
21+
paths:
22+
- "velox/experimental/breeze/**"
23+
- "velox/external/perfetto/**"
24+
- "CMake/**"
25+
- "scripts/setup-ubuntu.sh"
26+
- "scripts/setup-helper-functions.sh"
27+
- ".github/workflows/breeze.yml"
28+
29+
pull_request:
30+
paths:
31+
- "velox/experimental/breeze/**"
32+
- "velox/external/perfetto/**"
33+
- "CMake/**"
34+
- "scripts/setup-ubuntu.sh"
35+
- "scripts/setup-helper-functions.sh"
36+
- ".github/workflows/breeze.yml"
37+
38+
permissions:
39+
contents: read
40+
41+
concurrency:
42+
group: ${{ github.workflow }}-${{ github.repository }}-${{ github.head_ref || github.sha }}
43+
cancel-in-progress: true
44+
45+
jobs:
46+
ubuntu-debug:
47+
runs-on: ubuntu-22.04
48+
# prevent errors when forks ff their main branch
49+
if: ${{ github.repository == 'facebookincubator/velox' }}
50+
name: "Ubuntu debug"
51+
defaults:
52+
run:
53+
shell: bash
54+
working-directory: velox
55+
steps:
56+
57+
- uses: actions/checkout@v4
58+
with:
59+
path: velox
60+
61+
- name: Install Dependencies
62+
run: |
63+
source scripts/setup-ubuntu.sh && install_apt_deps
64+
65+
- name: Make Debug Build
66+
env:
67+
VELOX_DEPENDENCY_SOURCE: BUNDLED
68+
# OpenMP build with asan+ubsan enabled
69+
run: |
70+
cmake -S velox/experimental/breeze -B _build-breeze/debug \
71+
-DCMAKE_BUILD_TYPE=Asan \
72+
-DCMAKE_CXX_FLAGS="-fsanitize=undefined" \
73+
-DBUILD_GENERATE_TEST_FIXTURES=OFF \
74+
-DBUILD_OPENMP=ON
75+
cmake --build _build-breeze/debug -j 8
76+
77+
- name: Run Tests
78+
run: |
79+
cd _build-breeze/debug && ctest -j 8 --output-on-failure --no-tests=error
80+
81+
ubuntu-gpu-relwithdebinfo:
82+
runs-on: 4-core-ubuntu-gpu-t4
83+
# prevent errors when forks ff their main branch
84+
if: ${{ github.repository == 'facebookincubator/velox' }}
85+
name: "Ubuntu GPU debug"
86+
env:
87+
CUDA_VERSION: "12.2"
88+
defaults:
89+
run:
90+
shell: bash
91+
working-directory: velox
92+
steps:
93+
94+
- uses: actions/checkout@v4
95+
with:
96+
path: velox
97+
98+
- name: Install Dependencies
99+
run: |
100+
source scripts/setup-ubuntu.sh && install_apt_deps && install_cuda ${CUDA_VERSION}
101+
sudo chmod 755 -R /usr/local/lib/python3.10/dist-packages
102+
103+
- name: Make RelWithDebInfo Build
104+
run: |
105+
cmake -S velox/experimental/breeze -B _build-breeze/relwithdebinfo \
106+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
107+
-DBUILD_GENERATE_TEST_FIXTURES=OFF \
108+
-DBUILD_CUDA=ON \
109+
-DCMAKE_NVCC_FLAGS="-arch=native"
110+
cmake --build _build-breeze/relwithdebinfo -j 8
111+
112+
- name: Run Tests
113+
run: |
114+
cd _build-breeze/relwithdebinfo && ctest -j 8 --output-on-failure --no-tests=error

velox/experimental/breeze/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ option(BUILD_OPENCL "Build OpenCL tests." OFF)
3939
option(BUILD_OPENMP "Build OpenMP tests." OFF)
4040
option(BUILD_METAL "Build Metal tests." OFF)
4141
option(BUILD_TRACING "Build tracing." ON)
42+
option(BUILD_GENERATE_TEST_FIXTURES "Generate test fixtures at build time." ON)
4243

4344
if(NOT DEFINED PERFTEST_EXT_TYPES)
4445
set(PERFTEST_EXT_TYPES

velox/experimental/breeze/cmake/cuda.cmake

+1-3
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function(breeze_add_cuda_test target source)
9696
OUTPUT ${target}
9797
COMMAND
9898
${NVCC_EXECUTABLE} -o ${target} ${target}.o ${arg_LIBS}
99-
$<TARGET_FILE_DIR:gtest>/libgtest.a
99+
$<TARGET_FILE_DIR:GTest::gtest>/libgtest.a
100100
$<TARGET_FILE_DIR:test_main>/libtest_main.a
101101
$<$<BOOL:${BUILD_TRACING}>:$<TARGET_FILE_DIR:perfetto>/libperfetto.a>
102102
${ARCH_LINK_FLAGS}
@@ -107,8 +107,6 @@ function(breeze_add_cuda_test target source)
107107
PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/${target})
108108
gtest_discover_tests(${target}_TESTS TEST_PREFIX cuda: DISCOVERY_MODE
109109
PRE_TEST)
110-
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${target}
111-
DESTINATION ${CMAKE_INSTALL_BINDIR})
112110
if(DEFINED CUDA_EXPECTED_RESOURCE_USAGE_DIR)
113111
if(EXISTS "${CUDA_EXPECTED_RESOURCE_USAGE_DIR}/${target}-expected.txt")
114112
set(GET_RESOURCE_USAGE_CMDLINE

velox/experimental/breeze/cmake/hip.cmake

+1-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function(breeze_add_hip_test target source)
3939
OUTPUT ${target}
4040
COMMAND
4141
${HIPCC_EXECUTABLE} -o ${target} ${target}.o
42-
$<TARGET_FILE_DIR:gtest>/libgtest.a
42+
$<TARGET_FILE_DIR:GTest::gtest>/libgtest.a
4343
$<TARGET_FILE_DIR:test_main>/libtest_main.a
4444
$<$<BOOL:${BUILD_TRACING}>:$<TARGET_FILE_DIR:perfetto>/libperfetto.a>
4545
${ARCH_LINK_FLAGS}
@@ -49,6 +49,4 @@ function(breeze_add_hip_test target source)
4949
set_property(TARGET ${target}_TESTS
5050
PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/${target})
5151
gtest_discover_tests(${target}_TESTS TEST_PREFIX hip: DISCOVERY_MODE PRE_TEST)
52-
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${target}
53-
DESTINATION ${CMAKE_INSTALL_BINDIR})
5452
endfunction()

velox/experimental/breeze/cmake/sycl.cmake

+1-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function(breeze_add_sycl_test target source)
4040
OUTPUT ${target}
4141
COMMAND
4242
${SYCLCC_EXECUTABLE} -o ${target} ${target}.o
43-
$<TARGET_FILE_DIR:gtest>/libgtest.a
43+
$<TARGET_FILE_DIR:GTest::gtest>/libgtest.a
4444
$<TARGET_FILE_DIR:test_main>/libtest_main.a ${CMAKE_THREAD_LIBS_INIT}
4545
${ARCH_LINK_FLAGS}
4646
$<$<BOOL:${BUILD_TRACING}>:$<TARGET_FILE_DIR:perfetto>/libperfetto.a>
@@ -51,6 +51,4 @@ function(breeze_add_sycl_test target source)
5151
PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/${target})
5252
gtest_discover_tests(${target}_TESTS TEST_PREFIX sycl: DISCOVERY_MODE
5353
PRE_TEST)
54-
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${target}
55-
DESTINATION ${CMAKE_INSTALL_BINDIR})
5654
endfunction()

velox/experimental/breeze/test/CMakeLists.txt

+98-96
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
include_directories(${CMAKE_SOURCE_DIR})
2020

21-
cxx_library(test_main "${cxx_strict}" test_main.cpp)
21+
add_library(test_main test_main.cpp)
2222
target_link_libraries(
2323
test_main
2424
PUBLIC gtest $<$<BOOL:${BUILD_TRACING}>:perfetto>)
@@ -160,101 +160,103 @@ function(
160160
endfunction()
161161

162162
function(breeze_add_unittests dir type)
163-
if(BUILD_OPENCL)
164-
generate_kernel(
165-
${type}_opencl_kernels_src
166-
${dir}
167-
${type}
168-
"opencl"
169-
"generated/${dir}/kernels-opencl.h")
170-
generate_test_fixture(
171-
${type}_opencl_test_fixture_src
172-
${dir}
173-
${type}
174-
"opencl"
175-
"generated/${dir}/${type}_test-opencl.h")
176-
set(_opencl_kernels_src ${type}_opencl_kernels_src)
177-
set(_opencl_test_fixture_src ${type}_opencl_test_fixture_src)
178-
endif()
179-
if(BUILD_METAL)
180-
generate_kernel(
181-
${type}_metal_kernels_src
182-
${dir}
183-
${type}
184-
"metal"
185-
"generated/${dir}/kernels-metal.h")
186-
generate_test_fixture(
187-
${type}_metal_test_fixture_src
188-
${dir}
189-
${type}
190-
"metal"
191-
"generated/${dir}/${type}_test-metal.h")
192-
set(_metal_kernels_src ${type}_metal_kernels_src)
193-
set(_metal_test_fixture_src ${type}_metal_test_fixture_src)
194-
endif()
195-
if(BUILD_CUDA)
196-
generate_kernel(
197-
${type}_cuda_kernels_src
198-
${dir}
199-
${type}
200-
"cuda"
201-
"generated/${dir}/kernels.cuh")
202-
generate_test_fixture(
203-
${type}_cuda_test_fixture_src
204-
${dir}
205-
${type}
206-
"cuda"
207-
"generated/${dir}/${type}_test-cuda.cuh")
208-
set(_cuda_kernels_src ${type}_cuda_kernels_src)
209-
set(_cuda_test_fixture_src ${type}_cuda_test_fixture_src)
210-
endif()
211-
if(BUILD_HIP)
212-
generate_kernel(
213-
${type}_hip_kernels_src
214-
${dir}
215-
${type}
216-
"hip"
217-
"generated/${dir}/kernels-hip.hpp")
218-
generate_test_fixture(
219-
${type}_hip_test_fixture_src
220-
${dir}
221-
${type}
222-
"hip"
223-
"generated/${dir}/${type}_test-hip.hpp")
224-
set(_hip_kernels_src ${type}_hip_kernels_src)
225-
set(_hip_test_fixture_src ${type}_hip_test_fixture_src)
226-
endif()
227-
if(BUILD_SYCL)
228-
generate_kernel(
229-
${type}_sycl_kernels_src
230-
${dir}
231-
${type}
232-
"sycl"
233-
"generated/${dir}/kernels-sycl.hpp")
234-
generate_test_fixture(
235-
${type}_sycl_test_fixture_src
236-
${dir}
237-
${type}
238-
"sycl"
239-
"generated/${dir}/${type}_test-sycl.hpp")
240-
set(_sycl_kernels_src ${type}_sycl_kernels_src)
241-
set(_sycl_test_fixture_src ${type}_sycl_test_fixture_src)
242-
endif()
243-
if(BUILD_OPENMP)
244-
generate_kernel(
245-
${type}_openmp_kernels_src
246-
${dir}
247-
${type}
248-
"openmp"
249-
"generated/${dir}/kernels-openmp.h")
250-
generate_test_fixture(
251-
${type}_openmp_test_fixture_src
252-
${dir}
253-
${type}
254-
"openmp"
255-
"generated/${dir}/${type}_test-openmp.h")
256-
set(_openmp_kernels_src ${type}_openmp_kernels_src)
257-
set(_openmp_test_fixture_src ${type}_openmp_test_fixture_src)
163+
if(BUILD_GENERATE_TEST_FIXTURES)
164+
if(BUILD_OPENCL)
165+
generate_kernel(
166+
${type}_opencl_kernels_src
167+
${dir}
168+
${type}
169+
"opencl"
170+
"generated/${dir}/kernels-opencl.h")
171+
generate_test_fixture(
172+
${type}_opencl_test_fixture_src
173+
${dir}
174+
${type}
175+
"opencl"
176+
"generated/${dir}/${type}_test-opencl.h")
177+
set(_opencl_kernels_src ${type}_opencl_kernels_src)
178+
set(_opencl_test_fixture_src ${type}_opencl_test_fixture_src)
179+
endif()
180+
if(BUILD_METAL)
181+
generate_kernel(
182+
${type}_metal_kernels_src
183+
${dir}
184+
${type}
185+
"metal"
186+
"generated/${dir}/kernels-metal.h")
187+
generate_test_fixture(
188+
${type}_metal_test_fixture_src
189+
${dir}
190+
${type}
191+
"metal"
192+
"generated/${dir}/${type}_test-metal.h")
193+
set(_metal_kernels_src ${type}_metal_kernels_src)
194+
set(_metal_test_fixture_src ${type}_metal_test_fixture_src)
195+
endif()
196+
if(BUILD_CUDA)
197+
generate_kernel(
198+
${type}_cuda_kernels_src
199+
${dir}
200+
${type}
201+
"cuda"
202+
"generated/${dir}/kernels-cuda.cuh")
203+
generate_test_fixture(
204+
${type}_cuda_test_fixture_src
205+
${dir}
206+
${type}
207+
"cuda"
208+
"generated/${dir}/${type}_test-cuda.cuh")
209+
set(_cuda_kernels_src ${type}_cuda_kernels_src)
210+
set(_cuda_test_fixture_src ${type}_cuda_test_fixture_src)
211+
endif()
212+
if(BUILD_HIP)
213+
generate_kernel(
214+
${type}_hip_kernels_src
215+
${dir}
216+
${type}
217+
"hip"
218+
"generated/${dir}/kernels-hip.hpp")
219+
generate_test_fixture(
220+
${type}_hip_test_fixture_src
221+
${dir}
222+
${type}
223+
"hip"
224+
"generated/${dir}/${type}_test-hip.hpp")
225+
set(_hip_kernels_src ${type}_hip_kernels_src)
226+
set(_hip_test_fixture_src ${type}_hip_test_fixture_src)
227+
endif()
228+
if(BUILD_SYCL)
229+
generate_kernel(
230+
${type}_sycl_kernels_src
231+
${dir}
232+
${type}
233+
"sycl"
234+
"generated/${dir}/kernels-sycl.hpp")
235+
generate_test_fixture(
236+
${type}_sycl_test_fixture_src
237+
${dir}
238+
${type}
239+
"sycl"
240+
"generated/${dir}/${type}_test-sycl.hpp")
241+
set(_sycl_kernels_src ${type}_sycl_kernels_src)
242+
set(_sycl_test_fixture_src ${type}_sycl_test_fixture_src)
243+
endif()
244+
if(BUILD_OPENMP)
245+
generate_kernel(
246+
${type}_openmp_kernels_src
247+
${dir}
248+
${type}
249+
"openmp"
250+
"generated/${dir}/kernels-openmp.h")
251+
generate_test_fixture(
252+
${type}_openmp_test_fixture_src
253+
${dir}
254+
${type}
255+
"openmp"
256+
"generated/${dir}/${type}_test-openmp.h")
257+
set(_openmp_kernels_src ${type}_openmp_kernels_src)
258+
set(_openmp_test_fixture_src ${type}_openmp_test_fixture_src)
259+
endif()
258260
endif()
259261
breeze_add_tests(
260262
${dir}

velox/experimental/breeze/test/generate.sh

+2
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ function generate {
3030

3131
generate openmp "algorithm" h
3232
generate openmp "function" h
33+
generate cuda "algorithm" cuh
34+
generate cuda "function" cuh

0 commit comments

Comments
 (0)