Skip to content

SeoyeonPark1223/EXECUTORCH

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExecuTorch

Docs

  1. Main Page
  2. Executorch 오픈소스 분석
  3. 모델 실행 검증 도구
  4. 실행 로깅 유틸리티

Project Structure

├── README.md
├── benchmark
│   └── run_benchmark.py # logging benchmark
├── model
│   ├── export_resnet18.py # model export
│   └── model_outputs # executorch model dir
│       └── resnet18.pte
├── pyproject.toml # setting for run_bench cli
├── requirements.txt
└── tests # pytests
    ├── test_benchmark_logs.py # test run_benchmark
    └── test_resnet18_equivalence.py # compare pytorch & executorch model

Quick Start

0. Recommended Env

# craete venv with Python 3.10
conda create -n python310 python=3.10

# activate venv
conda activate python310
# verify python version 
python --version

1. Git Clone

git clone https://github.com/SeoyeonPark1223/EXECUTORCH.git
cd EXECUTORCH

2. Installation

requirement.txt

pip install -r requirements.txt

pyproject.toml for run_bench cli

pip install .

3. Test

Run Pytest

pytest -s tests/

Run CLI Benchmark (example)

run_bench --help
run_bench --model {model_name} --repeat {repeat_num}

Test Examples

Pytest 1:

pytest -s tests/test_resnet18_equivalence()

Example output:

model_name: resnet18
mean_absolute_difference: 0.00000121
pytorch_latency: avg 14.77 ms, max 30.64 ms
executorch_latency: avg 11.44 ms, max 14.74 ms
====== 1 passed, 9 warnings in 10.07s ======

Pytest 2:

pytest -s tests/test_benchmark_logs.py

Example output:

{
"model_name": "resnet18.pte",
"latency_ms_avg": 13.76,
"repeat": 5
}
====== 1 passed, 1 warning in 2.69s ======

CLI:

run_bench --model resnet18.pte --repeat 5

Example output:

{
"model_name": "resnet18.pte",
"latency_ms_avg": 12.98,
"repeat": 5
}

Reference

About

Executorch: Executing Pytorch on the Edge

Resources

Stars

Watchers

Forks

Languages