diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b5e65d080c2..7099daef5fca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,16 +27,6 @@ jobs: env: CACHE_DIR: ${{ github.workspace }}/.container-cache steps: - - name: Configure local git mirrors - run: | - # Our stock runners have access to certain local git caches. If these - # files are available, it will prime the cache and configure git to - # use them. Practically, this eliminates network/latency for cloning - # llvm. - if [[ -x /gitmirror/scripts/trigger_update_mirrors.sh ]]; then - /gitmirror/scripts/trigger_update_mirrors.sh - /gitmirror/scripts/git_config.sh - fi - name: "Checking out repository" uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 with: @@ -55,11 +45,25 @@ jobs: restore-keys: | build-test-cpp-asserts-manylinux-${{ matrix.torch-version }}-v2- + - name: "Setting up Python" + run: | + sudo apt update + sudo apt install software-properties-common -y + sudo add-apt-repository ppa:deadsnakes/ppa -y + sudo apt install python3.11 python3-pip -y + sudo apt-get install python3.11-dev python3.11-venv build-essential -y + - name: Install python deps (torch-${{ matrix.torch-version }}) run: | export cache_dir="${{ env.CACHE_DIR }}" bash build_tools/ci/install_python_deps.sh ${{ matrix.torch-version }} + - name: ccache + uses: hendrikmuhs/ccache-action@53911442209d5c18de8a31615e0923161e435875 # v1.2.16 + with: + key: ${{ github.job }}-${{ matrix.torch-version }} + save: ${{ needs.setup.outputs.write-caches == 1 }} + - name: Build project run: | export cache_dir="${{ env.CACHE_DIR }}" diff --git a/build_tools/ci/build_posix.sh b/build_tools/ci/build_posix.sh index b18efd2f09f6..c7d076c939a5 100755 --- a/build_tools/ci/build_posix.sh +++ b/build_tools/ci/build_posix.sh @@ -20,7 +20,7 @@ echo "Caching to ${cache_dir}" mkdir -p "${cache_dir}/ccache" mkdir -p "${cache_dir}/pip" -python="$(which python)" +python="$(which python3)" echo "Using python: $python" export CMAKE_TOOLCHAIN_FILE="$this_dir/linux_default_toolchain.cmake" @@ -40,7 +40,7 @@ echo "::group::CMake configure" cmake -S "$repo_root/externals/llvm-project/llvm" -B "$build_dir" \ -GNinja \ -DCMAKE_BUILD_TYPE=Release \ - -DPython3_EXECUTABLE="$(which python)" \ + -DPython3_EXECUTABLE="$(which python3)" \ -DLLVM_ENABLE_ASSERTIONS=ON \ -DTORCH_MLIR_ENABLE_WERROR_FLAG=ON \ -DCMAKE_INSTALL_PREFIX="$install_dir" \ diff --git a/build_tools/ci/install_python_deps.sh b/build_tools/ci/install_python_deps.sh index 7acd900ec9ca..375d0a6d1c24 100755 --- a/build_tools/ci/install_python_deps.sh +++ b/build_tools/ci/install_python_deps.sh @@ -7,7 +7,7 @@ repo_root="$(cd $this_dir/../.. && pwd)" torch_version="${1:-unknown}" echo "::group::installing llvm python deps" -python -m pip install --no-cache-dir -r $repo_root/externals/llvm-project/mlir/python/requirements.txt +python3 -m pip install --no-cache-dir -r $repo_root/externals/llvm-project/mlir/python/requirements.txt echo "::endgroup::" case $torch_version in @@ -30,5 +30,5 @@ case $torch_version in esac echo "::group::installing test requirements" -python -m pip install --no-cache-dir -r $repo_root/test-requirements.txt +python3 -m pip install --no-cache-dir -r $repo_root/test-requirements.txt echo "::endgroup::" diff --git a/build_tools/ci/test_posix.sh b/build_tools/ci/test_posix.sh index a0b5a0340381..d5aa9d5ab79c 100755 --- a/build_tools/ci/test_posix.sh +++ b/build_tools/ci/test_posix.sh @@ -13,7 +13,7 @@ python -m e2e_testing.main --config=fx_importer_tosa -v echo "::endgroup::" echo "::group::Run ONNX e2e integration tests" -python -m e2e_testing.main --config=onnx -v +python3 -m e2e_testing.main --config=onnx -v echo "::endgroup::" case $torch_version in @@ -27,13 +27,13 @@ case $torch_version in # TODO: Need to verify in the stable version echo "::group::Run FxImporter e2e integration tests" - python -m e2e_testing.main --config=fx_importer -v + python3 -m e2e_testing.main --config=fx_importer -v echo "::endgroup::" # AMD: Disabled stablehlo. # TODO: Need to verify in the stable version # echo "::group::Run FxImporter2Stablehlo e2e integration tests" - # python -m e2e_testing.main --config=fx_importer_stablehlo -v + # python3 -m e2e_testing.main --config=fx_importer_stablehlo -v # echo "::endgroup::" ;; stable) diff --git a/build_tools/update_abstract_interp_lib.sh b/build_tools/update_abstract_interp_lib.sh index 070fa54a5461..4da20c3e715a 100755 --- a/build_tools/update_abstract_interp_lib.sh +++ b/build_tools/update_abstract_interp_lib.sh @@ -44,7 +44,7 @@ fi # To enable this python package, manually build torch_mlir with: # -DTORCH_MLIR_ENABLE_JIT_IR_IMPORTER=ON # TODO: move this package out of JIT_IR_IMPORTER. -PYTHONPATH="${pypath}" python \ +PYTHONPATH="${pypath}" python3 \ -m torch_mlir.jit_ir_importer.build_tools.abstract_interp_lib_gen \ --pytorch_op_extensions=${ext_module:-""} \ --torch_transforms_cpp_dir="${torch_transforms_cpp_dir}" diff --git a/build_tools/update_torch_ods.sh b/build_tools/update_torch_ods.sh index e3aa23078565..efe0055d7e06 100755 --- a/build_tools/update_torch_ods.sh +++ b/build_tools/update_torch_ods.sh @@ -45,7 +45,7 @@ set +u # To enable this python package, manually build torch_mlir with: # -DTORCH_MLIR_ENABLE_PYTORCH_EXTENSIONS=ON # TODO: move this package out of JIT_IR_IMPORTER. -PYTHONPATH="${PYTHONPATH}:${pypath}" python \ +PYTHONPATH="${PYTHONPATH}:${pypath}" python3 \ -m torch_mlir.jit_ir_importer.build_tools.torch_ods_gen \ --torch_ir_include_dir="${torch_ir_include_dir}" \ --pytorch_op_extensions="${ext_module}" \