Skip to content

Commit e714fed

Browse files
Merge branch 'main' into remove_ChecksNeedsDecomposition
2 parents de0a970 + ce6e2cf commit e714fed

File tree

261 files changed

+12768
-3578
lines changed

Some content is hidden

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

261 files changed

+12768
-3578
lines changed

.ci/docker/requirements-ci.txt

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,21 @@ hypothesis==6.84.2
1616
parameterized==0.9.0
1717

1818
# Doc build requirements, same as https://github.com/pytorch/pytorch/blob/main/.ci/docker/requirements-docs.txt
19-
sphinx==5.3.0
19+
sphinx==7.2.6
20+
sphinxcontrib.katex==0.9.10
21+
breathe==4.36.0 # only if generating C++
22+
exhale==0.3.7 # only if generating C++ docs
23+
docutils==0.18.1,<0.21
24+
sphinx-design==0.6.1
25+
sphinxcontrib-mermaid==1.0.0
26+
myst-parser==3.0.1 # if want to contribute in markdown
27+
sphinx-gallery==0.14.0 # only if hosting interactive tutorials
28+
sphinx-sitemap==2.7.1
2029
sphinx-reredirects==0.1.4
21-
sphinx-gallery==0.14.0
22-
breathe==4.34.0
23-
exhale==0.2.3
24-
docutils==0.16
2530
matplotlib>=3.9.4
31+
sphinx-copybutton==0.5.2
2632
# PyTorch Theme
27-
-e git+https://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme
28-
myst-parser==0.18.1
29-
sphinx_design==0.4.1
30-
sphinx-copybutton==0.5.0
33+
-e git+https://github.com/pytorch/pytorch_sphinx_theme.git@pytorch_sphinx_theme2#egg=pytorch_sphinx_theme2
3134

3235
# script unit test requirements
3336
yaspin==3.1.0

.ci/scripts/test_backend_linux.sh renamed to .ci/scripts/test_backend.sh

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,26 @@ SUITE=$1
1010
FLOW=$2
1111
ARTIFACT_DIR=$3
1212

13-
REPORT_FILE="$ARTIFACT_DIR/test-report-$FLOW-$SUITE.csv"
13+
REPORT_FILE="$ARTIFACT_DIR/test-report-$FLOW-$SUITE.json"
1414

1515
echo "Running backend test job for suite $SUITE, flow $FLOW."
1616
echo "Saving job artifacts to $ARTIFACT_DIR."
1717

18-
# The generic Linux job chooses to use base env, not the one setup by the image
1918
eval "$(conda shell.bash hook)"
2019
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
2120
conda activate "${CONDA_ENV}"
2221

22+
if [[ "$(uname)" == "Darwin" ]]; then
23+
bash .ci/scripts/setup-conda.sh
24+
eval "$(conda shell.bash hook)"
25+
CONDA_RUN_CMD="${CONDA_RUN} --no-capture-output"
26+
${CONDA_RUN_CMD} pip install awscli==1.37.21
27+
IS_MACOS=1
28+
else
29+
CONDA_RUN_CMD=""
30+
IS_MACOS=0
31+
fi
32+
2333
export PYTHON_EXECUTABLE=python
2434

2535
# CMake options to use, in addition to the defaults.
@@ -50,11 +60,14 @@ if [[ "$FLOW" == *arm* ]]; then
5060
.ci/scripts/setup-arm-baremetal-tools.sh
5161
fi
5262

53-
# We need the runner to test the built library.
54-
PYTHON_EXECUTABLE=python CMAKE_ARGS="$EXTRA_BUILD_ARGS" .ci/scripts/setup-linux.sh --build-tool cmake --build-mode Release --editable true
63+
if [[ $IS_MACOS -eq 1 ]]; then
64+
SETUP_SCRIPT=.ci/scripts/setup-macos.sh
65+
else
66+
SETUP_SCRIPT=.ci/scripts/setup-linux.sh
67+
fi
68+
CMAKE_ARGS="$EXTRA_BUILD_ARGS" ${CONDA_RUN_CMD} $SETUP_SCRIPT --build-tool cmake --build-mode Release --editable true
5569

