Skip to content
Closed
4 changes: 2 additions & 2 deletions .ci/docker/common/install_pytorch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ install_pytorch_and_domains() {
pip_install "$(echo dist/*.whl)"

# Grab the pinned audio and vision commits from PyTorch
TORCHAUDIO_VERSION=$(cat .github/ci_commit_pins/audio.txt)
TORCHAUDIO_VERSION=release/2.8
export TORCHAUDIO_VERSION
TORCHVISION_VERSION=$(cat .github/ci_commit_pins/vision.txt)
TORCHVISION_VERSION=release/0.23
export TORCHVISION_VERSION

install_domains
Expand Down
8 changes: 2 additions & 6 deletions .ci/scripts/setup-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@ read -r BUILD_TOOL BUILD_MODE EDITABLE < <(parse_args "$@")
# have already been installed, so we use PyTorch build from source here instead
# of nightly. This allows CI to test against latest commits from PyTorch
if [[ "${EDITABLE:-false}" == "true" ]]; then
install_executorch --use-pt-pinned-commit --editable
install_executorch --editable
else
install_executorch --use-pt-pinned-commit
install_executorch
fi
build_executorch_runner "${BUILD_TOOL}" "${BUILD_MODE}"

if [[ "${GITHUB_BASE_REF:-}" == *main* || "${GITHUB_BASE_REF:-}" == *gh* ]]; then
do_not_use_nightly_on_ci
fi
2 changes: 1 addition & 1 deletion .ci/scripts/test_model.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ test_model_with_xnnpack() {
bash examples/xnnpack/quantization/test_quantize.sh "${BUILD_TOOL}" "${MODEL_NAME}"
return 0
fi

pip list
# Delegation
if [[ ${WITH_QUANTIZATION} == true ]]; then
SUFFIX="q8"
Expand Down
3 changes: 3 additions & 0 deletions .ci/scripts/wheel/post_build_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ set -eux
# Rename pip-out directory, to avoid using shared libraries in pip-out during
# smoke test.
mv pip-out BACKUP-pip-out

# pip list
pip list
12 changes: 6 additions & 6 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ jobs:
conda activate "${CONDA_ENV}"

source .ci/scripts/utils.sh
install_executorch "--use-pt-pinned-commit"
install_executorch
BUILD_TOOL="cmake"
PYTHON_EXECUTABLE=python \
bash .ci/scripts/build_llama_android.sh "${BUILD_TOOL}"
Expand Down Expand Up @@ -362,7 +362,7 @@ jobs:
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
conda activate "${CONDA_ENV}"

./install_requirements.sh --use-pt-pinned-commit
./install_requirements.sh
# build module for executorch.extension.pybindings.portable_lib
bash test/build_size_test.sh
strip cmake-out/test/size_test
Expand Down Expand Up @@ -398,7 +398,7 @@ jobs:
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
conda activate "${CONDA_ENV}"

./install_requirements.sh --use-pt-pinned-commit
./install_requirements.sh

# build module for executorch.extension.pybindings.portable_lib
bash test/build_size_test.sh
Expand Down Expand Up @@ -475,7 +475,7 @@ jobs:
conda activate "${CONDA_ENV}"

source .ci/scripts/utils.sh
install_executorch "--use-pt-pinned-commit"
install_executorch

.ci/scripts/setup-arm-baremetal-tools.sh

Expand Down Expand Up @@ -512,7 +512,7 @@ jobs:
MODE=${{ matrix.mode }}
PT2E_QUANTIZE=${{ matrix.pt2e_quantize }}

./install_requirements.sh --use-pt-pinned-commit
./install_requirements.sh
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-qnn-deps.sh
PYTHON_EXECUTABLE=python bash .ci/scripts/build-qnn-sdk.sh

Expand Down Expand Up @@ -706,7 +706,7 @@ jobs:
conda activate "${CONDA_ENV}"

source .ci/scripts/utils.sh
install_executorch "--use-pt-pinned-commit"
install_executorch

PYTHON_EXECUTABLE=python bash .ci/scripts/setup-mediatek-deps.sh
PYTHON_EXECUTABLE=python bash .ci/scripts/build-mediatek-sdk.sh
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ jobs:
conda activate "${CONDA_ENV}"
source .ci/scripts/utils.sh
install_executorch "--use-pt-pinned-commit"
install_executorch
.ci/scripts/setup-arm-baremetal-tools.sh
Expand Down Expand Up @@ -235,7 +235,7 @@ jobs:
conda activate "${CONDA_ENV}"
source .ci/scripts/utils.sh
install_executorch "--use-pt-pinned-commit"
install_executorch
.ci/scripts/setup-arm-baremetal-tools.sh
source examples/arm/ethos-u-scratch/setup_path.sh
Expand Down Expand Up @@ -690,7 +690,7 @@ jobs:
MODE=${{ matrix.mode }}
PT2E_QUANTIZE=${{ matrix.pt2e_quantize }}
./install_requirements.sh --use-pt-pinned-commit
./install_requirements.sh
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-qnn-deps.sh
PYTHON_EXECUTABLE=python bash .ci/scripts/build-qnn-sdk.sh
Expand Down
8 changes: 4 additions & 4 deletions install_executorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,12 @@ def main(args):

check_and_update_submodules()
# This option is used in CI to make sure that PyTorch build from the pinned commit
# is used instead of nightly. CI jobs wouldn't be able to catch regression from the
# is used instead of release. CI jobs wouldn't be able to catch regression from the
# latest PT commit otherwise
use_pytorch_nightly = not args.use_pt_pinned_commit
use_pytorch_release = not args.use_pt_pinned_commit

# Step 1: Install core dependencies first
install_requirements(use_pytorch_nightly)
install_requirements(use_pytorch_release)

# Step 2: Install core package
cmd = (
Expand All @@ -230,7 +230,7 @@ def main(args):

# Step 3: Extra (optional) packages that is only useful for running examples.
if not args.minimal:
install_optional_example_requirements(use_pytorch_nightly)
install_optional_example_requirements(use_pytorch_release)


if __name__ == "__main__":
Expand Down
23 changes: 10 additions & 13 deletions install_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ def python_is_compatible():
TORCH_URL = "https://download.pytorch.org/whl/test/cpu"


def install_requirements(use_pytorch_nightly):
# Skip pip install on Intel macOS if using nightly.
if use_pytorch_nightly and is_intel_mac_os():
def install_requirements(use_pytorch_release):
# Skip pip install on Intel macOS if using release
if use_pytorch_release and is_intel_mac_os():
print(
"ERROR: Prebuilt PyTorch wheels are no longer available for Intel-based macOS.\n"
"Please build from source by following https://docs.pytorch.org/executorch/main/using-executorch-building-from-source.html",
Expand All @@ -77,7 +77,7 @@ def install_requirements(use_pytorch_nightly):
# Setting use_pytorch_nightly to false to test the pinned PyTorch commit. Note
# that we don't need to set any version number there because they have already
# been installed on CI before this step, so pip won't reinstall them
"torch==2.8.0" if use_pytorch_nightly else "torch",
"torch==2.8.0" if use_pytorch_release else "torch",
]

# Install the requirements for core ExecuTorch package.
Expand Down Expand Up @@ -129,7 +129,7 @@ def install_requirements(use_pytorch_nightly):
)


def install_optional_example_requirements(use_pytorch_nightly):
def install_optional_example_requirements(use_pytorch_release):
print("Installing packages in requirements-examples.txt")
subprocess.run(
[
Expand All @@ -145,8 +145,8 @@ def install_optional_example_requirements(use_pytorch_nightly):

print("Installing torch domain libraries")
DOMAIN_LIBRARIES = [
("torchvision==0.23.0" if use_pytorch_nightly else "torchvision"),
"torchaudio==2.8.0" if use_pytorch_nightly else "torchaudio",
"torchvision==0.23.0+cpu" if use_pytorch_release else "torchvision",
"torchaudio==2.8.0+cpu" if use_pytorch_release else "torchaudio",
]
# Then install domain libraries
subprocess.run(
Expand All @@ -156,13 +156,10 @@ def install_optional_example_requirements(use_pytorch_nightly):
"pip",
"install",
*DOMAIN_LIBRARIES,
"--extra-index-url",
TORCH_URL,
],
check=True,
)


# Prebuilt binaries for Intel-based macOS are no longer available on PyPI; users must compile from source.
# PyTorch stopped building macOS x86_64 binaries since version 2.3.0 (January 2024).
def is_intel_mac_os():
Expand All @@ -187,10 +184,10 @@ def main(args):
help="Also installs required packages for running example scripts.",
)
args = parser.parse_args(args)
use_pytorch_nightly = not bool(args.use_pt_pinned_commit)
install_requirements(use_pytorch_nightly)
use_pytorch_release = not bool(args.use_pt_pinned_commit)
install_requirements(use_pytorch_release)
if args.example:
install_optional_example_requirements(use_pytorch_nightly)
install_optional_example_requirements(use_pytorch_release)


if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ dependencies=[
"pyyaml",
"ruamel.yaml",
"sympy",
"torch==2.8.0",
"torchao==0.12.0",
"tabulate",
# See also third-party/TARGETS for buck's typing-extensions version.
Expand Down
Loading