Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
179d495
[data loader] move logic for FD data loader out of file_data_loader (…
davidlin54 Nov 6, 2024
c438f8d
Refactor pytest config + add default dump dir option
Erik-Lundell Nov 6, 2024
b8e0ef9
Add cat/stack ops to generic annotator
SaoirseARM Nov 6, 2024
03b1ef2
Remove IR check after aten in arm
tugsbayasgalan Nov 6, 2024
17ad8d3
Fix type handling for output types from TOSA reference model (#6660)
per Nov 6, 2024
026fe0b
Add support for bits16 in ETDump
dulinriley Nov 6, 2024
b07386c
Remove custom implementation of string_view
dbort Nov 6, 2024
785ebf3
Add trunc scalar prim_op
GregoryComer Nov 6, 2024
6051b2f
Add per_tensor overload for quantized_conv
mcremon-meta Nov 7, 2024
8f82198
Add dvorjackz to ghstack_land.yml (#6644)
Nov 7, 2024
70f15e6
[ET-VK] Fake u16vecn for devserver (#6704)
pytorchbot Nov 7, 2024
545535b
[Executorch] enable sleef consistently (#6705)
pytorchbot Nov 7, 2024
713d8a1
Add max_pool2d op to Arm backend (#6285)
AdrianLundell Nov 7, 2024
4bbe994
Run tosa_reference_model using python binding (#6658)
Erik-Lundell Nov 7, 2024
38346fd
Added HiFi optimized mean and where ops. (#6483)
cad-audio Nov 7, 2024
abc8a5f
Revert changes to executor_runner (#6687)
davidlin54 Nov 7, 2024
f9698d8
Move quantize IO passes from BoltNN to ExecuTorch
digantdesai Nov 7, 2024
437168e
[Android] added tests for Tensor.java
davidlin54 Nov 7, 2024
4af687a
Revert "Qualcomm AI Engine Direct - Quantizer refine for qat (#6513)"…
kirklandsign Nov 7, 2024
cb2a0e7
Qualcomm AI Engine Direct - Reduce redundant observers (#6351)
winskuo-quic Nov 7, 2024
39e5b91
[ET-VK][ez] properly parse skip memory metadata pass (#6723)
pytorchbot Nov 7, 2024
485a5df
Revert "Run tosa_reference_model using python binding" (#6729)
freddan80 Nov 8, 2024
b0f9a61
Add support for uint16 in quant and dequant kernels
dulinriley Nov 8, 2024
1cd8a06
migrate passes and utils in cadence backend
zonglinpeng Nov 8, 2024
6d6630e
register quantized_linear.per_tensor in lib
zonglinpeng Nov 8, 2024
ddc8ea6
Tosa specification handling (#6688)
per Nov 8, 2024
b1e6617
Fix pyre
kirklandsign Nov 8, 2024
289e84e
Correctly set _GLIBCXX_USE_CXX11_ABI pybind compile options (#6744)
huydhn Nov 9, 2024
427b36d
Add Android standalone log target
GregoryComer Nov 10, 2024
5b51bb8
Support sym round and ceil
GregoryComer Nov 10, 2024
0a20d72
Arm backend: Add linear decomposition (#6661)
oscarandersson8218 Nov 11, 2024
793f17e
introduce slack channel for community
Gasoonjia Nov 11, 2024
7fcd0af
Search graph for quantization parameters (#6690)
Erik-Lundell Nov 11, 2024
146ca1b
Swap mha (#6719)
Nov 11, 2024
a809953
Add torchao kernels to llama runner
metascroy Nov 11, 2024
bec0625
Fix arm related internal build
kirklandsign Nov 11, 2024
7895982
Qualcomm AI Engine Direct - wav2letter e2e example
haowhsu-quic Nov 11, 2024
b23c9e6
[Android] Added instrumentation test for Module (#6751)
davidlin54 Nov 11, 2024
2660287
added instrumentation test for LlamaModule (#6759)
davidlin54 Nov 11, 2024
d544f94
[ET-VK] Statically link MoltenVK (#6762)
pytorchbot Nov 11, 2024
c411a75
add script to generate add.pte (#6760)
davidlin54 Nov 11, 2024
b8b5146
move junit tests to android_test (#6761)
davidlin54 Nov 11, 2024
6887ae9
[ET-VK] Update partitioner to account for custom packed arguments (#6…
pytorchbot Nov 11, 2024
671f9c5
update llama runner to decode single token (#6768)
pytorchbot Nov 11, 2024
623a9a6
add the ability to have multi-round conversation with llama (#6769)
pytorchbot Nov 11, 2024
576e96c
Qualcomm AI Engine Direct - Add llama sha transforming pass
chunit-quic Nov 11, 2024
f90cf2d
Tighten type hints for tensor arithmetic
ezyang Nov 11, 2024
4947e27
Fix internal pyre test
kirklandsign Nov 11, 2024
dc41596
migrate utils from jarvis to cadence
zonglinpeng Nov 12, 2024
995c2bf
Add missing ops to ArmQuantizer (#6780)
oscarandersson8218 Nov 12, 2024
1166669
[ET-VK] Reduced int precision for texture coordinates in conv2d_pw op…
pytorchbot Nov 12, 2024
7f3d37a
[ET-VK] Removing tile input storage variable in conv_pw op and fetchi…
pytorchbot Nov 12, 2024
acc63d3
[ET-VK] Reduced int precision for texture coordinates in conv2d_pw op…
pytorchbot Nov 12, 2024
99ba779
[test] add Android java test to gh workflow (#6772)
davidlin54 Nov 12, 2024
49756f6
Print the number of tokens generated (#6773)
pytorchbot Nov 12, 2024
2f6d64f
torch.export()-only export Llama arg (#6695)
Nov 12, 2024
c8967da
Fix missing header `<algorithm>` in tensor_ptr.h (#6778)
anyj0527 Nov 12, 2024
b860f8f
remove extra torchao commit pin (#6784)
metascroy Nov 12, 2024
10a814e
Run slow model E2E CI on periodic only (#6742)
kirklandsign Nov 12, 2024
043870b
Update backend execute args in test
cccclai Nov 12, 2024
e332e2a
Remove .ci/docker trigger on Apple workflows (#6787)
huydhn Nov 12, 2024
f8fda0a
Add a test to ensure that PT built from the pinned commit is used (#6…
huydhn Nov 12, 2024
74bb5ff
Temporarily ignore flaky mha test (#6790)
Nov 12, 2024
8127edd
migrate passes calls to pass utils
zonglinpeng Nov 12, 2024
b3525d5
[ET-VK] Replace `uint16_t` with `int` for swiftshader (#6788)
pytorchbot Nov 12, 2024
4b7a60f
Add missing quantize ops to q_dq_ops target
tarun292 Nov 12, 2024
9cd57d6
[llama-mm] Enable kv cache for MultiHeadAttention (#6798)
pytorchbot Nov 12, 2024
5e03714
Fix pyre on builder.py (#6789)
Nov 12, 2024
15b1f39
Use std::variant to implement pytree Key (#6792)
pytorchbot Nov 12, 2024
b6ebd3c
Fix missing move and bare new in pytree from_str_internal (#6803)
pytorchbot Nov 12, 2024
f943856
Fix flaky ET attention test (#6795)
Nov 12, 2024
d8a617f
[llama-mm] Add unit tests for exporting MultiHeadAttention with KVCac…
larryliu0820 Nov 13, 2024
667f600
Accept model type parameter in export_llama
Nov 13, 2024
4c68660
Add support for upsample_nearest2d op in the Arm backend
Tessil Aug 27, 2024
d5c2b31
Arm backend: Speedup generation of C/C++ header of the pte file
zingo Nov 12, 2024
7b85117
Add qnn sdk docker (#6796)
cccclai Nov 13, 2024
97e0417
[executorch][serialization] Format program.fbs with consistent whites…
pytorchbot Nov 13, 2024
9abc9f4
Solve circular import error
oscarandersson8218 Oct 23, 2024
73893e1
Arm Backend: Place pte file/data in DDR area
zingo Nov 5, 2024
4f2ac7e
Use lambda on all kernel prim ops
zingo Nov 6, 2024
ee14ad0
Pin TorchTune (#6791)
Nov 13, 2024
3da4b5d
Update model evaluator to check multiple outputs
SaoirseARM Nov 5, 2024
f01b20b
[llama-mm] Bump PyTorch pin to 11/12 (#6819)
pytorchbot Nov 13, 2024
d0e0466
Expose mehod name as part of backend init context
cccclai Nov 13, 2024
bfb1e99
Reducing VMA large pool allocation to 4 MB from 32 MB to reduce memor…
trviv Nov 13, 2024
9511c21
[llama-mm] Add export friendly TiledTokenPositionalEmbedding (#6824)
pytorchbot Nov 13, 2024
ee32ea3
Remove unused-variable in ods3/services/storage/gorilla/lib3/gorilla/…
r-barnes Nov 13, 2024
93b202c
[ET] Fix serde handling of `inf` (#6832)
pytorchbot Nov 13, 2024
dd8f182
Remove PATTERNLINT suppressions (#6821)
pytorchbot Nov 13, 2024
9393b8c
Fix broken trunk test_model.sh (#6826)
Nov 13, 2024
bd768bf
Add op: masked_select
manuelcandales Nov 13, 2024
cafe0fa
[llama-mm] Onboard torchtune vision encoder to ExecuTorch/AOTI (#6831)
pytorchbot Nov 13, 2024
473bc7b
[ET-VK][ez] Link MoltenVK statically for all Mac builds (#6834)
pytorchbot Nov 13, 2024
31dbfc9
Qualcomm AI Engine Direct - support llama3.2 1B/3B with static llama …
shewu-quic Nov 13, 2024
7b03a8b
Update checksums in Xcode projects.
shoumikhin Nov 13, 2024
efa4628
Assert that the repo directory is named `executorch` (#6480)
dbort Nov 14, 2024
6f63893
Fix arm dep for jarvis test
lucylq Nov 14, 2024
21eecff
add up to Uint64
JacobSzwejbka Nov 14, 2024
0a9598b
[llama-mm] Fix vision encoder model test (#6842)
larryliu0820 Nov 14, 2024
ecdc007
Linear tiling experiment
trviv Nov 14, 2024
07c4d0e
Fix imports to use torchao public api
jainapurva Nov 14, 2024
0f2995f
[ET-VK] Enforce GPU buffer limit when partitioning (#6856)
pytorchbot Nov 14, 2024
f32cffd
[ET-VK][Llama] Apply XNNPACK partitoner as well when lowering to Vulk…
pytorchbot Nov 14, 2024
4e83f24
Patch for div_mod build issue on Xtensa (#6814)
dijopaul Nov 14, 2024
71612a6
Install requirements for llama vision (#6854)
lucylq Nov 14, 2024
fc6d097
Disable llm module test (#6861)
lucylq Nov 14, 2024
9f424e8
Add missing Pyre mode headers] [batch:9/1301] [shard:12/N]
lucylq Nov 14, 2024
53caede
Improve ET_ASSERT_UNREACHABLE_MSG to use formatting
dulinriley Nov 14, 2024
d060426
Skip building Apple demo app on fork PRs (#6865)
huydhn Nov 14, 2024
fd2c323
Add unit tests for old lowering flow for op_cat.py
suchir1 Nov 14, 2024
d9d4859
Add shim/README.md to explain what the shim/ tree is for (#6860)
dbort Nov 14, 2024
27f31cd
Export TorchTune llama3_2_vision in ET (#5911)
Nov 14, 2024
6c944db
Runner changes for TorchTune Llama3.2 vision text decoder (#6610)
Nov 14, 2024
d7826c8
Automate SwiftPM updates. (#6868)
shoumikhin Nov 14, 2024
eccc633
Add back AWS upload step. (#6871)
shoumikhin Nov 14, 2024
937af64
expand dtype conversion support in aten_bridge
JacobSzwejbka Nov 14, 2024
cfac610
Force-push nightly build branch. (#6879)
shoumikhin Nov 14, 2024
a4e2414
Update Hugging Face version (#6489)
guangy10 Nov 15, 2024
ad15852
fix lintrunner
cccclai Nov 15, 2024
b0f6048
Fix test_model.sh for vision text decoder (#6874)
Nov 15, 2024
b386322
Update Xcode projects to use nightly builds. (#6873)
shoumikhin Nov 15, 2024
e384c1a
Fix Xcode projects packages pins.
shoumikhin Nov 15, 2024
7b76f0f
Make TorchTune Llama model KV cache compatible in eager (#6643)
Nov 15, 2024
04b3d92
[llama-mm] Add torch.cond to replace if condition in MHA (#6869)
larryliu0820 Nov 15, 2024
4a18003
Add TosaSpecification to ArmPartitioner
per Oct 16, 2024
041b7d6
Refactor TOSAOperatorSupport to allow for maping against TosaSpecific…
per Oct 17, 2024
54899fe
Adding tests old lowering flow for op_abs.py
ru-m8 Nov 15, 2024
b4ab76f
Remove template file after renaming and amending. (#6885)
shoumikhin Nov 15, 2024
92ee522
merge internal op registration with oss
zonglinpeng Nov 15, 2024
0877926
Add UInt16 support to Q and DQ
JacobSzwejbka Nov 15, 2024
f96be5b
Add UInt16 support to Cadence kernels
dulinriley Nov 15, 2024
e32d1b7
Simplify .xcoconfig.
shoumikhin Nov 15, 2024
c734ad4
Change the branch to download frameworkd from.
shoumikhin Nov 15, 2024
5663e3c
[MTK] Add support for Llama 3.2 and code updates to align with curren…
neuropilot-captain Nov 15, 2024
fe5caad
Move linker flags to config files for clarity.
lucylq Nov 16, 2024
3813f42
Only use `LINEAR` tiling if it's available
SS-JIA Nov 16, 2024
ae61100
Remove assert for ArgSchema
dulinriley Nov 16, 2024
ca44965
Introduce no_volk buck targets
SS-JIA Nov 16, 2024
0692ef4
Pyre fix
lucylq Nov 16, 2024
d5f91bf
Temporarily disable OOMing llama vision decoder test (#6908)
Nov 16, 2024
793a988
Fix arm dependency
lucylq Nov 16, 2024
19268de
Introduce data schema to store raw tensors (#6919)
lucylq Nov 18, 2024
e95f171
Qualcomm AI Engine Direct - Quantizer refine for qat
chunit-quic Nov 18, 2024
8526d0a
Arm backend: Set default allocation pool to 20MB
zingo Nov 12, 2024
3784f06
Add MobileNetV2Evaluator to Arm Backend
tom-arm Oct 21, 2024
4f9ae32
[llama-mm] Reduce copies in SDPA in MHA (#6917)
larryliu0820 Nov 18, 2024
3b475e3
[llama-mm] Fix AOTI test for attention (#6915)
larryliu0820 Nov 18, 2024
c242a59
[Executorch][Portable] Dont upcast to double for sigmoid
kirklandsign Nov 18, 2024
5b4d9bb
[Executorch] optimized sigmoid
kirklandsign Nov 18, 2024
ee74d06
remove codegen-nosub from q_8w
nathanaelsee Nov 18, 2024
76a0e0f
Introduce static targets
SS-JIA Nov 18, 2024
4086509
Dev weight sharing
haowhsu-quic Nov 18, 2024
88df185
Fix erroneous `extension_features` initialization
SS-JIA Nov 18, 2024
f145ced
Port memory planning to Cadence
skrtskrtfb Nov 18, 2024
7278519
update sccache to latest version (#6837)
wdvr Nov 18, 2024
8013822
Strip local file paths from builds.
shoumikhin Nov 18, 2024
7bfe3b9
Fix Cuda out of memory issue for eager runner (#6935)
pytorchbot Nov 18, 2024
a0ac820
update OSS pre-existing passes and migrate callsites to OSS
zonglinpeng Nov 18, 2024
85fca59
Add documentation (#6883)
neuropilot-captain Nov 19, 2024
8cce45b
Add PR release note label checker bot (#6835)
Nov 19, 2024
04f6fcd
Fix ReLU fusion when conv/linear has > 1 user
mcr229 Nov 19, 2024
86cb5d7
Fix error message.
hsharma35 Nov 19, 2024
eae0b04
add fuse ops passes in oss
zonglinpeng Nov 19, 2024
f477fd5
Label checker fix (#6953)
Nov 19, 2024
fbc384c
Lower confidence threshold in tests to avoid flakiness.
shoumikhin Nov 19, 2024
97cb892
add graph builder in oss for fuse ops
zonglinpeng Nov 19, 2024
8470cb9
import test graph builder to oss, import im2row
zonglinpeng Nov 19, 2024
34d4398
split to_cadence_edge_executorch API to to_cadence and to_executorch_…
zonglinpeng Nov 19, 2024
809a1a5
Fix pyre
kirklandsign Nov 19, 2024
1de96f8
Move the rest qnn model jobs to the new qnn sdk docker
cccclai Nov 19, 2024
54feeef
add uint16 to serialization
JacobSzwejbka Nov 19, 2024
f40daea
Fix ARM submodule URLs (#6973)
swolchok Nov 20, 2024
af87283
add simply ops to oss, update fuse simply callsites
zonglinpeng Nov 20, 2024
709e739
Qualcomm AI Engine Direct - Optimization in static llama
shewu-quic Nov 20, 2024
dcacde0
Update docs on linkage and debugging.
shoumikhin Nov 20, 2024
84222a9
Update apple-runtime.md (#6985)
shoumikhin Nov 20, 2024
359e9d3
Fix custom annotation (#6978)
cccclai Nov 20, 2024
bafae87
Use GitHub mirrors of mlplatform submodules to unbreak ExecuTorch CI …
pytorchbot Nov 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .ci/docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ case "${IMAGE_NAME}" in
ARM_SDK=yes
CLANG_VERSION=12
;;
executorch-ubuntu-22.04-qnn-sdk)
QNN_SDK=yes
CLANG_VERSION=12
;;
executorch-ubuntu-22.04-clang12-android)
LINTRUNNER=""
CLANG_VERSION=12
Expand Down Expand Up @@ -72,6 +76,7 @@ docker build \
--build-arg "LINTRUNNER=${LINTRUNNER:-}" \
--build-arg "BUILD_DOCS=${BUILD_DOCS}" \
--build-arg "ARM_SDK=${ARM_SDK:-}" \
--build-arg "QNN_SDK=${QNN_SDK:-}" \
--build-arg "ANDROID_NDK_VERSION=${ANDROID_NDK_VERSION:-}" \
-f "${OS}"/Dockerfile \
"$@" \
Expand Down
2 changes: 1 addition & 1 deletion .ci/docker/ci_commit_pins/pytorch.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c8a648d4dffb9f0133ff4a2ea0e660b42105d3ad
19eff28ff3f19b50da46f5a9ff5f4d4d213806fe
1 change: 0 additions & 1 deletion .ci/docker/ci_commit_pins/torchao.txt

This file was deleted.

52 changes: 45 additions & 7 deletions .ci/docker/common/install_cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,26 @@ set -ex
# shellcheck source=/dev/null
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"

install_ubuntu() {
echo "Preparing to build sccache from source"
apt-get update
# libssl-dev will not work as it is upgraded to libssl3 in Ubuntu-22.04.
# Instead use lib and headers from OpenSSL1.1 installed in `install_openssl.sh``
apt-get install -y cargo
echo "Checking out sccache repo"
git clone https://github.com/mozilla/sccache -b v0.8.2

cd sccache
echo "Building sccache"
cargo build --release
cp target/release/sccache /opt/cache/bin
echo "Cleaning up"
cd ..
rm -rf sccache
apt-get remove -y cargo rustc
apt-get autoclean && apt-get clean
}

install_binary() {
echo "Downloading sccache binary from S3 repo"
curl --retry 3 https://s3.amazonaws.com/ossci-linux/sccache -o /opt/cache/bin/sccache
Expand All @@ -22,15 +42,33 @@ mkdir -p /opt/cache/bin
sed -e 's|PATH="\(.*\)"|PATH="/opt/cache/bin:\1"|g' -i /etc/environment
export PATH="/opt/cache/bin:$PATH"

# NB: Install the pre-built binary from S3 as building from source
# https://github.com/pytorch/sccache has started failing mysteriously
# in which sccache server couldn't start with the following error:
# sccache: error: Invalid argument (os error 22)
install_binary
install_ubuntu

function write_sccache_stub() {
BINARY=$1
printf "#!/bin/sh\nif [ \$(env -u LD_PRELOAD ps -p \$PPID -o comm=) != sccache ]; then\n exec sccache %s \"\$@\"\nelse\n exec %s \"\$@\"\nfi" "$(which "${BINARY}")" "$(which "${BINARY}")" > "/opt/cache/bin/${BINARY}"
if [ $1 == "gcc" ]; then
# Do not call sccache recursively when dumping preprocessor argument
# For some reason it's very important for the first cached nvcc invocation
cat >"/opt/cache/bin/$1" <<EOF
#!/bin/sh
if [ "\$1" = "-E" ] || [ "\$2" = "-E" ]; then
exec $(which $1) "\$@"
elif [ \$(env -u LD_PRELOAD ps -p \$PPID -o comm=) != sccache ]; then
exec sccache $(which $1) "\$@"
else
exec $(which $1) "\$@"
fi
EOF
else
cat >"/opt/cache/bin/$1" <<EOF
#!/bin/sh
if [ \$(env -u LD_PRELOAD ps -p \$PPID -o comm=) != sccache ]; then
exec sccache $(which $1) "\$@"
else
exec $(which $1) "\$@"
fi
EOF
fi
chmod a+x "/opt/cache/bin/${BINARY}"
}

Expand All @@ -44,7 +82,7 @@ init_sccache() {

# NB: This function is adopted from PyTorch core at
# https://github.com/pytorch/pytorch/blob/main/.ci/pytorch/common-build.sh
as_ci_user sccache --stop-server > /dev/null 2>&1 || true
as_ci_user sccache --stop-server >/dev/null 2>&1 || true
rm -f "${SCCACHE_ERROR_LOG}" || true

# Clear sccache stats before using it
Expand Down
3 changes: 3 additions & 0 deletions .ci/docker/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ COPY ./common/utils.sh utils.sh
RUN bash ./install_cache.sh && rm install_cache.sh utils.sh
ENV SCCACHE_BUCKET ossci-compiler-cache-circleci-v2
ENV SCCACHE_S3_KEY_PREFIX executorch
ENV SCCACHE_REGION us-east-1

ARG TORCH_VERSION
COPY ./common/install_pytorch.sh install_pytorch.sh
Expand All @@ -82,5 +83,7 @@ COPY --chown=ci-user:ci-user ./arm /opt/arm
# Set up ARM SDK if needed
RUN if [ -n "${ARM_SDK}" ]; then git config --global user.email "ossci@example.com"; git config --global user.name "OSS CI"; bash /opt/arm/setup.sh --i-agree-to-the-contained-eula /opt/arm-sdk; chown -R ci-user:ci-user /opt/arm-sdk; fi

ARG QNN_SDK

USER ci-user
CMD ["bash"]
6 changes: 4 additions & 2 deletions .ci/scripts/gather_test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"ic4": "linux.12xlarge",
"resnet50": "linux.12xlarge",
"llava": "linux.12xlarge",
"llama3_2_vision_encoder": "linux.12xlarge",
# "llama3_2_text_decoder": "linux.12xlarge", # TODO: re-enable test when Huy's change is in / model gets smaller.
# This one causes timeout on smaller runner, the root cause is unclear (T161064121)
"dl3": "linux.12xlarge",
"emformer_join": "linux.12xlarge",
Expand Down Expand Up @@ -88,8 +90,8 @@ def model_should_run_on_event(model: str, event: str) -> bool:
if event == "pull_request":
return model in ["mv3", "vit"]
elif event == "push":
# 'emformer_predict' is running super slow. Only run it periodically
return model not in ["emformer_predict"]
# These are super slow. Only run it periodically
return model not in ["dl3", "edsr", "emformer_predict"]
else:
return True

Expand Down
1 change: 1 addition & 0 deletions .ci/scripts/setup-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ fi
# of nightly. This allows CI to test against latest commits from PyTorch
install_executorch "use-pt-pinned-commit"
build_executorch_runner "${BUILD_TOOL}"
do_not_use_nightly_on_ci
3 changes: 2 additions & 1 deletion .ci/scripts/test_llama_runner_eager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ run_and_verify() {
-d fp32 \
--max_seq_length 32 \
--temperature 0 \
--show_tokens \
--prompt "Once upon a time," > result.txt

# Verify result.txt
RESULT=$(cat result.txt)
EXPECTED_RESULT="there was a little girl"
EXPECTED_RESULT="727, 471, 263, 2217, 7826, 4257, 365, 2354, 29889, 2296, 18012, 304, 1708, 5377, 297, 278, 6575, 845, 457, 29889, 3118, 2462, 29892, 1183, 4446, 263"
if [[ "${RESULT}" == *"${EXPECTED_RESULT}"* ]]; then
echo "Actual result: ${RESULT}"
echo "Success"
Expand Down
6 changes: 5 additions & 1 deletion .ci/scripts/test_model.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ test_model() {
# Install requirements for export_llama
bash examples/models/llama/install_requirements.sh
# Test export_llama script: python3 -m examples.models.llama.export_llama
"${PYTHON_EXECUTABLE}" -m examples.models.llama.export_llama -c examples/models/llama/params/demo_rand_params.pth -p examples/models/llama/params/demo_config.json
"${PYTHON_EXECUTABLE}" -m examples.models.llama.export_llama --model "${MODEL_NAME}" -c examples/models/llama/params/demo_rand_params.pth -p examples/models/llama/params/demo_config.json
run_portable_executor_runner
rm "./${MODEL_NAME}.pte"
fi
Expand All @@ -87,6 +87,10 @@ test_model() {
bash examples/models/llava/install_requirements.sh
STRICT="--no-strict"
fi
if [[ "$MODEL_NAME" == "llama3_2_vision_encoder" || "$MODEL_NAME" == "llama3_2_text_decoder" ]]; then
# Install requirements for llama vision.
bash examples/models/llama3_2_vision/install_requirements.sh
fi
# python3 -m examples.portable.scripts.export --model_name="llama2" should works too
"${PYTHON_EXECUTABLE}" -m examples.portable.scripts.export --model_name="${MODEL_NAME}" "${STRICT}"
run_portable_executor_runner
Expand Down
18 changes: 17 additions & 1 deletion .ci/scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,26 @@ cmake_install_executorch_lib() {
}

download_stories_model_artifacts() {
# Download stories110M.pt and tokenizer from Github
# Download stories110M.pt and tokenizer from Github
curl -Ls "https://huggingface.co/karpathy/tinyllamas/resolve/main/stories110M.pt" --output stories110M.pt
curl -Ls "https://raw.githubusercontent.com/karpathy/llama2.c/master/tokenizer.model" --output tokenizer.model
# Create params.json file
touch params.json
echo '{"dim": 768, "multiple_of": 32, "n_heads": 12, "n_layers": 12, "norm_eps": 1e-05, "vocab_size": 32000}' > params.json
}

do_not_use_nightly_on_ci() {
# An assert to make sure that we are not using PyTorch nightly on CI to prevent
# regression as documented in https://github.com/pytorch/executorch/pull/6564
TORCH_VERSION=$(pip list | grep -w 'torch ' | awk -F ' ' {'print $2'} | tr -d '\n')

# The version of PyTorch building from source looks like 2.6.0a0+gitc8a648d that
# includes the commit while nightly (2.6.0.dev20241019+cpu) or release (2.6.0)
# won't have that. Note that we couldn't check for the exact commit from the pin
# ci_commit_pins/pytorch.txt here because the value will be different when running
# this on PyTorch CI
if [[ "${TORCH_VERSION}" != *"+git"* ]]; then
echo "Unexpected torch version. Expected binary built from source, got ${TORCH_VERSION}"
exit 1
fi
}
62 changes: 62 additions & 0 deletions .github/scripts/check_labels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env python3
"""Check whether a PR has required labels."""

import sys
from typing import Any

from github_utils import gh_delete_comment, gh_post_pr_comment
from gitutils import get_git_remote_name, get_git_repo_dir, GitRepo
from label_utils import has_required_labels, is_label_err_comment, LABEL_ERR_MSG
from trymerge import GitHubPR


def delete_all_label_err_comments(pr: "GitHubPR") -> None:
for comment in pr.get_comments():
if is_label_err_comment(comment):
gh_delete_comment(pr.org, pr.project, comment.database_id)


def add_label_err_comment(pr: "GitHubPR") -> None:
# Only make a comment if one doesn't exist already
if not any(is_label_err_comment(comment) for comment in pr.get_comments()):
gh_post_pr_comment(pr.org, pr.project, pr.pr_num, LABEL_ERR_MSG)


def parse_args() -> Any:
from argparse import ArgumentParser

parser = ArgumentParser("Check PR labels")
parser.add_argument("pr_num", type=int)
# add a flag to return a non-zero exit code if the PR does not have the required labels
parser.add_argument(
"--exit-non-zero",
action="store_true",
help="Return a non-zero exit code if the PR does not have the required labels",
)

return parser.parse_args()


def main() -> None:
args = parse_args()
repo = GitRepo(get_git_repo_dir(), get_git_remote_name())
org, project = repo.gh_owner_and_name()
pr = GitHubPR(org, project, args.pr_num)

try:
if not has_required_labels(pr):
print(LABEL_ERR_MSG, flush=True)
add_label_err_comment(pr)
if args.exit_non_zero:
raise RuntimeError("PR does not have required labels")
else:
delete_all_label_err_comments(pr)
except Exception as e:
if args.exit_non_zero:
raise RuntimeError(f"Error checking labels: {e}") from e

sys.exit(0)


if __name__ == "__main__":
main()
6 changes: 3 additions & 3 deletions .github/scripts/github_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ def gh_fetch_url(
headers: Optional[Dict[str, str]] = None,
data: Union[Optional[Dict[str, Any]], str] = None,
method: Optional[str] = None,
reader: Callable[[Any], Any] = lambda x: x.read(),
reader: Callable[[Any], Any] = json.load,
) -> Any:
return gh_fetch_url_and_headers(
url, headers=headers, data=data, reader=json.load, method=method
url, headers=headers, data=data, reader=reader, method=method
)[1]


Expand Down Expand Up @@ -169,7 +169,7 @@ def gh_post_commit_comment(

def gh_delete_comment(org: str, repo: str, comment_id: int) -> None:
url = f"{GITHUB_API_URL}/repos/{org}/{repo}/issues/comments/{comment_id}"
gh_fetch_url(url, method="DELETE")
gh_fetch_url(url, method="DELETE", reader=lambda x: x.read())


def gh_fetch_merge_base(org: str, repo: str, base: str, head: str) -> str:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ jobs:
curl -O https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/llm_demo/app-debug.apk
curl -O https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/llm_demo/app-debug-androidTest.apk
curl -O https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/fp32-xnnpack-custom/model.zip
curl -o android-test-debug.apk https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/library_test_dir/executorch-debug.apk
curl -o android-test-debug-androidTest.apk https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/library_test_dir/executorch-debug-androidTest.apk
unzip model.zip
mv *.pte model.pte

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/android-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
fail-fast: false
with:
runner: linux.4xlarge
docker-image: executorch-ubuntu-22.04-clang12-android
docker-image: executorch-ubuntu-22.04-qnn-sdk
submodules: 'true'
timeout: 60
upload-artifact: android-models
Expand Down
Loading