Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gersemirc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ indent: 2
definitions:
- CMake/third-party/FBCMakeParseArgs.cmake
- CMake/third-party/FBThriftCppLibrary.cmake
- CMake/FindThrift.cmake
- velox/experimental/breeze/cmake
- velox/experimental/breeze/test
- velox/experimental/breeze/perftest
Expand Down
140 changes: 140 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Ubuntu Benchmark

on:
pull_request:
paths:
- .github/workflows/benchmark.yml
- scripts/ci/benchmark-requirements.txt
- scripts/setup-ubuntu.sh

push:
branches: [main]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
benchmark:
if: github.repository == 'facebookincubator/velox'
runs-on: 8-core-ubuntu-22.04
env:
CCACHE_DIR: ${{ github.workspace }}/ccache/
CCACHE_BASEDIR: ${{ github.workspace }}
BINARY_DIR: ${{ github.workspace }}/benchmarks/
CONTENDER_OUTPUT_PATH: ${{ github.workspace }}/benchmark-results/contender/
INSTALL_PREFIX: ${{ github.workspace }}/dependencies
steps:

- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
path: velox

persist-credentials: false

- name: Restore Dependencies
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
id: restore-deps
with:
path: ${{ env.INSTALL_PREFIX }}
key: dependencies-benchmark-${{ hashFiles('velox/scripts/setup-ubuntu.sh') }}

- name: Install apt dependencies
env:
UV_TOOL_BIN_DIR: /usr/local/bin
run: |
source velox/scripts/setup-ubuntu.sh
install_apt_deps

- name: Install compiled dependencies
if: ${{ steps.restore-deps.outputs.cache-hit != 'true' }}
env:
CCACHE_DISABLE: 'true'
run: |
source velox/scripts/setup-ubuntu.sh
run_and_time install_fmt
run_and_time install_protobuf
run_and_time install_boost
run_and_time install_fast_float
run_and_time install_folly
run_and_time install_fizz
run_and_time install_wangle
run_and_time install_mvfst
run_and_time install_fbthrift
run_and_time install_stemmer
run_and_time install_arrow

- name: Save Dependencies
if: ${{ steps.restore-deps.outputs.cache-hit != 'true' }}
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ${{ env.INSTALL_PREFIX }}
key: dependencies-benchmark-${{ hashFiles('velox/scripts/setup-ubuntu.sh') }}

- name: Restore ccache
uses: apache/infrastructure-actions/stash/restore@3354c1565d4b0e335b78a76aedd82153a9e144d4
id: restore-cache
with:
clean: true
path: ccache
key: ccache-benchmark

- name: Clear CCache Statistics
run: |
ccache -sz