5670
EXIT_CODE=0
57-
python -m executorch.backends.test.suite.runner $SUITE --flow $FLOW --report "$REPORT_FILE" || EXIT_CODE=$?
58-
71+
${CONDA_RUN_CMD} pytest -c /dev/nul -n auto backends/test/suite/$SUITE/ -m flow_$FLOW --json-report --json-report-file="$REPORT_FILE" || EXIT_CODE=$?
5972
# Generate markdown summary.
60-
python -m executorch.backends.test.suite.generate_markdown_summary "$REPORT_FILE" > ${GITHUB_STEP_SUMMARY:-"step_summary.md"} --exit-code $EXIT_CODE
73+
${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_backend_macos.sh

Lines changed: 0 additions & 30 deletions
This file was deleted.

.ci/scripts/test_llama.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ if [[ "${CUSTOM}" == "ON" ]]; then
237237
EXPORT_ARGS="${EXPORT_ARGS} model.use_sdpa_with_kv_cache=true"
238238
fi
239239
if [[ "${QE}" == "ON" ]]; then
240-
EXPORT_ARGS="${EXPORT_ARGS} quantization.embedding_quantize=\"8,1024\""
240+
EXPORT_ARGS="${EXPORT_ARGS} quantization.embedding_quantize=\"8,768\""
241241
fi
242242
if [[ "${MPS}" == "ON" ]]; then
243243
EXPORT_ARGS="${EXPORT_ARGS} backend.mps.enabled=true model.enable_dynamic_shape=false debug.verbose=true"

.ci/scripts/test_torchao_huggingface_checkpoints.sh

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -euxo pipefail
55
# Args / flags
66
# -------------------------
77
TEST_WITH_RUNNER=0
8+
USE_TORCHAO_KERNELS=0
89
MODEL_NAME=""
910

1011
# Parse args
@@ -22,10 +23,14 @@ while [[ $# -gt 0 ]]; do
2223
--test_with_runner)
2324
TEST_WITH_RUNNER=1
2425
;;
26+
--use_torchao_kernels)
27+
USE_TORCHAO_KERNELS=1
28+
;;
2529
-h|--help)
26-
echo "Usage: $0 <model_name> [--test_with_runner]"
30+
echo "Usage: $0 <model_name> [--test_with_runner] [--use_torchao_kernels]"
2731
echo " model_name: qwen3_4b | phi_4_mini"
2832
echo " --test_with_runner: build ET + run llama_main to sanity-check the export"
33+
echo " --use_torchao_kernels: use torchao kernels for linear and tied embedding"
2934
exit 0
3035
;;
3136
*)
@@ -42,6 +47,13 @@ fi
4247

4348
MODEL_OUT=model.pte
4449

50+
51+
# Default to XNNPACK
52+
BACKEND_ARGS="-X --xnnpack-extended-ops"
53+
if [[ "$USE_TORCHAO_KERNELS" -eq 1 ]]; then
54+
BACKEND_ARGS="--use-torchao-kernels"
55+
fi
56+
4557
case "$MODEL_NAME" in
4658
qwen3_4b)
4759
echo "Running Qwen3-4B export..."
@@ -58,12 +70,12 @@ case "$MODEL_NAME" in
5870
--output_name $MODEL_OUT \
5971
-kv \
6072
--use_sdpa_with_kv_cache \
61-
-X \
62-
--xnnpack-extended-ops \
6373
--max_context_length 1024 \
6474
--max_seq_length 1024 \
75+
--metadata '{"get_bos_id":199999, "get_eos_ids":[200020,199999]}' \
76+
--verbose \
6577
--dtype fp32 \
66-
--metadata '{"get_bos_id":199999, "get_eos_ids":[200020,199999]}'
78+
${BACKEND_ARGS}
6779
;;
6880

6981
phi_4_mini)
@@ -81,12 +93,12 @@ case "$MODEL_NAME" in
8193
--output_name $MODEL_OUT \
8294
-kv \
8395
--use_sdpa_with_kv_cache \
84-
-X \
85-
--xnnpack-extended-ops \
8696
--max_context_length 1024 \
8797
--max_seq_length 1024 \
98+
--metadata '{"get_bos_id":199999, "get_eos_ids":[200020,199999]}' \
99+
--verbose \
88100
--dtype fp32 \
89-
--metadata '{"get_bos_id":199999, "get_eos_ids":[200020,199999]}'
101+
${BACKEND_ARGS}
90102
;;
91103

