pytorch / executorch

On-device AI across mobile, embedded and edge for PyTorch
https://pytorch.org/executorch/
Other
1.69k stars 288 forks source link

Missing instructions to run qnn models #4767

Closed guangy10 closed 2 weeks ago

guangy10 commented 4 weeks ago

🐛 Describe the bug

None of the models in examples/qualcomm/scripts have instructions of how-to run the AOT path. By looking at the script, it seems like only -a and -d are needed, but when run it with -a and -d it ends up with errors and prompts more args to set

usage: mobilenet_v2.py [-h] -m MODEL -b BUILD_FOLDER [-H HOST] [--ip IP] [--port PORT] [-S SKIP_DELEGATE_NODE_IDS] [-f SKIP_DELEGATE_NODE_OPS] [-c] [-s DEVICE]
                       [-z] -d DATASET [-a ARTIFACT]

With out instructions, I don't think users know how to use it

Versions

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

OS: CentOS Stream 9 (x86_64) GCC version: (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3) Clang version: Could not collect CMake version: version 3.29.0 Libc version: glibc-2.34

Python version: 3.10.0 | packaged by conda-forge | (default, Nov 20 2021, 02:24:10) [GCC 9.4.0] (64-bit runtime) Python platform: Linux-5.19.0-0_fbk21_hardened_12633_g4db063a1bcb5-x86_64-with-glibc2.34 Is CUDA available: False CUDA runtime version: No CUDA CUDA_MODULE_LOADING set to: N/A GPU models and configuration: No CUDA Nvidia driver version: No CUDA cuDNN version: No CUDA HIP runtime version: N/A MIOpen runtime version: N/A Is XNNPACK available: True

CPU: Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Address sizes: 40 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 72 On-line CPU(s) list: 0-71 Vendor ID: GenuineIntel Model name: Intel Core Processor (Broadwell) CPU family: 6 Model: 61 Thread(s) per core: 1 Core(s) per socket: 36 Socket(s): 2 Stepping: 2 BogoMIPS: 3990.62 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt arat Virtualization: VT-x Hypervisor vendor: KVM Virtualization type: full L1d cache: 2.3 MiB (72 instances) L1i cache: 2.3 MiB (72 instances) L2 cache: 288 MiB (72 instances) L3 cache: 32 MiB (2 instances) NUMA node(s): 1 NUMA node0 CPU(s): 0-71 Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled Vulnerability L1tf: Mitigation; PTE Inversion; VMX vulnerable, SMT disabled Vulnerability Mds: Vulnerable; SMT Host state unknown Vulnerability Meltdown: Vulnerable Vulnerability Mmio stale data: Not affected Vulnerability Retbleed: Not affected Vulnerability Spec store bypass: Vulnerable Vulnerability Spectre v1: Vulnerable: __user pointer sanitization and usercopy barriers only; no swapgs barriers Vulnerability Spectre v2: Vulnerable, STIBP: disabled Vulnerability Srbds: Unknown: Dependent on hypervisor status Vulnerability Tsx async abort: Vulnerable

Versions of relevant libraries: [pip3] executorch==0.4.0a0+99e1ae1 [pip3] flake8==6.1.0 [pip3] flake8-breakpoint==1.1.0 [pip3] flake8-bugbear==23.9.16 [pip3] flake8-comprehensions==3.14.0 [pip3] flake8-executable==2.1.3 [pip3] flake8-logging-format==0.9.0 [pip3] flake8-plugin-utils==1.3.3 [pip3] flake8-pyi==23.5.0 [pip3] flake8-simplify==0.19.3 [pip3] mypy==1.8.0 [pip3] mypy-extensions==1.0.0 [pip3] numpy==1.21.3 [pip3] optree==0.10.0 [pip3] torch==2.5.0.dev20240716+cpu [pip3] torchao==0.1 [pip3] torchaudio==2.4.0.dev20240716+cpu [pip3] torchsr==1.0.4 [pip3] torchvision==0.20.0.dev20240716+cpu [pip3] triton==3.0.0 [conda] executorch 0.4.0a0+99e1ae1 pypi_0 pypi [conda] numpy 2.0.1 pypi_0 pypi [conda] optree 0.10.0 pypi_0 pypi [conda] torch 2.5.0.dev20240716+cpu pypi_0 pypi [conda] torchao 0.1 pypi_0 pypi [conda] torchaudio 2.4.0.dev20240716+cpu pypi_0 pypi [conda] torchfix 0.5.0 pypi_0 pypi [conda] torchsr 1.0.4 pypi_0 pypi [conda] torchvision 0.20.0.dev20240716+cpu pypi_0 pypi [conda] triton 3.0.0 pypi_0 pypi

digantdesai commented 3 weeks ago

@cccclai can you take a look at this?

haowhsu-quic commented 3 weeks ago

Hi, may I know if test case could help? We'll describe more details in incoming PRs, thank you for reminding.

guangy10 commented 3 weeks ago

Hi, may I know if test case could help? We'll describe more details in incoming PRs, thank you for reminding.

@haowhsu-quic I think it should be helpful. Let me take a look! It seems like most of the models will require downloading this dataset https://www.kaggle.com/datasets/ifigotin/imagenetmini-1000. Maybe it's better to add a --download option to as how it's wrapped in deeplab_v3. Also the dataset is large which adds overhead and stability risks to the OSS CI if we want to cover the qnn workflow in CI. I guess if the dataset is for validation, isn't better to decouple it from exporting the model?

guangy10 commented 2 weeks ago

Added most QNN enabled models to CI