- name: Build Contender Benchmarks
working-directory: velox
run: |
n_cores=$(nproc)
make benchmarks-basic-build NUM_THREADS=$n_cores MAX_HIGH_MEM_JOBS=$n_cores MAX_LINK_JOBS=$n_cores
mkdir -p ${BINARY_DIR}/contender/
cp -r --verbose _build/release/velox/benchmarks/basic/* ${BINARY_DIR}/contender/

- name: CCache after
run: |
ccache -vs

- name: Save ccache"
uses: apache/infrastructure-actions/stash/save@3354c1565d4b0e335b78a76aedd82153a9e144d4
with:
path: ccache
key: ccache-benchmark

- name: Install benchmark dependencies
run: |
python3 -m pip install -r velox/scripts/ci/benchmark-requirements.txt

- name: Run Benchmarks - Contender
working-directory: velox
run: |
make benchmarks-basic-run \
EXTRA_BENCHMARK_FLAGS="--binary_path ${BINARY_DIR}/contender/ --output_path ${CONTENDER_OUTPUT_PATH}"

- name: Upload result artifact
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
path: benchmark-results
name: benchmark-results
retention-days: 5
47 changes: 37 additions & 10 deletions .github/workflows/linux-build-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
- name: Install Dependencies
env:
VELOX_BUILD_SHARED: "ON"
VELOX_ARROW_CMAKE_PATCH: ${{ github.workspace }}/CMake/resolve_dependency_modules/arrow/cmake-compatibility.patch
VELOX_FBTHRIFT_CMAKE_PATCH: ${{ github.workspace }}/CMake/resolve_dependency_modules/fbthrift/compactv1-protocol-refiller.patch
run: |
if git diff --name-only HEAD^1 HEAD | grep -q "scripts/setup-"; then
echo "Removing previous AWS SDK and s2n installations to avoid conflicts..."
Expand All @@ -123,6 +123,7 @@ jobs:
mkdir /tmp/build
cd /tmp/build
source /opt/rh/gcc-toolset-12/enable
export VELOX_ARROW_CMAKE_PATCH="${GITHUB_WORKSPACE}/CMake/resolve_dependency_modules/arrow/arrow-testing-boost.patch ${GITHUB_WORKSPACE}/CMake/resolve_dependency_modules/arrow/cmake-compatibility.patch"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arrow was updated from Arrow 15 to Arrow 18. I see some issues with dependencies of Arrow for testing and boost in the CI. Looks like this patch was supposedly fixing this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry. I missed the upgrade.

Yes. It's for fixing arrow-testing and Boost but it's incompleted yet.
I tried fixing it with the patch when I have time but I couldn't fix it entirely. I will retry it when I have time again but I don't have enough time for now. Sorry. If the patch has any trouble, you can remove the patch. I may re-add something when I retry.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kou Yes, we will have to review this.

# Install basic deps with GCC. Some deps have problems (e.g. folly missing atomic lib).
USE_CLANG=false bash /setup-centos9.sh

Expand Down Expand Up @@ -434,7 +435,8 @@ jobs:

- name: Install Dependencies
env:
VELOX_ARROW_CMAKE_PATCH: ${{ github.workspace }}/velox/CMake/resolve_dependency_modules/arrow/cmake-compatibility.patch
VELOX_BUILD_SHARED: "ON"
VELOX_FBTHRIFT_CMAKE_PATCH: ${{ github.workspace }}/velox/CMake/resolve_dependency_modules/fbthrift/compactv1-protocol-refiller.patch
run: |
if git diff --name-only HEAD^1 HEAD | grep -q "scripts/setup-"; then
# Overwrite old setup scripts with changed versions
Expand All @@ -443,6 +445,7 @@ jobs:
mkdir /tmp/build
cd /tmp/build

export VELOX_ARROW_CMAKE_PATCH="${GITHUB_WORKSPACE}/velox/CMake/resolve_dependency_modules/arrow/arrow-testing-boost.patch ${GITHUB_WORKSPACE}/velox/CMake/resolve_dependency_modules/arrow/cmake-compatibility.patch"
USE_CLANG=false bash /setup-ubuntu.sh

cd /
Expand All @@ -460,6 +463,26 @@ jobs:
run: |
mkdir -p "$CCACHE_DIR"

- uses: actions/checkout@v5
with:
path: velox
persist-credentials: false

- name: Install Dependencies
run: |
source scripts/setup-ubuntu.sh
install_apt_deps
install_faiss_deps
# We can remove them once we bundle FBThrift.
install_fmt
install_boost
install_fast_float
install_folly
install_fizz
install_wangle
install_mvfst
install_fbthrift

- name: Clear CCache Statistics
run: |
ccache -sz
Expand All @@ -469,10 +492,14 @@ jobs:
env:
VELOX_DEPENDENCY_SOURCE: SYSTEM
ICU_SOURCE: SYSTEM
# Use BUNDLED gflags to provide PIC static gflags for .so plugins.
# The container's folly is built with -DGFLAGS_SHARED=FALSE so its
# exported config references gflags_static which BUNDLED gflags provides.
gflags_SOURCE: BUNDLED
# FBThrift has transitive Boost dependency. We can't mix
# bundled Boost and system Boost.
Boost_SOURCE: SYSTEM
# Recent FBThrift needs recent Folly.
folly_SOURCE: SYSTEM
# System FBThrift is built with system GFlags. We need to
# use system GFlags with system FBThrift.
gflags_SOURCE: SYSTEM
# Keep system glog (container's glog is built against the same gflags
# version). Without this, BUNDLED gflags cascades to BUNDLED glog
# which conflicts with system glog loaded transitively.
Expand Down Expand Up @@ -597,7 +624,7 @@ jobs:
- name: Install Dependencies
env:
VELOX_BUILD_SHARED: "ON"
VELOX_ARROW_CMAKE_PATCH: ${{ github.workspace }}/velox/CMake/resolve_dependency_modules/arrow/cmake-compatibility.patch
VELOX_FBTHRIFT_CMAKE_PATCH: ${{ github.workspace }}/velox/CMake/resolve_dependency_modules/fbthrift/compactv1-protocol-refiller.patch
run: |
if git diff --name-only HEAD^1 HEAD | grep -q "scripts/setup-"; then
# Overwrite old setup scripts with changed versions
Expand All @@ -606,7 +633,9 @@ jobs:
mkdir /tmp/build
cd /tmp/build

# Install basic deps with GCC.
# Use absolute path within the container for patches
export VELOX_ARROW_CMAKE_PATCH="${GITHUB_WORKSPACE}/velox/CMake/resolve_dependency_modules/arrow/arrow-testing-boost.patch ${GITHUB_WORKSPACE}/velox/CMake/resolve_dependency_modules/arrow/cmake-compatibility.patch"
# Install basic deps with GCC. Some deps have problems (e.g. folly missing atomic lib).
USE_CLANG=false bash /setup-fedora.sh

cd /
Expand All @@ -633,13 +662,11 @@ jobs:
env:
VELOX_DEPENDENCY_SOURCE: SYSTEM
faiss_SOURCE: BUNDLED
fmt_SOURCE: BUNDLED
simdjson_SOURCE: BUNDLED
gRPC_SOURCE: SYSTEM
MAKEFLAGS: NUM_THREADS=32 MAX_HIGH_MEM_JOBS=8 MAX_LINK_JOBS=6
EXTRA_CMAKE_FLAGS: >-
-DVELOX_ENABLE_PARQUET=ON
-DARROW_THRIFT_USE_SHARED=ON
-DVELOX_ENABLE_EXAMPLES=ON
run: |
uv tool install --force cmake@3.31.1
Expand Down
24 changes: 17 additions & 7 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ jobs:
with:
persist-credentials: false

- name: Cache ccache
uses: apache/infrastructure-actions/stash/restore@3354c1565d4b0e335b78a76aedd82153a9e144d4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-macos-1-macos-15-${{ matrix.type }}

- name: Install Dependencies
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 'TRUE'
Expand All @@ -76,6 +82,17 @@ jobs:
install_velox_deps_from_brew
install_gflags
install_glog
# We can use Homebrew's FBThrift once Homebrew's Folly
# enables 128bit integer support. We need to fix
# https://github.com/facebook/folly/issues/1666 for it.
install_boost
install_fmt
install_fast_float
install_folly
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setup script for macOS also installs fast_float just like for Linux. So you probably need that here too.

install_fizz
install_wangle
install_mvfst
install_fbthrift
# Needed for faiss to find BLAS
install_faiss_deps
install_double_conversion
Expand All @@ -88,15 +105,8 @@ jobs:
fi
echo "$INSTALL_PREFIX/bin" >> $GITHUB_PATH

- name: Cache ccache
uses: apache/infrastructure-actions/stash/restore@3354c1565d4b0e335b78a76aedd82153a9e144d4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-macos-1-macos-15-${{ matrix.type }}

- name: Configure Build
env:
fmt_SOURCE: BUNDLED #brew fmt11 is not supported
faiss_SOURCE: BUNDLED #brew faiss is not supported
CMAKE_POLICY_VERSION_MINIMUM: '3.5'
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
# prevent errors when forks ff their main branch
if: ${{ github.repository == 'facebookincubator/velox' }}
runs-on: 32-core-ubuntu
container: ghcr.io/facebookincubator/velox-dev:centos9
container: ghcr.io/czentgr/czentgr-test:dependencies
timeout-minutes: 120
env:
CCACHE_DIR: ${{ github.workspace }}/ccache
Expand Down Expand Up @@ -664,7 +664,7 @@ jobs:
spark-aggregate-fuzzer-run:
name: Spark Aggregate Fuzzer
runs-on: 4-core-ubuntu
container: ghcr.io/facebookincubator/velox-dev:spark-server
container: ghcr.io/czentgr/czentgr-test:spark-java
needs: compile
timeout-minutes: 30
steps:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ubuntu-bundled-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ jobs:

- name: Install Dependencies
run: |
source scripts/setup-ubuntu.sh && install_apt_deps && install_faiss_deps
source scripts/setup-ubuntu.sh && \
install_apt_deps && install_faiss_deps && \
install_fmt && install_boost && install_fast_float && install_folly && install_fizz && install_wangle && install_fbthrift

- name: Clear CCache Statistics
run: |
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ repos:
require_serial: true
exclude: |
(?x)^(
CMake/Find(Snappy|Sodium|Thrift|double-conversion)\.cmake|
CMake/Find(Snappy|Sodium|double-conversion)\.cmake|
velox/docs/affiliations_map.txt|
velox/.*/bitpacking\.(cpp|h)|
velox/.*/Lemire/.*|
Expand Down
8 changes: 1 addition & 7 deletions CMake/FindArrow.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,25 @@ include(FindPackageHandleStandardArgs)
find_library(ARROW_LIB libarrow.a)
find_library(ARROW_TESTING_LIB libarrow_testing.a)
find_path(ARROW_INCLUDE_PATH arrow/api.h)
find_package(Thrift)

find_package_handle_standard_args(
Arrow
DEFAULT_MSG
ARROW_LIB
ARROW_TESTING_LIB
ARROW_INCLUDE_PATH
Thrift_FOUND
)

# Only add the libraries once.
if(Arrow_FOUND AND NOT TARGET arrow)
add_library(arrow STATIC IMPORTED GLOBAL)
add_library(arrow_testing STATIC IMPORTED GLOBAL)
add_library(thrift ALIAS thrift::thrift)

set_target_properties(
arrow
arrow_testing
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${ARROW_INCLUDE_PATH}
)
set_target_properties(
arrow
PROPERTIES IMPORTED_LOCATION ${ARROW_LIB} INTERFACE_LINK_LIBRARIES thrift
)
set_target_properties(arrow PROPERTIES IMPORTED_LOCATION ${ARROW_LIB})
set_target_properties(arrow_testing PROPERTIES IMPORTED_LOCATION ${ARROW_TESTING_LIB})
endif()
Loading