Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempting running Minibench on Android, no results generated #7076

Open
deneriz-veridas opened this issue Nov 26, 2024 · 3 comments
Open

Attempting running Minibench on Android, no results generated #7076

deneriz-veridas opened this issue Nov 26, 2024 · 3 comments
Assignees
Labels
Android Android building and execution related. bug Something isn't working module: benchmark Features or issues related to benchmark infra, including the workflow, CI and benchmark apps triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@deneriz-veridas
Copy link

🐛 Describe the bug

Hi all! I'm attempting to execute the Minibench app on Android to benchmark some models on my device. As an example I'm using the add.pte generated in the Getting started guide.

After successfully building the LLM demo with

bash build/build_android_llm_demo.sh

and manually copying .aar files to app/libs/, I get the following tree (not fully displayed).

.
└── executorch/
    ├── app/
    │   └── libs/
    │       ├── executorch-llama.aar
    │       └── executoch.aar
    ├── artifacts/
    │   ├── llm_demo/
    │   │   ├── arm64-v8a/
    │   │   │   └── *.a
    │   │   ├── x86_64/
    │   │   │   └── *.a
    │   │   ├── app-debug-androidTest.apk
    │   │   ├── app-debug.apk
    │   │   ├── executorch-llama.aar
    │   │   ├── executoch.aar
    │   │   └── executorch.jar
    │   └── minibench/
    │       ├── app-debug-androidTest.apk
    │       └── app-debug.apk
    └── extension/
        └── andorid/
            ├── benchmark/
            │   ├── app/
            │   │   ├── build/
            │   │   │   ├── generated/
            │   │   │   ├── intermediates/
            │   │   │   ├── outputs/
            │   │   │   ├── resports/test-results/
            │   │   │   └── tmp/
            │   │   ├── libs/
            │   │   └── src/
            │   └── ...
            └── build/
                ├── .transforms/
                ├── classes/
                ├── generated/
                ├── libs/
                └── tmp/

Then, I open executorch/extension/andorid/benchmark/ on Andorid Studio and execute ./gradlew installDebug. It succesfully installs the app on my device.

> Task :app:installDebug
Installing APK 'app-debug.apk' on 'Pixel 7 Pro - 15' for :app:debug
Installed on 1 device.

BUILD SUCCESSFUL in 8s
33 actionable tasks: 1 executed, 32 up-to-date

Then I create the minibench temp dir inside the phone and move add.pte, as indicated on the Minibench README.

When I attempt the execution of the benchmark, I get the following output:

user@pc:~/parent/executorch/extension/android/benchmark$ adb shell am start -W -S -n org.pytorch.minibench/org.pytorch.minibench.LlmBenchmarkActivity --es model_dir /data/local/tmp/minibench
Stopping: org.pytorch.minibench
Starting: Intent { cmp=org.pytorch.minibench/.LlmBenchmarkActivity (has extras) }
Status: ok
LaunchState: UNKNOWN (0)
Activity: org.pytorch.minibench/.LlmBenchmarkActivity
WaitTime: 233
Complete

And there is not results file:

user@pc:~/parent/executorch/extension/android/benchmark$ adb shell run-as org.pytorch.minibench cat files/benchmark_results.json
cat: files/benchmark_results.json: No such file or directory

In fact, there are only cache dirs:

user@pc:~/parent/executorch/extension/android/benchmark$ adb shell run-as org.pytorch.minibench ls
cache
code_cache

Any idea of what I'm missing? Thanks in advance!

Versions

Collecting environment information...
PyTorch version: 2.5.0+cpu
Is debug build: False
CUDA used to build PyTorch: Could not collect
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.5 LTS (x86_64)
GCC version: (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
Clang version: Could not collect
CMake version: version 3.31.0
Libc version: glibc-2.35

Python version: 3.10.15 (main, Oct  3 2024, 07:27:34) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-6.8.0-49-generic-x86_64-with-glibc2.35
Is CUDA available: False
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 4060 Laptop GPU
Nvidia driver version: 550.120
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Arquitectura:                         x86_64
modo(s) de operación de las CPUs:     32-bit, 64-bit
Address sizes:                        39 bits physical, 48 bits virtual
Orden de los bytes:                   Little Endian
CPU(s):                               24
Lista de la(s) CPU(s) en línea:       0-23
ID de fabricante:                     GenuineIntel
Nombre del modelo:                    13th Gen Intel(R) Core(TM) i7-13700HX
Familia de CPU:                       6
Modelo:                               183
Hilo(s) de procesamiento por núcleo:  2
Núcleo(s) por «socket»:               16
«Socket(s)»                           1
Revisión:                             1
CPU MHz máx.:                         5000,0000
CPU MHz mín.:                         800,0000
BogoMIPS:                             4608.00
Indicadores:                          fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi vnmi umip pku ospke waitpkg gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm md_clear serialize arch_lbr ibt flush_l1d arch_capabilities
Virtualización:                       VT-x
Caché L1d:                            640 KiB (16 instances)
Caché L1i:                            768 KiB (16 instances)
Caché L2:                             14 MiB (10 instances)
Caché L3:                             30 MiB (1 instance)
Modo(s) NUMA:                         1
CPU(s) del nodo NUMA 0:               0-23
Vulnerability Gather data sampling:   Not affected
Vulnerability Itlb multihit:          Not affected
Vulnerability L1tf:                   Not affected
Vulnerability Mds:                    Not affected
Vulnerability Meltdown:               Not affected
Vulnerability Mmio stale data:        Not affected
Vulnerability Reg file data sampling: Mitigation; Clear Register File
Vulnerability Retbleed:               Not affected
Vulnerability Spec rstack overflow:   Not affected
Vulnerability Spec store bypass:      Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:             Mitigation; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S
Vulnerability Srbds:                  Not affected
Vulnerability Tsx async abort:        Not affected

Versions of relevant libraries:
[pip3] executorch==0.4.0a0+6a085ff
[pip3] numpy==1.21.3
[pip3] torch==2.5.0+cpu
[pip3] torchaudio==2.5.0+cpu
[pip3] torchsr==1.0.4
[pip3] torchvision==0.20.0+cpu
[conda] executorch                0.4.0a0+6a085ff          pypi_0    pypi
[conda] numpy                     1.21.3                   pypi_0    pypi
[conda] torch                     2.5.0+cpu                pypi_0    pypi
[conda] torchaudio                2.5.0+cpu                pypi_0    pypi
[conda] torchsr                   1.0.4                    pypi_0    pypi
[conda] torchvision               0.20.0+cpu               pypi_0    pypi
@deneriz-veridas deneriz-veridas changed the title Attempting running Minibench on Android, not results generated Attempting running Minibench on Android, no results generated Nov 27, 2024
@JacobSzwejbka
Copy link
Contributor

@kirklandsign can you take a look at this android issue?

@JacobSzwejbka JacobSzwejbka added bug Something isn't working Android Android building and execution related. module: benchmark Features or issues related to benchmark infra, including the workflow, CI and benchmark apps labels Dec 2, 2024
@kirklandsign
Copy link
Contributor

Another data point: #7091 (comment)

@dbort dbort added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Dec 3, 2024
@deneriz-veridas
Copy link
Author

I've tested with today's nightly and I'm getting the same behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Android building and execution related. bug Something isn't working module: benchmark Features or issues related to benchmark infra, including the workflow, CI and benchmark apps triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

4 participants