Skip to content

Commit 1736310

Browse files
authored
Merge branch 'main' into update_tokenizer_pin_2
2 parents 14c6958 + 082b62b commit 1736310

451 files changed

Lines changed: 16271 additions & 5180 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.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
de4f3c4978b4d36cc0bb8f87c6877a4a040d7ae7
1+
732b11313b2006b4d8649500eaf5567ec6ac1e49
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7a064ed3eafa43f17412d434b395240c727b3000
1+
7a79b41e29a790ebb4b530eb98a89381e2d7de29

.ci/scripts/setup-samsung-linux-deps.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ install_devicefarm_cli() {
101101
}
102102

103103
reserve_if_needed() {
104+
# Set default value
105+
export DEVICE_RESERVED=0
106+
104107
if ! command -v devicefarm-cli >/dev/null 2>&1; then
105108
echo "[WARN] devicefarm-cli is not installed." >&2
106109
return 1
@@ -144,7 +147,11 @@ reserve_if_needed() {
144147

145148
if (( any_below_threshold )); then
146149
echo "[INFO] Reserving now."
147-
devicefarm-cli -R
150+
if ! devicefarm-cli -R; then
151+
echo "::warning::Failed to reserve a device. No devices are currently available." >&2
152+
echo "[WARN] Device reservation failed - continuing without device." >&2
153+
return 0
154+
fi
148155
else
149156
echo "[INFO] Don't need to be reserved."
150157
fi
@@ -174,7 +181,10 @@ reserve_if_needed() {
174181
if [[ -n "$reservation_id" ]]; then
175182
devicefarm-cli -C "$reservation_id"
176183
devicefarm-cli -E "ls /"
184+
export DEVICE_RESERVED=1
185+
echo "[INFO] Device successfully reserved and connected."
177186
else
187+
echo "::warning::No available devices found." >&2
178188
echo "[WARN] There is no available devices."
179189
fi
180190
}

.ci/scripts/wheel/test_windows.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ def test_model_xnnpack(model: Model, quantize: bool) -> None:
3030

3131
if quantize:
3232
quant_type = MODEL_NAME_TO_OPTIONS[str(model)].quantization
33-
model_instance = torch.export.export_for_training(
34-
model_instance, example_inputs
35-
)
33+
model_instance = torch.export.export(model_instance, example_inputs)
3634
model_instance = quantize_xnn(
3735
model_instance.module(), example_inputs, quant_type
3836
)

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

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@ name: Add Open External Contributor PRs and Issues to PyTorch Org Project 136
22

33
on:
44
workflow_dispatch:
5-
pull_request:
6-
paths:
7-
.github/workflows/add-unanswered-to-project.yml
5+
schedule:
6+
# GitHub Actions cron uses UTC. These run at:
7+
# - 14:00 UTC -> 08:00 CST (UTC-6)
8+
# - 19:00 UTC -> 13:00 CST (UTC-6)
9+
- cron: "0 14 * * *"
10+
- cron: "0 19 * * *"
11+
pull_request:
12+
paths:
13+
- .github/workflows/add-unanswered-to-project.yml
814
jobs:
915
add_to_project:
1016
runs-on: ubuntu-latest
1117
steps:
12-
- name: Add open issues and open, non-draft PRs to org project (excluding certain authors)
18+
- name: Add open issues and open, non-draft PRs to org project (excluding certain authors and bots)
1319
uses: actions/github-script@v7
1420
with:
1521
github-token: ${{ secrets.ET_EXT_CONTRIB }}
@@ -41,13 +47,26 @@ jobs:
4147
"app/dependabot", "Erik-Lundell", "zingo", "AdrianLundell", "oscarandersson8218", "per", "Sebastian-Larsson", "SaoirseARM",
4248
"robell", "mansnils", "martinlsm", "freddan80", "YufengShi-dudu", "tom-arm", "perheld", "Jerry-Ge", "gggekov", "fumchin",
4349
"wwwind", "benkli01", "Tessil", "maddun01", "Michiel-Olieslagers", "armwaheed", "agrima1304", "emmakujala", "annietllnd",
44-
"MatthiasHertel80", "AlexTawseArm", "jmahbs", "morgolock", "Christoffer-JL", "ArmRyan", "xingguo01", "haowhsu-quic",
45-
"shewu-quic", "winskuo-quic", "chunit-quic", "DannyYuyang-quic", "chuntl", "thchenqti", "jethroqti", "chenweng-quic",
46-
"cymbalrush", "DenisVieriu97", "billmguo", "StrycekSimon", "jirioc", "robert-kalmar", "skywall", "MartinPavella",
47-
"roman-janik-nxp", "novak-vaclav ", "neuropilot-captain", "dijopaul", "cad-rlc", "cad-audio", "ynimmaga", "daniil-lyakhov",
48-
"emmanuel-ferdman", "cavusmustafa", "anzr299", "Jiseong-oh", "alexdean08"
50+
"MatthiasHertel80", "AlexTawseArm", "jmahbs", "morgolock", "Christoffer-JL", "ArmRyan", "xingguo01", "tgonzalezorlandoarm",
51+
"haowhsu-quic", "shewu-quic", "winskuo-quic", "chunit-quic", "DannyYuyang-quic", "chuntl", "thchenqti", "jethroqti",
52+
"chenweng-quic", "cymbalrush", "DenisVieriu97", "billmguo", "StrycekSimon", "jirioc", "robert-kalmar", "skywall",
53+
"MartinPavella", "roman-janik-nxp", "novak-vaclav", "neuropilot-captain", "dijopaul", "cad-rlc", "cad-audio", "ynimmaga",
54+
"daniil-lyakhov", "emmanuel-ferdman", "cavusmustafa", "anzr299", "Jiseong-oh", "alexdean08",
55+
// explicitly include the dependabot bot login seen in PRs
56+
"dependabot[bot]"
4957
]);
5058
59+
function isBotOrExcluded(user) {
60+
if (!user) return false;
61+
// GitHub sometimes marks bots with user.type === "Bot"
62+
if (user.type && user.type.toLowerCase() === "bot") return true;
63+
// Some bots use logins that end with [bot], e.g. dependabot[bot]
64+
if (user.login && user.login.endsWith("[bot]")) return true;
65+
// Explicit excluded list
66+
if (excludedAuthors.has(user.login)) return true;
67+
return false;
68+
}
69+
5170
async function addItem(contentId, type, number) {
5271
try {
5372
await github.graphql(`
@@ -69,7 +88,7 @@ jobs:
6988
}
7089
7190
try {
72-
// Add open issues (not PRs) and exclude by author
91+
// Add open issues (not PRs) and exclude by author/bots
7392
const issues = await github.paginate(
7493
github.rest.issues.listForRepo,
7594
{
@@ -80,12 +99,14 @@ jobs:
8099
}
81100
);
82101
for (const issue of issues) {
83-
if (!issue.pull_request && !excludedAuthors.has(issue.user.login)) {
102+
if (!issue.pull_request && !isBotOrExcluded(issue.user)) {
84103
await addItem(issue.node_id, 'issue', issue.number);
104+
} else {
105+
console.log(`Skipping issue #${issue.number} by ${issue.user && issue.user.login}`);
85106
}
86107
}
87108
88-
// Add open, non-draft PRs (regardless of review state), exclude by author
109+
// Add open, non-draft PRs (regardless of review state), exclude by author/bots
89110
const prs = await github.paginate(
90111
github.rest.pulls.list,
91112
{
@@ -95,8 +116,10 @@ jobs:
95116
}
96117
);
97118
for (const pr of prs) {
98-
if (!pr.draft && !excludedAuthors.has(pr.user.login)) {
119+
if (!pr.draft && !isBotOrExcluded(pr.user)) {
99120
await addItem(pr.node_id, 'pr', pr.number);
121+
} else {
122+
console.log(`Skipping PR #${pr.number} by ${pr.user && pr.user.login}`);
100123
}
101124
}
102125
} catch (error) {

.github/workflows/cuda.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,36 @@ jobs:
8787
export LD_LIBRARY_PATH=/opt/conda/lib:$LD_LIBRARY_PATH
8888
PYTHON_EXECUTABLE=python source .ci/scripts/test_model.sh "${{ matrix.model }}" cmake cuda
8989
90+
unittest-cuda:
91+
name: unittest-cuda
92+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
93+
permissions:
94+
id-token: write
95+
contents: read
96+
with:
97+
timeout: 90
98+
runner: linux.g5.4xlarge.nvidia.gpu
99+
gpu-arch-type: cuda
100+
gpu-arch-version: 12.6
101+
use-custom-docker-registry: false
102+
submodules: recursive
103+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
104+
script: |
105+
set -eux
106+
# Install executorch in editable mode so custom op libs land in-tree
107+
bash ./install_executorch.sh
108+
109+
# Build ExecuTorch with CUDA support
110+
cmake --workflow --preset llm-release-cuda
111+
112+
# Build and run CUDA shim tests (C++)
113+
pushd backends/cuda/runtime/shims/tests
114+
cmake --workflow --preset default
115+
popd
116+
117+
# Run CUDA backend Python tests, overrides addopts so that we don't run all tests in pytest.ini
118+
python -m pytest backends/cuda/tests backends/cuda/passes/tests -v -o "addopts="
119+
90120
export-model-cuda-artifact:
91121
name: export-model-cuda-artifact
92122
# Skip this job if the pull request is from a fork (HuggingFace secrets are not available)

.github/workflows/pull.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -490,17 +490,19 @@ jobs:
490490
build-tool: buck2
491491
docker-image: ci-image:executorch-ubuntu-22.04-clang12
492492

493-
unittest-arm-backend-with-no-fvp:
494-
name: unittest-arm-backend-with-no-fvp
493+
unittest-arm-backend-with-no-deps:
494+
name: unittest-arm-backend-with-no-deps
495495
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
496496
permissions:
497497
id-token: write
498498
contents: read
499499
strategy:
500500
matrix:
501501
include:
502-
- test_arm_baremetal: test_pytest_ops
503-
- test_arm_baremetal: test_pytest_models
502+
- test_arm_baremetal: test_pytest_ops_no_target
503+
- test_arm_baremetal: test_pytest_ops_tosa
504+
- test_arm_baremetal: test_pytest_models_tosa
505+
- test_arm_baremetal: test_run_tosa
504506
fail-fast: false
505507
with:
506508
runner: linux.2xlarge
@@ -516,7 +518,7 @@ jobs:
516518
source .ci/scripts/utils.sh
517519
install_executorch "--use-pt-pinned-commit"
518520
519-
.ci/scripts/setup-arm-baremetal-tools.sh
521+
.ci/scripts/setup-arm-baremetal-tools.sh --disable-ethos-u-deps
520522
521523
ARM_TEST=${{ matrix.test_arm_baremetal }}
522524
@@ -945,6 +947,12 @@ jobs:
945947
export SAMSUNG_AI_LITECORE_KEY=$SECRET_SAMSUNG_AI_LITECORE_KEY
946948
source .ci/scripts/setup-samsung-linux-deps.sh
947949
950+
# Check if device was reserved
951+
if [[ "${DEVICE_RESERVED:-0}" != "1" ]]; then
952+
echo "::warning::Skipping tests - no Samsung device available"
953+
exit 0
954+
fi
955+
948956
# Test quant models
949957
model_scripts="deeplab_v3 edsr inception_v3 inception_v4 mobilenet_v2 mobilenet_v3 resnet18 resnet50 vit wav2letter"
950958
for m_script in $model_scripts; do
@@ -981,6 +989,12 @@ jobs:
981989
export SAMSUNG_AI_LITECORE_KEY=$SECRET_SAMSUNG_AI_LITECORE_KEY
982990
source .ci/scripts/setup-samsung-linux-deps.sh
983991
992+
# Check if device was reserved
993+
if [[ "${DEVICE_RESERVED:-0}" != "1" ]]; then
994+
echo "::warning::Skipping tests - no Samsung device available"
995+
exit 0
996+
fi
997+
984998
# Test models
985999
python -m unittest discover -s backends/samsung/test/models -p "test_*.py"
9861000

.github/workflows/trunk.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -273,21 +273,21 @@ jobs:
273273
# Test selective build
274274
PYTHON_EXECUTABLE=python bash examples/portable/scripts/test_demo_backend_delegation.sh "${BUILD_TOOL}"
275275
276-
test-arm-backend:
277-
name: test-arm-backend
276+
test-arm-backend-ethos-u:
277+
name: test-arm-backend-ethos-u
278278
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
279279
permissions:
280280
id-token: write
281281
contents: read
282282
strategy:
283283
matrix:
284284
include:
285-
- test_arm_baremetal: test_pytest_ops_ethosu_fvp
286-
- test_arm_baremetal: test_pytest_models_ethosu_fvp
287-
- test_arm_baremetal: test_run_ethosu_fvp
288-
- test_arm_baremetal: test_models_tosa
289-
- test_arm_baremetal: test_models_ethos-u55
290-
- test_arm_baremetal: test_models_ethos-u85
285+
- test_arm_baremetal: test_pytest_ops_ethos_u55
286+
- test_arm_baremetal: test_pytest_models_ethos_u55
287+
- test_arm_baremetal: test_run_ethos_u55
288+
- test_arm_baremetal: test_pytest_ops_ethos_u85
289+
- test_arm_baremetal: test_pytest_models_ethos_u85
290+
- test_arm_baremetal: test_run_ethos_u85
291291
- test_arm_baremetal: test_smaller_stories_llama
292292
- test_arm_baremetal: test_memory_allocation
293293
- test_arm_baremetal: test_model_smollm2-135M

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
/devtools @Gasoonjia
2020

21-
/docs @mergennachin
21+
/docs @mergennachin @AlannaBurke
2222

2323
/examples/apple @shoumikhin
2424
/examples/apple/coreml @cccclai @metascroy @cymbalrush @YifanShenSZ

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ See [examples/models/llama](examples/models/llama/README.md) for complete workfl
192192
| macOS | XNNPACK, MPS, Metal *(experimental)* |
193193
| Embedded / MCU | XNNPACK, ARM Ethos-U, NXP, Cadence DSP |
194194

195-
See [Backend Documentation](https://docs.pytorch.org/executorch/main/backends-overview.html) for detailed hardware requirements and optimization guides.
195+
See [Backend Documentation](https://docs.pytorch.org/executorch/main/backends-overview.html) for detailed hardware requirements and optimization guides. For desktop/laptop GPU inference with CUDA and Metal, see the [Desktop Guide](desktop/README.md). For Zephyr RTOS integration, see the [Zephyr Guide](zephyr/README.md).
196196

197197
## Production Deployments
198198

@@ -204,9 +204,9 @@ ExecuTorch powers on-device AI at scale across Meta's family of apps, VR/AR devi
204204

205205
**Multimodal:** [Llava](examples/models/llava/README.md) (vision-language), [Voxtral](examples/models/voxtral/README.md) (audio-language), [Gemma](examples/models/gemma3) (vision-language)
206206

207-
**Vision/Speech:** [MobileNetV2](https://github.com/meta-pytorch/executorch-examples/tree/main/mv2), [DeepLabV3](https://github.com/meta-pytorch/executorch-examples/tree/main/dl3), [Whisper](https://github.com/meta-pytorch/executorch-examples/tree/main/whisper/android/WhisperApp)
207+
**Vision/Speech:** [MobileNetV2](https://github.com/meta-pytorch/executorch-examples/tree/main/mv2), [DeepLabV3](https://github.com/meta-pytorch/executorch-examples/tree/main/dl3), [Whisper](examples/models/whisper/README.md) <!-- @lint-ignore -->
208208

209-
**Resources:** [`examples/`](examples/) directory • [executorch-examples](https://github.com/meta-pytorch/executorch-examples) out-of-tree demos • [Optimum-ExecuTorch](https://github.com/huggingface/optimum-executorch) for HuggingFace models
209+
**Resources:** [`examples/`](examples/) directory • [executorch-examples](https://github.com/meta-pytorch/executorch-examples) out-of-tree demos • [Optimum-ExecuTorch](https://github.com/huggingface/optimum-executorch) for HuggingFace models[Unsloth](https://docs.unsloth.ai/new/deploy-llms-phone) for fine-tuned LLM deployment <!-- @lint-ignore -->
210210

211211
## Key Features
212212

0 commit comments

Comments
 (0)