Skip to content

Commit 4956dac

Browse files
Merge branch 'main' into load_method-support-optional-planned-memory-allocator
2 parents 5801a2e + 2094659 commit 4956dac

File tree

76 files changed

+762
-671
lines changed

Some content is hidden

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

76 files changed

+762
-671
lines changed

.ci/docker/common/install_java.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
8+
set -ex
9+
10+
apt-get update
11+
12+
apt-get install -y --no-install-recommends openjdk-17-jdk

.ci/docker/ubuntu/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ ARG BUCK2_VERSION
3030
COPY ./common/install_buck.sh install_buck.sh
3131
RUN bash ./install_buck.sh && rm install_buck.sh
3232

33+
# Install java
34+
COPY ./common/install_java.sh install_java.sh
35+
RUN bash ./install_java.sh && rm install_java.sh
36+
3337
# Setup user
3438
COPY ./common/install_user.sh install_user.sh
3539
RUN bash ./install_user.sh && rm install_user.sh

.ci/scripts/build_llama_android.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ install_executorch_and_backend_lib() {
4242

4343
build_llama_runner() {
4444
echo "Building llama runner for Android..."
45+
pushd extension/llm/tokenizers
46+
echo "Updating tokenizers submodule"
47+
git submodule update --init
48+
popd
4549
ANDROID_ABI=arm64-v8a
4650
cmake -DBUCK2="${BUCK2}" \
4751
-DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK"/build/cmake/android.toolchain.cmake \

.ci/scripts/test_ane_static_llama.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ fi
1717

1818
which "${PYTHON_EXECUTABLE}"
1919

20+
# Update tokenizers submodule
21+
pushd $EXECUTORCH_ROOT/extension/llm/tokenizers
22+
echo "Update tokenizers submodule"
23+
git submodule update --init
24+
popd
25+
2026
pushd $EXECUTORCH_ROOT/examples/apple/coreml/llama
2127

2228
# Download stories llama110m artifacts

.ci/scripts/test_llama.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ cmake_install_executorch_libraries() {
173173

174174
cmake_build_llama_runner() {
175175
echo "Building llama runner"
176+
pushd extension/llm/tokenizers
177+
echo "Updating tokenizers submodule"
178+
git submodule update --init
179+
popd
176180
dir="examples/models/llama"
177181
retry cmake \
178182
-DCMAKE_INSTALL_PREFIX=cmake-out \

.ci/scripts/unittest-buck2.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ buck2 query "//backends/apple/... + //backends/example/... + \
1414
//runtime/... + //schema/... + //test/... + //util/..."
1515

1616
# TODO: expand the covered scope of Buck targets.
17-
buck2 build //runtime/core/portable_type/...
18-
buck2 test //runtime/core/portable_type/...
17+
# //runtime/kernel/... is failing because //third-party:torchgen_files's shell script can't find python on PATH.
18+
# //runtime/test/... requires Python torch, which we don't have in our OSS buck setup.
19+
buck2 build //runtime/backend/... //runtime/core/... //runtime/executor: //runtime/kernel/... //runtime/platform/...
20+
buck2 test //runtime/backend/... //runtime/core/... //runtime/executor: //runtime/kernel/... //runtime/platform/...

.github/workflows/doc-build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ jobs:
6868
make html
6969
cd ..
7070
71+
# Build javadoc:
72+
cd extension/android
73+
./gradlew javadoc
74+
cp -rf build/docs/javadoc "${RUNNER_DOCS_DIR}"
75+
cd ../..
76+
7177
# If it's main branch, add noindex tag to all .html files to exclude from Google Search indexing.
7278
echo "GitHub Ref: ${GITHUB_REF}"
7379
if [[ "${{ github.ref }}" == 'refs/heads/main' ]]; then

.gitmodules

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,9 @@
2828
[submodule "backends/xnnpack/third-party/pthreadpool"]
2929
path = backends/xnnpack/third-party/pthreadpool
3030
url = https://github.com/Maratyszcza/pthreadpool.git
31-
[submodule "extension/llm/third-party/abseil-cpp"]
32-
path = extension/llm/third-party/abseil-cpp
33-
url = https://github.com/abseil/abseil-cpp.git
34-
[submodule "extension/llm/third-party/re2"]
35-
path = extension/llm/third-party/re2
36-
url = https://github.com/google/re2.git
37-
[submodule "extension/llm/third-party/sentencepiece"]
38-
path = extension/llm/third-party/sentencepiece
39-
url = https://github.com/google/sentencepiece.git
31+
[submodule "extension/llm/tokenizers"]
32+
path = extension/llm/tokenizers
33+
url = https://github.com/pytorch-labs/tokenizers.git
4034
[submodule "kernels/optimized/third-party/eigen"]
4135
path = kernels/optimized/third-party/eigen
4236
url = https://gitlab.com/libeigen/eigen.git

CODEOWNERS

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/backends/vulkan @SS-JIA
1616
/backends/xnnpack @digantdesai @mcr229
1717

18-
/build @GregoryComer @dbort @kirklandsign
18+
/build @GregoryComer @kirklandsign
1919

2020
/codegen @larryliu0820 @lucylq
2121

@@ -47,32 +47,32 @@
4747
/extension/apple @shoumikhin
4848
/extension/aten_util @JacobSzwejbka
4949
/extension/benchmark @tarun292
50-
/extension/data_loader @JacobSzwejbka @lucylq @dbort
51-
/extension/evalue_util @GregoryComer @dbort
50+
/extension/data_loader @JacobSzwejbka @lucylq
51+
/extension/evalue_util @GregoryComer
5252
/extension/export_util @kimishpatel
5353
/extension/flat_tensor @lucylq
5454
/extension/gguf_util @larryliu0820
5555
/extension/kernel_util @kimishpatel @manuelcandales
5656
/extension/llm @jackzhxng @iseeyuan @larryliu0820
57-
/extension/memory_allocator @JacobSzwejbka @dbort
57+
/extension/memory_allocator @JacobSzwejbka
5858
/extension/module @shoumikhin
5959
/extension/parallel @kimishpatel
6060
/extension/pybindings @JacobSzwejbka @larryliu0820
6161
/extension/pytree @JacobSzwejbka
62-
/extension/runner_util @dbort
62+
# /extension/runner_util @dbort
6363
/extension/tensor @shoumikhin
64-
/extension/testing_util @dbort
64+
# /extension/testing_util @dbort
6565
/extension/threadpool @kimishpatel
6666
/extension/training @JacobSzwejbka
6767

6868
/kernels @manuelcandales
6969

7070
/profiler @tarun292 @Gasoonjia
7171

72-
/runtime @dbort @JacobSzwejbka @lucylq
72+
/runtime @JacobSzwejbka @lucylq
7373
/runtime/backend @cccclai
7474

75-
/schema @dbort @JacobSzwejbka @lucylq
75+
/schema @JacobSzwejbka @lucylq
7676

7777
/scripts @GregoryComer
7878

backends/apple/coreml/test/test_coreml_partitioner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def forward(self, q, k, v, mask):
117117
v = torch.randn(batch_size, n_heads, max_seq_length, embedding_dim)
118118
mask = torch.randn(seq_len, max_seq_length)
119119
example_inputs = (q, k, v, mask)
120-
ep = torch.export.export(model, example_inputs)
120+
ep = torch.export.export(model, example_inputs, strict=True)
121121
coreml_partitioner = CoreMLPartitioner()
122122

123123
# Using to_edge_transform_and_lower, we expect SDPA will be preserved and show up in delegated graph

0 commit comments

Comments
 (0)