diff --git a/.ci/docker/conda-env-ci.txt b/.ci/docker/conda-env-ci.txt index 9ebfe654da3..8f2e65dae79 100644 --- a/.ci/docker/conda-env-ci.txt +++ b/.ci/docker/conda-env-ci.txt @@ -1,2 +1,4 @@ cmake=3.22.1 ninja=1.10.2 +libuv +pkg-config diff --git a/.ci/scripts/setup-macos.sh b/.ci/scripts/setup-macos.sh index b1a8ff14b57..395f0c1767e 100755 --- a/.ci/scripts/setup-macos.sh +++ b/.ci/scripts/setup-macos.sh @@ -131,5 +131,9 @@ if [[ -z "${GITHUB_RUNNER:-}" ]]; then fi print_cmake_info -install_executorch +install_pytorch_and_domains +# We build PyTorch from source here instead of using nightly. This allows CI to test against +# the pinned commit from PyTorch +install_executorch "use-pt-pinned-commit" build_executorch_runner "${BUILD_TOOL}" +do_not_use_nightly_on_ci diff --git a/.ci/scripts/utils.sh b/.ci/scripts/utils.sh index aa8d78da4bb..ebed4a31500 100644 --- a/.ci/scripts/utils.sh +++ b/.ci/scripts/utils.sh @@ -40,6 +40,42 @@ install_pip_dependencies() { popd || return } +install_domains() { + echo "Install torchvision and torchaudio" + pip install --no-use-pep517 --user "git+https://github.com/pytorch/audio.git@${TORCHAUDIO_VERSION}" + pip install --no-use-pep517 --user "git+https://github.com/pytorch/vision.git@${TORCHVISION_VERSION}" +} + +install_pytorch_and_domains() { + pushd .ci/docker || return + TORCH_VERSION=$(cat ci_commit_pins/pytorch.txt) + popd || return + + git clone https://github.com/pytorch/pytorch.git + + # Fetch the target commit + pushd pytorch || return + git checkout "${TORCH_VERSION}" + git submodule update --init --recursive + + export USE_DISTRIBUTED=1 + # Then build and install PyTorch + python setup.py bdist_wheel + pip install "$(echo dist/*.whl)" + + # Grab the pinned audio and vision commits from PyTorch + TORCHAUDIO_VERSION=$(cat .github/ci_commit_pins/audio.txt) + export TORCHAUDIO_VERSION + TORCHVISION_VERSION=$(cat .github/ci_commit_pins/vision.txt) + export TORCHVISION_VERSION + + install_domains + + popd || return + # Print sccache stats for debugging + sccache --show-stats || true +} + install_flatc_from_source() { # NB: This function could be used to install flatbuffer from source pushd third-party/flatbuffers || return