From 35f02a783aa0185276f1f802edd1d23127236f65 Mon Sep 17 00:00:00 2001 From: DerrickYLJ Date: Wed, 26 Jul 2023 16:38:04 -0400 Subject: [PATCH] added build path and legion-only flag --- .github/workflows/build.yml | 43 +++++++++++++++++++++++++++++++++++-- CMakeLists.txt | 10 +++++++-- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cae8614d4f..01350faadc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,8 +28,8 @@ concurrency: cancel-in-progress: true jobs: - cmake-build: - name: Build FlexFlow with CMake + prebuild-legion: + name: Prebuild Legion with CMake runs-on: ubuntu-20.04 defaults: run: @@ -95,11 +95,50 @@ jobs: # extract LEGION tarball file export LEGION_TARBALL="legion_${{ matrix.os }}_${{ matrix.gpu_backend }}.tar.gz" + # create and export the installation path + mkdir -p export/legion + export INSTALL_DIR="build/export/legion/" echo "Creating archive $LEGION_TARBALL" tar -zcvf $LEGION_TARBALL build/export/legion/ echo "Checking the size of the Legion tarball..." du -h $LEGION_TARBALL + + cmake-build: + name: Build FlexFlow with CMake + runs-on: ubuntu-20.04 + defaults: + run: + shell: bash -l {0} # required to use an activated conda environment + strategy: + matrix: + gpu_backend: ["cuda", "hip_rocm"] + fail-fast: false + steps: + - name: Checkout Git Repository + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Free additional space on runner + run: .github/workflows/helpers/free_space_on_runner.sh + + - name: Install CUDA + uses: Jimver/cuda-toolkit@v0.2.11 + id: cuda-toolkit + with: + cuda: "11.8.0" + # Disable caching of the CUDA binaries, since it does not give us any significant performance improvement + use-github-cache: "false" + + - name: Install system dependencies + run: FF_GPU_BACKEND=${{ matrix.gpu_backend }} .github/workflows/helpers/install_dependencies.sh + + - name: Install conda and FlexFlow dependencies + uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: flexflow + environment-file: conda/environment.yml + auto-activate-base: false - name: Build FlexFlow run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index d03df0a71d..be9d6953b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,9 @@ option(BUILD_SHARED_LIBS "Build shared libraries instead of static ones" ON) # option for using Python option(FF_USE_PYTHON "Enable Python" ON) +# option for using Python +option(BUILD_LEGION_ONLY "Build Legion only" OFF) + # option to download pre-compiled NCCL/Legion libraries option(FF_USE_PREBUILT_NCCL "Enable use of NCCL pre-compiled library, if available" ON) option(FF_USE_PREBUILT_LEGION "Enable use of Legion pre-compiled library, if available" ON) @@ -231,10 +234,13 @@ if(FF_USE_NCCL) -DFF_USE_NCCL) endif() -# Legion -if(FF_BUILD_LEGION) +# Build Legion only, not build FlexFlow +if(BUILD_LEGION_ONLY) include(legion) else() + # legion + include(legion) + # json include(json)