Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Python bindings builds/tests in 'runtime' CI builds. #15878

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ jobs:
run: |
./build_tools/github_actions/docker_run.sh \
--env "BUILD_PRESET=test" \
--env "IREE_BUILD_SETUP_PYTHON_VENV=${BUILD_DIR}/.venv" \
${CONTAINER} \
./build_tools/cmake/build_runtime.sh \
"${BUILD_DIR}"
Expand Down
14 changes: 10 additions & 4 deletions build_tools/cmake/build_runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ set -xeuo pipefail

BUILD_DIR="${1:-${IREE_TARGET_BUILD_DIR:-build-runtime}}"
BUILD_PRESET="${BUILD_PRESET:-test}"
CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-RelWithDebInfo}"
IREE_BUILD_PYTHON_BINDINGS="${IREE_BUILD_PYTHON_BINDINGS:-ON}"

source build_tools/cmake/setup_build.sh
# Note: not using ccache since the runtime build should be fast already.
Expand All @@ -25,12 +27,16 @@ declare -a args
args=(
"-G" "Ninja"
"-B" "${BUILD_DIR}"
"-DPython3_EXECUTABLE=${IREE_PYTHON3_EXECUTABLE}"
"-DPYTHON_EXECUTABLE=${IREE_PYTHON3_EXECUTABLE}"
"-DCMAKE_BUILD_TYPE=RelWithDebInfo"

"-DIREE_BUILD_COMPILER=OFF"
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"

"-DIREE_RUNTIME_OPTIMIZATION_PROFILE=lto"
"-DIREE_FORCE_LTO_COMPAT_BINUTILS_ON_LINUX=ON"
"-DIREE_BUILD_COMPILER=OFF"

"-DIREE_BUILD_PYTHON_BINDINGS=${IREE_BUILD_PYTHON_BINDINGS}"
"-DPython3_EXECUTABLE=${IREE_PYTHON3_EXECUTABLE}"
"-DPYTHON_EXECUTABLE=${IREE_PYTHON3_EXECUTABLE}"
)

case "${BUILD_PRESET}" in
Expand Down
14 changes: 7 additions & 7 deletions compiler/bindings/python/test/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
# These tests perform linking via the Compiler API, which is only supported
# in bundled-LLVM builds at the moment (#14086).
if(IREE_BUILD_BUNDLED_LLVM)
iree_py_test(
NAME
compiler_core_test
SRCS
"compiler_core_test.py"
)
endif() # IREE_BUILD_BUNDLED_LLVM
iree_py_test(
NAME
compiler_core_test
SRCS
"compiler_core_test.py"
)
endif()

if(IREE_INPUT_TORCH)
iree_py_test(
Expand Down
4 changes: 3 additions & 1 deletion runtime/bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,11 @@ iree_py_test(
"tests/system_setup_test.py"
)

# These tests use compiler APIs as well as runtime APIs.
#
# These tests perform linking via the Compiler API, which is only supported
# in bundled-LLVM builds at the moment (#14086).
if(IREE_BUILD_BUNDLED_LLVM)
if(IREE_BUILD_COMPILER AND IREE_BUILD_BUNDLED_LLVM)
iree_py_test(
NAME
benchmark_test
Expand Down
5 changes: 2 additions & 3 deletions samples/py_custom_module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ if(NOT IREE_BUILD_PYTHON_BINDINGS)
return()
endif()

# These tests perform linking via the Compiler API, which is only supported
# in bundled-LLVM builds at the moment (#14086).
if(NOT IREE_BUILD_BUNDLED_LLVM)
# These tests use compiler APIs as well as runtime APIs.
if(NOT IREE_BUILD_COMPILER)
return()
endif()

Expand Down
4 changes: 1 addition & 3 deletions tests/e2e/collectives/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# These tests perform linking via the Compiler API, which is only supported
# in bundled-LLVM builds at the moment (#14086).
if(NOT IREE_BUILD_BUNDLED_LLVM OR NOT IREE_ENABLE_COLLECTIVE_RUNTIME_TESTS)
if(NOT IREE_BUILD_COMPILER OR NOT IREE_ENABLE_COLLECTIVE_RUNTIME_TESTS)
return()
endif()

Expand Down
4 changes: 3 additions & 1 deletion tests/e2e/stablehlo_models/mnist_train_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# These tests use compiler APIs as well as runtime APIs.
#
# These tests perform linking via the Compiler API, which is only supported
# in bundled-LLVM builds at the moment (#14086).
if(NOT IREE_BUILD_BUNDLED_LLVM)
if(NOT IREE_BUILD_COMPILER OR NOT IREE_BUILD_BUNDLED_LLVM)
return()
endif()

Expand Down
Loading