Skip to content

Commit 096d218

Browse files
authored
Merge branch 'main' into docathon/fix-broken-include-paths
2 parents 63a3c80 + 12c1195 commit 096d218

609 files changed

Lines changed: 28584 additions & 6394 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ci/docker/build.sh

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,6 @@ esac
9292
TORCH_VERSION=$(cat ci_commit_pins/pytorch.txt)
9393
BUILD_DOCS=1
9494

95-
# Pull channel + spec/url helpers out of torch_pin.py so install_pytorch.sh
96-
# (which runs inside the docker build, where torch_pin.py isn't available)
97-
# can decide between wheel install (test/release) and source build (nightly).
98-
# Self-hosted runners often have python3 but not the unversioned python alias.
99-
PYTHON_BIN=$(command -v python3 || command -v python)
100-
TORCH_PIN_HELPERS=$(cd ../.. && "$PYTHON_BIN" -c "from torch_pin import CHANNEL, torch_spec, torchaudio_spec, torchvision_spec, torch_index_url_base; print(CHANNEL); print(torch_spec()); print(torchaudio_spec()); print(torchvision_spec()); print(torch_index_url_base())")
101-
TORCH_CHANNEL=$(echo "${TORCH_PIN_HELPERS}" | sed -n '1p')
102-
TORCH_SPEC=$(echo "${TORCH_PIN_HELPERS}" | sed -n '2p')
103-
TORCHAUDIO_SPEC=$(echo "${TORCH_PIN_HELPERS}" | sed -n '3p')
104-
TORCHVISION_SPEC=$(echo "${TORCH_PIN_HELPERS}" | sed -n '4p')
105-
TORCH_INDEX_URL=$(echo "${TORCH_PIN_HELPERS}" | sed -n '5p')
106-
10795
# Copy requirements-lintrunner.txt from root to here
10896
cp ../../requirements-lintrunner.txt ./
10997

@@ -116,11 +104,6 @@ docker build \
116104
--build-arg "PYTHON_VERSION=${PYTHON_VERSION}" \
117105
--build-arg "MINICONDA_VERSION=${MINICONDA_VERSION}" \
118106
--build-arg "TORCH_VERSION=${TORCH_VERSION}" \
119-
--build-arg "TORCH_CHANNEL=${TORCH_CHANNEL}" \
120-
--build-arg "TORCH_SPEC=${TORCH_SPEC}" \
121-
--build-arg "TORCHAUDIO_SPEC=${TORCHAUDIO_SPEC}" \
122-
--build-arg "TORCHVISION_SPEC=${TORCHVISION_SPEC}" \
123-
--build-arg "TORCH_INDEX_URL=${TORCH_INDEX_URL}" \
124107
--build-arg "BUCK2_VERSION=${BUCK2_VERSION}" \
125108
--build-arg "LINTRUNNER=${LINTRUNNER:-}" \
126109
--build-arg "BUILD_DOCS=${BUILD_DOCS}" \
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
release/2.11
1+
release/2.11

.ci/docker/common/install_pytorch.sh

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,6 @@ install_domains() {
1717
}
1818

