├── 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# craete venv with Python 3.10
conda create -n python310 python=3.10
# activate venv
conda activate python310
# verify python version
python --versiongit clone https://github.com/SeoyeonPark1223/EXECUTORCH.git
cd EXECUTORCHpip install -r requirements.txtpip install .pytest -s tests/run_bench --help
run_bench --model {model_name} --repeat {repeat_num}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 -s tests/test_benchmark_logs.pyExample output:
{
"model_name": "resnet18.pte",
"latency_ms_avg": 13.76,
"repeat": 5
}
====== 1 passed, 1 warning in 2.69s ======
run_bench --model resnet18.pte --repeat 5Example output:
{
"model_name": "resnet18.pte",
"latency_ms_avg": 12.98,
"repeat": 5
}