92104
*)
@@ -104,6 +116,10 @@ if [[ $MODEL_SIZE -gt $EXPECTED_MODEL_SIZE_UPPER_BOUND ]]; then
104116
fi
105117

106118
# Install ET with CMake
119+
EXECUTORCH_BUILD_KERNELS_TORCHAO="OFF"
120+
if [[ "$USE_TORCHAO_KERNELS" -eq 1 ]]; then
121+
EXECUTORCH_BUILD_KERNELS_TORCHAO="ON"
122+
fi
107123
if [[ "$TEST_WITH_RUNNER" -eq 1 ]]; then
108124
echo "[runner] Building and testing llama_main ..."
109125
cmake -DPYTHON_EXECUTABLE=python \
@@ -120,6 +136,7 @@ if [[ "$TEST_WITH_RUNNER" -eq 1 ]]; then
120136
-DEXECUTORCH_BUILD_EXTENSION_LLM_RUNNER=ON \
121137
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
122138
-DEXECUTORCH_BUILD_KERNELS_LLM=ON \
139+
-DEXECUTORCH_BUILD_KERNELS_TORCHAO=${EXECUTORCH_BUILD_KERNELS_TORCHAO} \
123140
-Bcmake-out .
124141
cmake --build cmake-out -j16 --config Release --target install
125142

.github/workflows/_test_backend.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
script: |
5858
set -eux
5959
60-
source .ci/scripts/test_backend_linux.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}"
60+
source .ci/scripts/test_backend.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}"
6161
6262
test-backend-macos:
6363
if: ${{ inputs.run-macos }}
@@ -81,4 +81,4 @@ jobs:
8181
# This is needed to get the prebuilt PyTorch wheel from S3
8282
${CONDA_RUN} --no-capture-output pip install awscli==1.37.21
8383
84-
source .ci/scripts/test_backend_macos.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}"
84+
source .ci/scripts/test_backend.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}"

.github/workflows/add-unanswered-to-project.yml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,39 @@ jobs:
1212
- name: Add open issues and open, non-draft PRs to org project (excluding certain authors)
1313
uses: actions/github-script@v7
1414
with:
15+
github-token: ${{ secrets.ET_EXT_CONTRIB }}
1516
script: |
1617
const projectId = "PVT_kwDOAUB9vs4A_PUL"; // PyTorch org project 136
1718
const owner = 'pytorch';
1819
const repo = 'executorch';
1920
2021
// List of authors to exclude
2122
const excludedAuthors = new Set([
22-
"nil-is-all", "cbilgin", "KimishPatel", "psiddh", "digantdesai", "SS-JIA", "ahmtox", "mcr229", "shoumikhin",
23+
"nil-is-all", "cbilgin", "kimishpatel", "psiddh", "digantdesai", "SS-JIA", "ahmtox", "mcr229", "shoumikhin",
2324
"manuelcandales", "metascroy", "cccclai", "rohansjoshi", "kirklandsign", "abhinaykukkadapu", "JacobSzwejbka",
2425
"Conarnar", "lucylq", "larryliu0820", "BujSet", "Gasoonjia", "Juntian777", "guangy10", "jackzhxng",
2526
"GregoryComer", "leafs1", "swolchok", "mergennachin", "tarun292", "byjlw", "jathu", "Jack-Khuu", "georgehong",
26-
"zhenyan-zhang-meta", "silverguo", "dbort", "jorgep31415", "huydhn", "mcremon-meta", "trivedivivek", "angelayi",
27-
"helunwencser", "hsharma35", "zhxchen17", "iseeyuan", "svekars", "nathanaelsee", "dulinriley", "jerryzh168",
27+
"zhenyan-zhang-meta", "silverguo", "harishs88ss", "AlannaBurke", "dbort", "huydhn", "mcremon-meta", "trivedivivek",
28+
"angelayi", "helunwencser", "hsharma35", "zhxchen17", "iseeyuan", "svekars", "nathanaelsee", "dulinriley", "jerryzh168",
2829
"cmodi-meta", "bigfootjon", "sxu", "ydwu4", "Riandy", "tugsbayasgalan", "bsoyluoglu", "yangw-dev", "YIWENX14",
2930
"namanahuja", "yushangdi", "limintang", "pianpwk", "viveknayakatmeta", "andreanicastro", "JakeStevens",
30-
"gmagogsfm", "zonglinpeng", "eigen-k", "derekxu", "salilsdesai", "skrtskrtfb", "pssrawat", "r-barnes", "pytorchbot",
31-
"pytorchmergebot", "pytorchupdatebot", "facebook-github-bot", "Erik-Lundell", "zingo", "AdrianLundell",
32-
"oscarandersson8218", "per", "Sebastian-Larsson", "SaoirseARM", "robell", "mansnils", "martinlsm", "freddan80",
33-
"YufengShi-dudu", "tom-arm", "perheld", "Jerry-Ge", "gggekov", "fumchin", "wwwind", "haowhsu-quic", "shewu-quic",
34-
"winskuo-quic", "chunit-quic", "DannyYuyang-quic", "chuntl", "cymbalrush", "DenisVieriu97", "billmguo",
35-
"StrycekSimon", "jirioc", "robert-kalmar", "skywall", "neuropilot-captain"
31+
"gmagogsfm", "zonglinpeng", "eigen-k", "derekxu", "salilsdesai", "skrtskrtfb", "pssrawat", "r-barnes",
32+
"kalpit-meta-1", "Will-MingLun-Li", "KapJI", "piyengar", "j-bahr", "BoyuanFeng", "fgasperij", "DariusHolmgren",
33+
"sammarden-meta", "kushrast", "meta-emilian", "Rittzz", "jeanschmidt", "copyrightly", "mikekgfb", "vmpuri",
34+
"zonglinpengmeta", "maggiemoss", "aorenste", "hoangminhle98", "Solumin", "meyering", "rchen152",
35+
"AishwaryaSivaraman", "migeed-z", "ebgraham", "Esteb37", "nausicaasnow", "Camyll", "ezyang", "huiyujie",
36+
"dltn", "cjhopman", "blackm00n", "agunapal", "SamGondelman", "Ninja91", "ivayloen", "DrJessop", "rodrigos01meta",
37+
"akrieger", "cmt0", "yiming0416", "ethansfng", "ThomasJannaud", "nirvanagth", "marcinkwiatkowski", "3l1",
38+
"omerjerk", "nitish2112", "yipjustin", "ejnguyen", "andrewor14", "phaiting", "mgiordy", "LeeOHzzZ", "adicatana",
39+
"Polyomino", "ezrilow", "navsud", "YifanShenSZ", "RdoubleA", "Olivia-liu", "Abhi-hpp", "Vysarat", "azad-meta",
40+
"pytorchbot", "pytorchmergebot", "pytorchupdatebot", "facebook-github-bot", "app/dependabot", "Erik-Lundell",
41+
"zingo", "AdrianLundell", "oscarandersson8218", "per", "Sebastian-Larsson", "SaoirseARM", "robell", "mansnils",
42+
"martinlsm", "freddan80", "YufengShi-dudu", "tom-arm", "perheld", "Jerry-Ge", "gggekov", "fumchin", "wwwind",
43+
"benkli01", "Tessil", "maddun01", "Michiel-Olieslagers", "armwaheed", "agrima1304", "emmakujala", "annietllnd",
44+
"haowhsu-quic", "shewu-quic", "winskuo-quic", "chunit-quic", "DannyYuyang-quic", "chuntl", "thchenqti",
45+
"jethroqti", "cymbalrush", "DenisVieriu97", "billmguo", "StrycekSimon", "jirioc", "robert-kalmar", "skywall",
46+
"MartinPavella", "roman-janik-nxp", "novak-vaclav ", "neuropilot-captain", "dijopaul", "cad-rlc", "cad-audio",
47+
"ynimmaga", "daniil-lyakhov", "emmanuel-ferdman", "cavusmustafa", "Jiseong-oh", "alexdean08"
3648
]);
3749
3850
async function addItem(contentId, type, number) {
@@ -79,11 +91,10 @@ jobs:
7991
owner,
8092
repo,
8193
state: 'open',
82-
draft: false,
8394
}
8495
);
8596
for (const pr of prs) {
86-
if (!excludedAuthors.has(pr.user.login)) {
97+
if (!pr.draft && !excludedAuthors.has(pr.user.login)) {
8798
await addItem(pr.node_id, 'pr', pr.number);
8899
}
89100
}

.github/workflows/docker-builds.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
runner: [linux.2xlarge]
34+
runner: [linux.4xlarge]
3535
docker-image-name: [
3636
executorch-ubuntu-22.04-gcc9,
3737
executorch-ubuntu-22.04-clang12,

.github/workflows/pull.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,8 +746,8 @@ jobs:
746746
# Install llama requirements
747747
bash examples/models/llama/install_requirements.sh
748748
749-
# install a recent version of torchtune.
750-
PYTHON_EXECUTABLE=python python -m pip install torchtune==0.7.0.dev20250730 --extra-index-url https://download.pytorch.org/whl/nightly/cpu
749+
# install a recent version of torchtune (>= 20250730)
750+
PYTHON_EXECUTABLE=python python -m pip install torchtune==0.7.0.dev20250929 --extra-index-url https://download.pytorch.org/whl/nightly/cpu
751751
752752
# run llama runner in eager mode
753753
PYTHON_EXECUTABLE=python bash .ci/scripts/test_llama_lora.sh
@@ -1010,6 +1010,7 @@ jobs:
10101010
./cmake-out/backends/vulkan/test/custom_ops/q4gsw_linear
10111011
./cmake-out/backends/vulkan/test/custom_ops/choose_qparams_per_row
10121012
./cmake-out/backends/vulkan/test/custom_ops/qdq8ta_conv2d_activations
1013+
./cmake-out/backends/vulkan/test/custom_ops/q8ta_q8ta_q8to_add
10131014
10141015
# "Classic" Operator tests
10151016
PYTHON_EXECUTABLE=python bash backends/vulkan/test/scripts/test_op.sh --build

.github/workflows/trunk.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -594,15 +594,22 @@ jobs:
594594
strategy:
595595
matrix:
596596
model: [qwen3_4b, phi_4_mini]
597+
runner: [linux.2xlarge]
598+
docker-image: [executorch-ubuntu-22.04-clang12]
599+
backend: [xnnpack]
597600
include:
598601
- model: qwen3_4b
599-
test_with_runner: true
602+
runner: linux.arm64.2xlarge
603+
docker-image: executorch-ubuntu-22.04-gcc11-aarch64
604+
backend: torchao
600605
- model: phi_4_mini
601-
test_with_runner: false
606+
runner: linux.arm64.2xlarge
607+
docker-image: executorch-ubuntu-22.04-gcc11-aarch64
608+
backend: torchao
602609
fail-fast: false
603610
with:
604-
runner: linux.2xlarge
605-
docker-image: ci-image:executorch-ubuntu-22.04-clang12
611+
runner: ${{ matrix.runner }}
612+
docker-image: ci-image:${{ matrix.docker-image }}
606613
submodules: 'recursive'
607614
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
608615
timeout: 900
@@ -612,9 +619,14 @@ jobs:
612619
conda activate "${CONDA_ENV}"
613620
614621
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool cmake
622+
623+
if [[ "${{ matrix.backend }}" == "torchao" ]]; then
624+
BUILD_TORCHAO_EXPERIMENTAL=1 TORCHAO_BUILD_CPU_AARCH64=1 TORCHAO_BUILD_KLEIDIAI=1 TORCHAO_ENABLE_ARM_NEON_DOT=1 TORCHAO_PARALLEL_BACKEND=OPENMP pip install third-party/ao
625+
fi
626+
615627
pip install -U "huggingface_hub[cli]"
616628
617-
bash .ci/scripts/test_torchao_huggingface_checkpoints.sh ${{ matrix.model }} ${{ matrix.test_with_runner && '--test_with_runner' || '' }}
629+
bash .ci/scripts/test_torchao_huggingface_checkpoints.sh ${{ matrix.model }} ${{ matrix.model != 'phi_4_mini' && '--test_with_runner' || '' }} ${{ matrix.backend == 'torchao' && '--use_torchao_kernels' || '' }}
618630
619631
test-multimodal-macos:
620632
if: ${{ !github.event.pull_request.head.repo.fork }}

0 commit comments

Comments
 (0)