1919
install_pytorch_and_domains() {
20-
if [ "${TORCH_CHANNEL}" != "nightly" ]; then
21-
# Test/release: install the published wheels directly. The specs and URL
22-
# are passed in as docker build args (computed from torch_pin.py by
23-
# .ci/docker/build.sh). RC wheels at /whl/test/ get re-uploaded under the
24-
# same version, so use --no-cache-dir there to avoid stale cache hits.
25-
local cache_flag=""
26-
if [ "${TORCH_CHANNEL}" = "test" ]; then
27-
cache_flag="--no-cache-dir"
28-
fi
29-
pip_install --force-reinstall ${cache_flag} \
30-
"${TORCH_SPEC}" "${TORCHVISION_SPEC}" "${TORCHAUDIO_SPEC}" \
31-
--index-url "${TORCH_INDEX_URL}/cpu"
32-
return
33-
fi
34-
35-
# Nightly: build pytorch from source against the pinned SHA in pytorch.txt
36-
# so we catch upstream regressions, then install audio/vision from the
37-
# commits that pytorch itself pins.
3820
git clone https://github.com/pytorch/pytorch.git
3921

4022
# Fetch the target commit
@@ -45,19 +27,14 @@ install_pytorch_and_domains() {
4527
chown -R ci-user .
4628

4729
export _GLIBCXX_USE_CXX11_ABI=1
48-
# PyTorch's FindARM.cmake hard-fails when the SVE+BF16 compile probe
49-
# doesn't pass — gcc-11 in this image is too old to accept the combined
50-
# NEON/SVE/bfloat16 intrinsics the probe exercises. Executorch's aarch64
51-
# runtime targets (phones, embedded) don't use SVE, so bypass the check.
52-
export BUILD_IGNORE_SVE_UNAVAILABLE=1
5330
# Then build and install PyTorch
5431
conda_run python setup.py bdist_wheel
5532
pip_install "$(echo dist/*.whl)"
5633

57-
# Defer to PyTorch's own pinned audio/vision commits.
58-
TORCHAUDIO_VERSION=$(cat .github/ci_commit_pins/audio.txt)
34+
# Grab the pinned audio and vision commits from PyTorch
35+
TORCHAUDIO_VERSION=release/2.11
5936
export TORCHAUDIO_VERSION
60-
TORCHVISION_VERSION=$(cat .github/ci_commit_pins/vision.txt)
37+
TORCHVISION_VERSION=release/0.26
6138
export TORCHVISION_VERSION
6239

6340
install_domains

.ci/docker/ubuntu/Dockerfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@ ENV SCCACHE_S3_KEY_PREFIX executorch
6464
ENV SCCACHE_REGION us-east-1
6565

6666
ARG TORCH_VERSION
67-
ARG TORCH_CHANNEL
68-
ARG TORCH_SPEC
69-
ARG TORCHAUDIO_SPEC
70-
ARG TORCHVISION_SPEC
71-
ARG TORCH_INDEX_URL
7267
ARG SKIP_PYTORCH
7368
COPY ./common/install_pytorch.sh install_pytorch.sh
7469
COPY ./common/utils.sh utils.sh

.ci/scripts/download_hf_hub.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/bash
22

3+
# Disable HF Xet storage to avoid stalled downloads on CI runners
4+
export HF_HUB_DISABLE_XET=1
5+
36
# Function to download files from the Hugging Face Hub
47
# Arguments:
58
# 1. model_id: The Hugging Face repository ID (e.g., "organization/model_name")

.ci/scripts/export_model_artifact.sh

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ if [ -z "${1:-}" ]; then
6767
exit 1
6868
fi
6969

70+
# Disable HF Xet storage to avoid stalled downloads on CI runners
71+
export HF_HUB_DISABLE_XET=1
72+
7073
set -eux
7174

7275
DEVICE="$1"
@@ -415,14 +418,40 @@ if [ "$MODEL_NAME" = "qwen3_5_moe" ]; then
415418

416419
# Export to .pte/.ptd (short cache dir avoids objcopy symbol length issues)
417420
echo "::group::Export"
421+
EXPORT_LOG=$(mktemp)
418422
TORCHINDUCTOR_CACHE_DIR="$INDUCTOR_CACHE" \
419423
python -m executorch.examples.models.qwen3_5_moe.export \
420424
--prequantized "$LOCAL_MODEL_DIR" \
421425
--output-dir "${OUTPUT_DIR}" \
422426
--dense-prefill dequant \
423-
--moe-activation-dtype int8
427+
--moe-activation-dtype int8 2>&1 | tee "$EXPORT_LOG"
428+
EXPORT_RC=${PIPESTATUS[0]}
424429
echo "::endgroup::"
425430

431+
if [ "$EXPORT_RC" -ne 0 ]; then
432+
echo "ERROR: Qwen3.5 MoE export failed (exit $EXPORT_RC)"
433+
rm -f "$EXPORT_LOG"
434+
exit "$EXPORT_RC"
435+
fi
436+
437+
# Gate peak GPU memory so we keep the export viable on consumer GPUs
438+
# (e.g. RTX 4090 with 24 GB). The export script prints a machine-
439+
# parseable marker line "EXPORT_GPU_PEAK_MEMORY_MB: <float>".
440+
EXPORT_GPU_PEAK_MB_LIMIT="${EXPORT_GPU_PEAK_MB_LIMIT:-20480}"
441+
PEAK_LINE=$(grep -E '^EXPORT_GPU_PEAK_MEMORY_MB:' "$EXPORT_LOG" | tail -1)
442+
rm -f "$EXPORT_LOG"
443+
if [ -z "$PEAK_LINE" ]; then
444+
echo "ERROR: export did not emit EXPORT_GPU_PEAK_MEMORY_MB marker; cannot enforce GPU memory budget"
445+
exit 1
446+
fi
447+
PEAK_MB=$(echo "$PEAK_LINE" | awk '{print $2}')
448+
echo "Export GPU peak memory: ${PEAK_MB} MB (limit ${EXPORT_GPU_PEAK_MB_LIMIT} MB)"
449+
if awk -v p="$PEAK_MB" -v l="$EXPORT_GPU_PEAK_MB_LIMIT" 'BEGIN{exit !(p>l)}'; then
450+
echo "ERROR: export exceeded GPU memory budget (${PEAK_MB} MB > ${EXPORT_GPU_PEAK_MB_LIMIT} MB)"
451+
echo " — this would prevent the model from being exported on a 24 GB consumer GPU."
452+
exit 1
453+
fi
454+
426455
test -f "${OUTPUT_DIR}/model.pte"
427456
test -f "${OUTPUT_DIR}/aoti_cuda_blob.ptd"
428457
ls -al "${OUTPUT_DIR}"

.ci/scripts/setup-macos.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ setup_macos_env_variables
116116
# buck2 atm
117117
install_buck
118118
brew install libomp
119-
install_pip_dependencies
120119

121120
# TODO(huydhn): Unlike our self-hosted runner, GitHub runner doesn't have access
122121
# to our infra, so compiler caching needs to be setup differently using GitHub
@@ -125,10 +124,17 @@ if [[ -z "${GITHUB_RUNNER:-}" ]]; then
125124
install_sccache
126125
fi
127126

127+
# Install pinned torch before requirements-ci.txt so torchsr's transitive
128+
# torch dep is satisfied by the existing install and pip does not pull a
129+
# separate copy from PyPI. sccache is initialized above so source-build
130+
# cache misses still hit the cache.
128131
print_cmake_info
129132
install_pytorch_and_domains
130-
# We build PyTorch from source here instead of using nightly. This allows CI to test against
131-
# the pinned commit from PyTorch
133+
134+
install_pip_dependencies
135+
136+
# install_executorch's --use-pt-pinned-commit skips re-installing torch since
137+
# install_pytorch_and_domains already installed the pinned build above.
132138
if [[ "$EDITABLE" == "true" ]]; then
133139
install_executorch --use-pt-pinned-commit --editable
134140
else

.ci/scripts/test_backend.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export PYTHON_EXECUTABLE=python
3535

3636
# CMake options to use, in addition to the defaults.
3737
EXTRA_BUILD_ARGS=""
38+
PYTEST_RETRY_ARGS=()
3839

3940
if [[ "$FLOW" == *qnn* ]]; then
4041
# Setup QNN sdk and deps - note that this is a bit hacky due to the nature of the
@@ -57,6 +58,9 @@ if [[ "$FLOW" == *vulkan* ]]; then
5758
fi
5859

5960
if [[ "$FLOW" == *arm* ]]; then
61+
if [[ "$SUITE" == "operators" ]]; then
62+
PYTEST_RETRY_ARGS=(--reruns 2 --reruns-delay 1)
63+
fi
6064

6165
# Setup ARM deps.
6266
if [[ "$FLOW" == *vgf* ]]; then
@@ -95,6 +99,11 @@ GOLDEN_DIR="${ARTIFACT_DIR}/golden-artifacts"
9599
export GOLDEN_ARTIFACTS_DIR="${GOLDEN_DIR}"
96100

97101
EXIT_CODE=0
98-
${CONDA_RUN_CMD} pytest -c /dev/null -n auto backends/test/suite/$SUITE/ -m flow_$FLOW --json-report --json-report-file="$REPORT_FILE" || EXIT_CODE=$?
102+
PYTEST_ARGS=(-c /dev/null -n auto)
103+
if [[ ${#PYTEST_RETRY_ARGS[@]} -gt 0 ]]; then
104+
PYTEST_ARGS+=("${PYTEST_RETRY_ARGS[@]}")
105+
fi
106+
PYTEST_ARGS+=("backends/test/suite/$SUITE/" -m "flow_$FLOW" --json-report --json-report-file="$REPORT_FILE")
107+
${CONDA_RUN_CMD} pytest "${PYTEST_ARGS[@]}" || EXIT_CODE=$?
99108
# Generate markdown summary.
100109
${CONDA_RUN_CMD} python -m executorch.backends.test.suite.generate_markdown_summary_json "$REPORT_FILE" > ${GITHUB_STEP_SUMMARY:-"step_summary.md"} --exit-code $EXIT_CODE

.ci/scripts/test_coreml_bc.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ source "${REPO_ROOT}/.ci/scripts/utils.sh"
2323
# Create a conda environment with Python 3.10 for compatibility with old ET versions
2424
# ET 1.0.0 only supports Python >=3.10,<3.13
2525
CONDA_ENV_NAME="coreml_bc_test_env"
26-
conda create -y -n "${CONDA_ENV_NAME}" python=3.10
26+
conda create -y -n "${CONDA_ENV_NAME}" python=3.10 pip packaging
2727

2828
# Use conda run to execute commands in the new environment
2929
CONDA_RUN="conda run --no-capture-output -n ${CONDA_ENV_NAME}"
@@ -69,7 +69,7 @@ git submodule sync --recursive
6969
git submodule update --init --recursive
7070

7171
# Install executorch
72-
${CONDA_RUN} pip install --upgrade pip
72+
${CONDA_RUN} python -m pip install --upgrade pip
7373
${CONDA_RUN} python install_executorch.py
7474

7575
# Step 3: Export model
@@ -129,7 +129,7 @@ git submodule update --init --recursive
129129

130130
# Step 5: Install current version
131131
echo "=== Step 5: Installing current ET version ==="
132-
${CONDA_RUN} pip install --upgrade pip
132+
${CONDA_RUN} python -m pip install --upgrade pip
133133
${CONDA_RUN} python install_executorch.py
134134

135135
# Step 6: Run the old pte file

.ci/scripts/test_cortex_m_e2e.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ MODEL=$1
1717
script_dir=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
1818
et_root_dir=$(realpath "${script_dir}/../..")
1919

20-
# Quantization is the default for the cortex-m55+int8 target; run.sh's
20+
# Quantization is the default for the cortex-m55 target; run.sh's
2121
# arg parser only recognizes --no_quantize, so we omit any explicit flag.
2222
bash "${et_root_dir}/examples/arm/run.sh" \
2323
--model_name="${MODEL}" \
24-
--target=cortex-m55+int8 \
24+
--target=cortex-m55 \
2525
--bundleio

0 commit comments

Comments
 (0)