Skip to content

[Substrait] Minor fixes in importScalarFunction. (NFC) (#860) #1056

[Substrait] Minor fixes in importScalarFunction. (NFC) (#860)

[Substrait] Minor fixes in importScalarFunction. (NFC) (#860) #1056

name: Structured Build and Test
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
name: Structured Build and Test (Release Asserts)
runs-on: ubuntu-22.04
env:
LLVM_SYMBOLIZER_PATH: /usr/lib/llvm-14/bin/llvm-symbolizer
steps:
- name: Compute Structured base path
run: |
echo "STRUCTURED_MAIN_SRC_DIR=${GITHUB_WORKSPACE}/sandbox" | tee -a $GITHUB_ENV
echo "STRUCTURED_MAIN_BINARY_DIR=${GITHUB_WORKSPACE}/sandbox/build" | tee -a $GITHUB_ENV
echo "LLVM_SYSPATH=${GITHUB_WORKSPACE}/sandbox/build" | tee -a $GITHUB_ENV
echo "MLIR_RUNNER_UTILS_LIB=${GITHUB_WORKSPACE}/sandbox/build/lib/libmlir_runner_utils.so" | tee -a $GITHUB_ENV
echo "MLIR_C_RUNNER_UTILS_LIB=${GITHUB_WORKSPACE}/sandbox/build/lib/libmlir_c_runner_utils.so" | tee -a $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # v4.3.0
with:
python-version: 3.11
- name: Cache git folder
uses: actions/cache@v3
with:
path: sandbox/.git
key: git-folder
- name: Install protobuf
run: |
sudo apt-get install -y protobuf-compiler libprotobuf-dev
- name: Install libcurl
run: |
sudo apt-get install -y libcurl4-gnutls-dev
- name: Checkout project
uses: actions/checkout@v3
with:
path: sandbox
submodules: recursive
- name: Install Ninja
uses: llvm/actions/install-ninja@6a57890d0e3f9f35dfc72e7e48bc5e1e527cdd6c # Jan 17
- name: Ccache for C++ compilation
uses: hendrikmuhs/ccache-action@621a41397ed83711c72862638d9ff6e63fca3041 # v1.2.3
with:
key: ${{ runner.os }}-structured
# LLVM needs serious cache size
max-size: 6G
- name: Install Python depends
run: |
cd ${STRUCTURED_MAIN_SRC_DIR}
python -m pip install -v -r requirements.txt
- name: Configure CMake
run: |
cmake \
-DPython3_EXECUTABLE=$(which python) \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_COMPILER:FILEPATH=clang \
-DCMAKE_CXX_COMPILER:FILEPATH=clang++ \
-DLLVM_ENABLE_PROJECTS="mlir;clang;clang-tools-extra" \
-DLLVM_TARGETS_TO_BUILD="X86" \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_INCLUDE_UTILS=ON \
-DLLVM_INSTALL_UTILS=ON \
-DLLVM_LIT_ARGS=-v \
-DLLVM_EXTERNAL_PROJECTS=structured \
-DLLVM_EXTERNAL_STRUCTURED_SOURCE_DIR=${STRUCTURED_MAIN_SRC_DIR} \
-DLLVM_ENABLE_LLD=ON \
-DLLVM_CCACHE_BUILD=ON \
-DMLIR_INCLUDE_INTEGRATION_TESTS=ON \
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
-DMLIR_ENABLE_PYTHON_BENCHMARKS=ON \
-S${STRUCTURED_MAIN_SRC_DIR}/third_party/llvm-project/llvm \
-B${STRUCTURED_MAIN_BINARY_DIR} -G Ninja
echo "PYTHONPATH=${PYTHONPATH}:${STRUCTURED_MAIN_BINARY_DIR}/tools/structured/python_packages" | tee -a $GITHUB_ENV
- name: Build main project
run: |
cmake --build ${STRUCTURED_MAIN_BINARY_DIR} --target structured-all
ccache -s
- name: Run lit tests
run: |
cmake --build ${STRUCTURED_MAIN_BINARY_DIR} --target check-structured
- name: Run benchmarks
shell: bash # This enables the `-eo pipefail` flag to propagate script failures.
run: |
${GITHUB_WORKSPACE}/sandbox/benchmarks/inner_product/run.sh test | tee /tmp/result.jsonl
${GITHUB_WORKSPACE}/sandbox/benchmarks/inner_product/plot.sh -i /tmp/result.jsonl
- name: Archive benchmark plots
uses: actions/upload-artifact@v3
with:
name: structured-benchmark-plots
path: |
sandbox/benchmarks/**/*.pdf