Skip to content

Commit

Permalink
Switch from build_runtime_*.sh to inlined CMake commands. (iree-org#1…
Browse files Browse the repository at this point in the history
…8164)

Similar to iree-org#18162, this reduces the
reliance on scripts in
[`build_tools/cmake/`](https://github.com/iree-org/iree/tree/main/build_tools/cmake)
by inlining the CMake commands used for these build configurations.

Summary of changes:

* Deleted `build_tools/cmake/build_runtime_small.sh` and
`build_tools/cmake/build_runtime_tracing.sh`
* Fixed size-optimized ("small") options used in the "small runtime" job
and resolved an unused variable warning/error in
`runtime/src/iree/hal/drivers/hip/dynamic_symbols.c` that slipped
through. When we landed iree-org#16811, it
used old CMake variables in the
`build_tools/cmake/build_runtime_small.sh` script. Oops!
* Renamed jobs so they all begin with `runtime`

    | name before | name after |
    -- | --
    `build_test_runtime` | `runtime`
    `small_runtime` | `runtime_small`
     `tracing` | `runtime_tracing`

Seeing these runtime jobs next to each other, we could expand the build
matrix even further ("all platforms" x "all configurations"). Leaving
that for the future. Now it's easier to see what the jobs have in common
and how they differ.
  • Loading branch information
ScottTodd authored Aug 8, 2024
1 parent 2695fe9 commit a7e5788
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 99 deletions.
115 changes: 73 additions & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ jobs:
# Jobs that build IREE in some non-default configuration
##############################################################################

build_test_runtime:
runtime:
needs: setup
name: "build_test_runtime :: ${{ matrix.name }}"
if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'build_test_runtime')
name: "runtime :: ${{ matrix.name }}"
if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'runtime')
runs-on: ${{ matrix.runs-on }}
defaults:
run:
Expand Down Expand Up @@ -215,55 +215,86 @@ jobs:
- name: CTest
run: bash ./build_tools/cmake/ctest_all.sh "${BUILD_DIR}"

small_runtime:
runtime_small:
needs: setup
if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'small_runtime')
if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'runtime_small')
runs-on: ubuntu-20.04
env:
BUILD_DIR: build-runtime
steps:
- name: "Checking out repository"
uses: actions/[email protected]
- name: "Checking out runtime submodules"
run: ./build_tools/scripts/git/update_runtime_submodules.sh
- name: "Building size-optimized runtime"
- uses: actions/[email protected]
- name: Install requirements
run: |
./build_tools/github_actions/docker_run.sh \
gcr.io/iree-oss/base@sha256:dc314b4fe30fc1315742512891357bffed4d1b62ffcb46258b1e0761c737b446 \
./build_tools/cmake/build_runtime_small.sh \
"${BUILD_DIR}"
- name: "Testing runtime"
sudo apt update
sudo apt install -y ninja-build
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
- name: Checkout runtime submodules
run: bash ./build_tools/scripts/git/update_runtime_submodules.sh
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}
save: ${{ needs.setup.outputs.write-caches == 1 }}
- name: CMake - configure
run: |
./build_tools/github_actions/docker_run.sh \
gcr.io/iree-oss/base@sha256:dc314b4fe30fc1315742512891357bffed4d1b62ffcb46258b1e0761c737b446 \
./build_tools/cmake/ctest_all.sh \
"${BUILD_DIR}"
cmake \
-G Ninja \
-B ${BUILD_DIR} \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DIREE_BUILD_COMPILER=OFF \
-DIREE_RUNTIME_OPTIMIZATION_PROFILE=size \
-DIREE_ENABLE_LLD=ON
- name: CMake - build
run: cmake --build ${BUILD_DIR} -- -k 0
- name: CTest
run: bash ./build_tools/cmake/ctest_all.sh "${BUILD_DIR}"

tracing:
runtime_tracing:
needs: setup
if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'tracing')
name: "runtime_tracing :: ${{ matrix.provider }} provider"
if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'runtime_tracing')
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- provider: tracy
- provider: console
env:
BUILD_DIR: build-tracing
TRACING_PROVIDER: ${{ matrix.provider }}
steps:
- name: "Checking out repository"
uses: actions/[email protected]
- name: "Checking out runtime submodules"
run: ./build_tools/scripts/git/update_runtime_submodules.sh
- name: "Building IREE runtime with tracing - Tracy"
- uses: actions/[email protected]
- name: Install requirements
run: |
./build_tools/github_actions/docker_run.sh \
--env "TRACING_PROVIDER=tracy" \
gcr.io/iree-oss/base@sha256:dc314b4fe30fc1315742512891357bffed4d1b62ffcb46258b1e0761c737b446 \
./build_tools/cmake/build_runtime_tracing.sh \
"${BUILD_DIR}"
- name: "Building IREE runtime with tracing - console"
sudo apt update
sudo apt install -y ninja-build
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
- name: Checkout runtime submodules
run: bash ./build_tools/scripts/git/update_runtime_submodules.sh
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{ matrix.provider }}
save: ${{ needs.setup.outputs.write-caches == 1 }}
- name: CMake - configure
run: |
./build_tools/github_actions/docker_run.sh \
--env "TRACING_PROVIDER=console" \
gcr.io/iree-oss/base@sha256:dc314b4fe30fc1315742512891357bffed4d1b62ffcb46258b1e0761c737b446 \
./build_tools/cmake/build_runtime_tracing.sh \
"${BUILD_DIR}"
cmake \
-G Ninja \
-B ${BUILD_DIR} \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DIREE_BUILD_COMPILER=OFF \
-DIREE_ENABLE_LLD=ON \
-DIREE_ENABLE_RUNTIME_TRACING=ON \
-DIREE_TRACING_PROVIDER=${TRACING_PROVIDER}
- name: CMake - build
run: cmake --build ${BUILD_DIR} -- -k 0

############################## Crosscompilation ##############################
# Jobs that cross-compile IREE for other platforms
Expand Down Expand Up @@ -365,16 +396,16 @@ jobs:
needs:
- setup

# Basic
# Toolchains
- build_test_all_bazel

# Accelerators
# - test_nvidia_a100

# Configurations
- build_test_runtime
- small_runtime
- tracing
# Runtime build variants
- runtime
- runtime_small
- runtime_tracing

# Crosscompilation
# - cross_compile_and_test
Expand Down
28 changes: 0 additions & 28 deletions build_tools/cmake/build_runtime_small.sh

This file was deleted.

29 changes: 0 additions & 29 deletions build_tools/cmake/build_runtime_tracing.sh

This file was deleted.

4 changes: 4 additions & 0 deletions runtime/src/iree/hal/drivers/hip/dynamic_symbols.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,17 @@ iree_status_t iree_hal_hip_dynamic_symbols_initialize(
if (loaded_one) {
status = iree_hal_hip_dynamic_symbols_resolve_all(out_syms);
} else {
#if IREE_STATUS_MODE
iree_string_view_t error_detail =
iree_string_builder_view(&error_builder);
status = iree_make_status(
IREE_STATUS_UNAVAILABLE,
"HIP runtime library 'amdhip64.dll'/'libamdhip64.so' not available: "
"please ensure installed and in dynamic library search path: %.*s",
(int)error_detail.size, error_detail.data);
#else
return iree_make_status(IREE_STATUS_UNAVAILABLE);
#endif // IREE_STATUS_MODE
}
}
if (!iree_status_is_ok(status)) {
Expand Down

0 comments on commit a7e5788

Please sign in to comment.