Skip to content

Commit 8453294

Browse files
kirklandsignfacebook-github-bot
authored andcommitted
LLAMA Android demo app Fix (#2354)
Summary: Pull Request resolved: #2354 Fix namespace. Update README for ExecuTorchDemo since we updated the CMake variable name. Reviewed By: shoumikhin Differential Revision: D54766652 fbshipit-source-id: c9a84deb520c3d2c31eb83086a10f0c742c76fcc
1 parent 684d41a commit 8453294

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

examples/demo-apps/android/ExecuTorchDemo/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ cmake .. \
116116
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
117117
-DANDROID_ABI=arm64-v8a \
118118
-DBUCK2=/tmp/buck2 \
119-
-DEXECUTORCH_BUILD_ANDROID_DEMO_APP_JNI=ON \
119+
-DEXECUTORCH_BUILD_ANDROID_JNI=ON \
120120
-DEXECUTORCH_BUILD_XNNPACK=ON \
121121
-DEXECUTORCH_BUILD_FLATC=OFF \
122122
-DEXECUTORCH_BUILD_QNN=ON \

examples/demo-apps/android/LlamaDemo/app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ plugins {
1212
}
1313

1414
android {
15-
namespace = "com.example.executorchdemo"
15+
namespace = "com.example.executorchllamademo"
1616
compileSdk = 34
1717

1818
defaultConfig {
19-
applicationId = "com.example.executorchdemo"
19+
applicationId = "com.example.executorchllamademo"
2020
minSdk = 24
2121
targetSdk = 33
2222
versionCode = 1

examples/models/llama2/custom_ops/op_sdpa.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ inline void fill_stub(scalar_t* data, scalar_t val, int64_t size) {
177177
for (; d < size - (size % Vec::size()); d += Vec::size()) {
178178
data_vec.store(data + d);
179179
}
180-
#if !defined(_MSC_VER) && !defined(COMPILING_FOR_MIN_SIZE)
180+
#if !defined(_MSC_VER) && !defined(COMPILING_FOR_MIN_SIZE) && \
181+
!defined(__ANDROID__)
181182
#pragma unroll
182183
#endif
183184
for (; d < size; d++) {
@@ -249,7 +250,7 @@ void cpu_flash_attention(
249250
ET_CHECK_MSG(
250251
attn_mask.value().size(1) == kvSize,
251252
"attn_mask shape mismatch"
252-
"attn_mask.size(1)=%ld kvSize=%" PRId64,
253+
"attn_mask.size(1)=%zd kvSize=%" PRId64,
253254
attn_mask.value().size(1),
254255
kvSize);
255256
}
@@ -578,7 +579,7 @@ bool validate_cache_params(
578579
"start_post + seq_length must be less than max seq length supported by key cache."
579580
"start pos: %" PRId64 ", seq_length: %" PRId64
580581
"."
581-
"key cache size: %ld",
582+
"key cache size: %zd",
582583
start_pos,
583584
seq_length,
584585
k_cache.size(2));
@@ -588,7 +589,7 @@ bool validate_cache_params(
588589
"start_post + seq_length must be less than max seq length supported by key cache."
589590
"start pos: %" PRId64 ", seq_length: %" PRId64
590591
"."
591-
"value cache size: %ld",
592+
"value cache size: %zd",
592593
start_pos,
593594
seq_length,
594595
v_cache.size(2));

0 commit comments

Comments
 (0)