From 976cffd3ecccb4832906a049ca501471518066ab Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 4 Sep 2024 15:13:56 -0700 Subject: [PATCH 01/13] Use Android llm benchmark runner --- .../android-llm-device-farm-test-spec.yml | 8 +++++++ .../LlmBenchmarkRunner.java | 21 +++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml b/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml index cac83b8e6f5..9f5c8afd857 100644 --- a/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml +++ b/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml @@ -73,8 +73,16 @@ phases: fi fi; + # Run the new generic benchmark activity + - echo "Run LLM benchmark" + - | + adb -s $DEVICEFARM_DEVICE_UDID shell am start -n com.example.executorchllamademo/.Benchmarking \ + --es "model_dir" "/data/local/tmp/llama" \ + --es "tokenizer_path" "/data/local/tmp/llama/tokenizer.bin" + post_test: commands: + - adb -s $DEVICEFARM_DEVICE_UDID shell "ls -la /data/local/tmp/llama/" artifacts: # By default, Device Farm will collect your artifacts from the $DEVICEFARM_LOG_DIR directory. diff --git a/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java b/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java index 33b230b1dff..97bd46e3a6e 100644 --- a/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java +++ b/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java @@ -16,6 +16,8 @@ import androidx.annotation.NonNull; import java.io.FileWriter; import java.io.IOException; +import java.io.File; +import com.google.gson.Gson; public class LlmBenchmarkRunner extends Activity implements ModelRunnerCallback { ModelRunner mModelRunner; @@ -23,6 +25,8 @@ public class LlmBenchmarkRunner extends Activity implements ModelRunnerCallback String mPrompt; TextView mTextView; StatsDump mStatsDump; + // We will write the result back to this directory as it's known by the spec file + File modelDir; @Override protected void onCreate(Bundle savedInstanceState) { @@ -32,7 +36,10 @@ protected void onCreate(Bundle savedInstanceState) { Intent intent = getIntent(); - String modelPath = intent.getStringExtra("model_path"); + modelDir = new File(intent.getStringExtra("model_dir")); + File model = Arrays.stream(directory.listFiles()) + .filter(file -> file.getName().endsWith(".pte")) + .findFirst() String tokenizerPath = intent.getStringExtra("tokenizer_path"); float temperature = intent.getFloatExtra("temperature", 0.8f); @@ -42,7 +49,7 @@ protected void onCreate(Bundle savedInstanceState) { } mStatsDump = new StatsDump(); - mModelRunner = new ModelRunner(modelPath, tokenizerPath, temperature, this); + mModelRunner = new ModelRunner(model.getPath(), tokenizerPath, temperature, this); mStatsDump.loadStart = System.currentTimeMillis(); } @@ -79,11 +86,21 @@ public void onGenerationStopped() { mTextView.append(mStatsDump.toString()); }); + // TODO (huydhn): Remove txt files here once the JSON format is ready try (FileWriter writer = new FileWriter(getFilesDir() + "/benchmark_results.txt")) { writer.write(mStatsDump.toString()); } catch (IOException e) { e.printStackTrace(); } + + // TODO (huydhn): Figure out on what the final JSON results looks like, we need something with + // the same number of fields as https://github.com/pytorch/pytorch/pull/135042 + try (FileWriter writer = new FileWriter(modelDir.getPath() + "/benchmark_results.json")) { + Gson gson = new Gson(); + writer.write(gson.toJson(mStatsDump)); + } catch (IOException e) { + e.printStackTrace(); + } } } From abe445bb7ee49f36f466bccfacaac32cdb82035d Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 4 Sep 2024 15:47:55 -0700 Subject: [PATCH 02/13] Silly mistake --- .../com/example/executorchllamademo/LlmBenchmarkRunner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java b/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java index 97bd46e3a6e..907aef13377 100644 --- a/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java +++ b/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java @@ -39,7 +39,7 @@ protected void onCreate(Bundle savedInstanceState) { modelDir = new File(intent.getStringExtra("model_dir")); File model = Arrays.stream(directory.listFiles()) .filter(file -> file.getName().endsWith(".pte")) - .findFirst() + .findFirst(); String tokenizerPath = intent.getStringExtra("tokenizer_path"); float temperature = intent.getFloatExtra("temperature", 0.8f); From 7fbf4d56d2add0238b70e49c32471a28e471687b Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 4 Sep 2024 16:25:15 -0700 Subject: [PATCH 03/13] Another copy/paste mistake --- .../com/example/executorchllamademo/LlmBenchmarkRunner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java b/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java index 907aef13377..bb296c18391 100644 --- a/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java +++ b/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java @@ -37,7 +37,7 @@ protected void onCreate(Bundle savedInstanceState) { Intent intent = getIntent(); modelDir = new File(intent.getStringExtra("model_dir")); - File model = Arrays.stream(directory.listFiles()) + File model = Arrays.stream(modelDir.listFiles()) .filter(file -> file.getName().endsWith(".pte")) .findFirst(); String tokenizerPath = intent.getStringExtra("tokenizer_path"); From a43abc252a297e0a601879c6b1f13378494e17b4 Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 4 Sep 2024 17:08:09 -0700 Subject: [PATCH 04/13] I should have built this locally --- .../java/com/example/executorchllamademo/LlmBenchmarkRunner.java | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java b/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java index bb296c18391..737188689e4 100644 --- a/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java +++ b/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java @@ -18,6 +18,7 @@ import java.io.IOException; import java.io.File; import com.google.gson.Gson; +import java.util.Arrays; public class LlmBenchmarkRunner extends Activity implements ModelRunnerCallback { ModelRunner mModelRunner; From 03119c297b87aa0c0b1ed811c7c4d853f7636e4a Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 4 Sep 2024 18:48:14 -0700 Subject: [PATCH 05/13] Missing .get() --- .../com/example/executorchllamademo/LlmBenchmarkRunner.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java b/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java index 737188689e4..b52d4049066 100644 --- a/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java +++ b/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java @@ -40,7 +40,8 @@ protected void onCreate(Bundle savedInstanceState) { modelDir = new File(intent.getStringExtra("model_dir")); File model = Arrays.stream(modelDir.listFiles()) .filter(file -> file.getName().endsWith(".pte")) - .findFirst(); + .findFirst() + .get(); String tokenizerPath = intent.getStringExtra("tokenizer_path"); float temperature = intent.getFloatExtra("temperature", 0.8f); From b0682765c3160c9052da57af67cb0e0c30f2d4e2 Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 4 Sep 2024 20:53:55 -0700 Subject: [PATCH 06/13] Wrong activity name --- .../android/LlamaDemo/android-llm-device-farm-test-spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml b/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml index 9f5c8afd857..5eaa1eca61e 100644 --- a/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml +++ b/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml @@ -76,7 +76,7 @@ phases: # Run the new generic benchmark activity - echo "Run LLM benchmark" - | - adb -s $DEVICEFARM_DEVICE_UDID shell am start -n com.example.executorchllamademo/.Benchmarking \ + adb -s $DEVICEFARM_DEVICE_UDID shell am start -n com.example.executorchllamademo/.BENCHMARK \ --es "model_dir" "/data/local/tmp/llama" \ --es "tokenizer_path" "/data/local/tmp/llama/tokenizer.bin" From 25dd5dafce5c38fda9f76fb0376649827632922f Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 4 Sep 2024 21:12:52 -0700 Subject: [PATCH 07/13] Use LlmBenchmarkRunner --- .../LlamaDemo/android-llm-device-farm-test-spec.yml | 2 +- .../executorchllamademo/LlmBenchmarkRunner.java | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml b/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml index 5eaa1eca61e..c9437a53766 100644 --- a/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml +++ b/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml @@ -76,7 +76,7 @@ phases: # Run the new generic benchmark activity - echo "Run LLM benchmark" - | - adb -s $DEVICEFARM_DEVICE_UDID shell am start -n com.example.executorchllamademo/.BENCHMARK \ + adb -s $DEVICEFARM_DEVICE_UDID shell am start -n com.example.executorchllamademo/.LlmBenchmarkRunner \ --es "model_dir" "/data/local/tmp/llama" \ --es "tokenizer_path" "/data/local/tmp/llama/tokenizer.bin" diff --git a/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java b/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java index b52d4049066..c20502a61f4 100644 --- a/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java +++ b/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java @@ -14,10 +14,10 @@ import android.util.Log; import android.widget.TextView; import androidx.annotation.NonNull; +import com.google.gson.Gson; +import java.io.File; import java.io.FileWriter; import java.io.IOException; -import java.io.File; -import com.google.gson.Gson; import java.util.Arrays; public class LlmBenchmarkRunner extends Activity implements ModelRunnerCallback { @@ -38,7 +38,8 @@ protected void onCreate(Bundle savedInstanceState) { Intent intent = getIntent(); modelDir = new File(intent.getStringExtra("model_dir")); - File model = Arrays.stream(modelDir.listFiles()) + File model = + Arrays.stream(modelDir.listFiles()) .filter(file -> file.getName().endsWith(".pte")) .findFirst() .get(); @@ -95,8 +96,8 @@ public void onGenerationStopped() { e.printStackTrace(); } - // TODO (huydhn): Figure out on what the final JSON results looks like, we need something with - // the same number of fields as https://github.com/pytorch/pytorch/pull/135042 + // TODO (huydhn): Figure out on what the final JSON results looks like, we need something + // with the same number of fields as https://github.com/pytorch/pytorch/pull/135042 try (FileWriter writer = new FileWriter(modelDir.getPath() + "/benchmark_results.json")) { Gson gson = new Gson(); writer.write(gson.toJson(mStatsDump)); From f857d957e4ac69f95be118d19cd802f094eb4c5f Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 4 Sep 2024 21:19:31 -0700 Subject: [PATCH 08/13] Use s22 --- .github/workflows/upload-android-test-specs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upload-android-test-specs.yml b/.github/workflows/upload-android-test-specs.yml index 5a468da44f1..04f7cf40d73 100644 --- a/.github/workflows/upload-android-test-specs.yml +++ b/.github/workflows/upload-android-test-specs.yml @@ -41,7 +41,7 @@ jobs: with: # Just use a small model here with a minimal amount of configuration to test the spec models: stories110M - devices: samsung_galaxy_s2x + devices: samsung_galaxy_s22 delegates: xnnpack test_spec: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/android-llm-device-farm-test-spec.yml From 7c45d62c58febbec83e827c6c923c234c6ef8f41 Mon Sep 17 00:00:00 2001 From: Huy Do Date: Thu, 5 Sep 2024 15:25:30 -0700 Subject: [PATCH 09/13] Use polling to wait for the benchmark results (for now) --- .../android-llm-device-farm-test-spec.yml | 19 ++++++++++++++++--- .../LlmBenchmarkRunner.java | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml b/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml index c9437a53766..655f333c1ae 100644 --- a/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml +++ b/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml @@ -73,16 +73,29 @@ phases: fi fi; - # Run the new generic benchmark activity + # Run the new generic benchmark activity https://developer.android.com/tools/adb#am - echo "Run LLM benchmark" - | - adb -s $DEVICEFARM_DEVICE_UDID shell am start -n com.example.executorchllamademo/.LlmBenchmarkRunner \ + adb -s $DEVICEFARM_DEVICE_UDID shell am start -W -n com.example.executorchllamademo/.LlmBenchmarkRunner \ --es "model_dir" "/data/local/tmp/llama" \ --es "tokenizer_path" "/data/local/tmp/llama/tokenizer.bin" post_test: commands: - - adb -s $DEVICEFARM_DEVICE_UDID shell "ls -la /data/local/tmp/llama/" + - echo "Wait for the results" + - | + # TODO (huydhn): Polling like this looks brittle, figure out if there is a better way to wait + # for the benchmark results + adb -s $DEVICEFARM_DEVICE_UDID shell run-as com.example.executorchllamademo \ + while ! test -f files/benchmark_results.json; do echo "Waiting for benchmark results..."; sleep 30; done + + adb -s $DEVICEFARM_DEVICE_UDID shell run-as com.example.executorchllamademo ls -la files/ + + - echo "Gather LLM benchmark results" + - | + APP_DIR=$(adb -s $DEVICEFARM_DEVICE_UDID shell run-as com.example.executorchllamademo pwd) + adb -s $DEVICEFARM_DEVICE_UDID pull "${APP_DIR}"/files/benchmark_results.json $DEVICEFARM_LOG_DIR/ + artifacts: # By default, Device Farm will collect your artifacts from the $DEVICEFARM_LOG_DIR directory. diff --git a/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java b/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java index c20502a61f4..bd153f96b1e 100644 --- a/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java +++ b/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java @@ -98,7 +98,7 @@ public void onGenerationStopped() { // TODO (huydhn): Figure out on what the final JSON results looks like, we need something // with the same number of fields as https://github.com/pytorch/pytorch/pull/135042 - try (FileWriter writer = new FileWriter(modelDir.getPath() + "/benchmark_results.json")) { + try (FileWriter writer = new FileWriter(getFilesDir() + "/benchmark_results.json")) { Gson gson = new Gson(); writer.write(gson.toJson(mStatsDump)); } catch (IOException e) { From 94c123104834c9dba3322d823900e0b9b72cf350 Mon Sep 17 00:00:00 2001 From: Huy Do Date: Thu, 5 Sep 2024 15:31:33 -0700 Subject: [PATCH 10/13] Missing change --- .../android/LlamaDemo/android-llm-device-farm-test-spec.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml b/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml index 655f333c1ae..5b57b2a6908 100644 --- a/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml +++ b/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml @@ -93,9 +93,8 @@ phases: - echo "Gather LLM benchmark results" - | - APP_DIR=$(adb -s $DEVICEFARM_DEVICE_UDID shell run-as com.example.executorchllamademo pwd) - adb -s $DEVICEFARM_DEVICE_UDID pull "${APP_DIR}"/files/benchmark_results.json $DEVICEFARM_LOG_DIR/ - + adb -s $DEVICEFARM_DEVICE_UDID shell run-as com.example.executorchllamademo cp files/benchmark_results.json /sdcard + adb -s $DEVICEFARM_DEVICE_UDID pull /sdcard/benchmark_results.json $DEVICEFARM_LOG_DIR/ artifacts: # By default, Device Farm will collect your artifacts from the $DEVICEFARM_LOG_DIR directory. From 1b60eb140c3f0aa4455fd1bd44bf59d990fde6fa Mon Sep 17 00:00:00 2001 From: Huy Do Date: Thu, 5 Sep 2024 18:33:29 -0700 Subject: [PATCH 11/13] Echo the results back --- .../android-llm-device-farm-test-spec.yml | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml b/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml index 5b57b2a6908..47d5c507949 100644 --- a/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml +++ b/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml @@ -82,19 +82,21 @@ phases: post_test: commands: - - echo "Wait for the results" + - echo "Gather LLM benchmark results" - | - # TODO (huydhn): Polling like this looks brittle, figure out if there is a better way to wait - # for the benchmark results - adb -s $DEVICEFARM_DEVICE_UDID shell run-as com.example.executorchllamademo \ - while ! test -f files/benchmark_results.json; do echo "Waiting for benchmark results..."; sleep 30; done + BENCHMARK_RESULTS="" + ATTEMPT=0 + MAX_ATTEMPT=10 + while [ -z "${BENCHMARK_RESULTS}" ] && [ $ATTEMPT -lt $MAX_ATTEMPT ]; do + echo "Waiting for benchmark results..." + BENCHMARK_RESULTS=$(adb -s $DEVICEFARM_DEVICE_UDID shell run-as com.example.executorchllamademo cat files/benchmark_results.json) + sleep 30 + ((ATTEMPT++)) + done adb -s $DEVICEFARM_DEVICE_UDID shell run-as com.example.executorchllamademo ls -la files/ - - - echo "Gather LLM benchmark results" - - | - adb -s $DEVICEFARM_DEVICE_UDID shell run-as com.example.executorchllamademo cp files/benchmark_results.json /sdcard - adb -s $DEVICEFARM_DEVICE_UDID pull /sdcard/benchmark_results.json $DEVICEFARM_LOG_DIR/ + # Trying to pull the file using adb ends up with permission error, but his works too, so why not + echo "${BENCHMARK_RESULTS}" > $DEVICEFARM_LOG_DIR/benchmark_results.json artifacts: # By default, Device Farm will collect your artifacts from the $DEVICEFARM_LOG_DIR directory. From 1b3d73ade6c112145172385b2770503285c7157f Mon Sep 17 00:00:00 2001 From: Huy Do Date: Thu, 5 Sep 2024 18:48:59 -0700 Subject: [PATCH 12/13] Remove unused var --- .../com/example/executorchllamademo/LlmBenchmarkRunner.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java b/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java index bd153f96b1e..cee623507fd 100644 --- a/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java +++ b/examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/LlmBenchmarkRunner.java @@ -26,8 +26,6 @@ public class LlmBenchmarkRunner extends Activity implements ModelRunnerCallback String mPrompt; TextView mTextView; StatsDump mStatsDump; - // We will write the result back to this directory as it's known by the spec file - File modelDir; @Override protected void onCreate(Bundle savedInstanceState) { @@ -37,7 +35,7 @@ protected void onCreate(Bundle savedInstanceState) { Intent intent = getIntent(); - modelDir = new File(intent.getStringExtra("model_dir")); + File modelDir = new File(intent.getStringExtra("model_dir")); File model = Arrays.stream(modelDir.listFiles()) .filter(file -> file.getName().endsWith(".pte")) From 0f45f39d4c55d5bb4aa80cf079f18cace2435a20 Mon Sep 17 00:00:00 2001 From: Huy Do Date: Thu, 5 Sep 2024 18:51:51 -0700 Subject: [PATCH 13/13] Fix typo --- .../android/LlamaDemo/android-llm-device-farm-test-spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml b/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml index 47d5c507949..896e7b73fbf 100644 --- a/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml +++ b/examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml @@ -95,7 +95,7 @@ phases: done adb -s $DEVICEFARM_DEVICE_UDID shell run-as com.example.executorchllamademo ls -la files/ - # Trying to pull the file using adb ends up with permission error, but his works too, so why not + # Trying to pull the file using adb ends up with permission error, but this works too, so why not echo "${BENCHMARK_RESULTS}" > $DEVICEFARM_LOG_DIR/benchmark_results.json artifacts: