-
Activate the environment:
export EXECUTORCH_DIR=/path/to/executorch
source .venv/bin/activate
-
Start from the closest template:
cp model_profiling/configs/templates/mac_template.json model_profiling/configs/my_experiment.json
cp model_profiling/configs/templates/android_template.json model_profiling/configs/my_android_experiment.json
-
Edit the config so model, output_root, experiments[].runner_path, mode, runs, warmup, and threads match the task. A minimal macOS pair is:
{
"model": "model_profiling/out_toy_cnn/artifacts/toy_cnn_xnnpack_fp16.pte",
"output_root": "model_profiling/out_toy_cnn/runs/mac",
"experiments": [
{
"name": "mac_sme2_on",
"runner_path": "executorch/cmake-out/mac-arm64/executor_runner",
"mode": "timing",
"runs": 10,
"warmup": 1,
"threads": [1]
},
{
"name": "mac_sme2_off",
"runner_path": "executorch/cmake-out/mac-arm64-sme2-off/executor_runner",
"mode": "timing",
"runs": 10,
"warmup": 1,
"threads": [1]
}
],
"analysis": { "compare_pairs": [] }
}
-
Validate JSON before execution:
python -m json.tool model_profiling/configs/my_experiment.json >/dev/null
-
Run the pipeline:
python model_profiling/scripts/mac_pipeline.py \
--config model_profiling/configs/my_experiment.json
Run XNNPACK trace separately when kernel-selection evidence is required. The toy smoke config is:
python model_profiling/scripts/mac_pipeline.py \
--config model_profiling/configs/toy_cnn_trace_run.json
For Android:
bash model_profiling/scripts/check_prereqs.sh --android-run
python model_profiling/scripts/android_pipeline.py \
--config model_profiling/configs/my_android_experiment.json
For a remote Android device:
bash model_profiling/scripts/check_prereqs.sh --android-run
python model_profiling/scripts/android_pipeline.py \
--config model_profiling/configs/my_android_experiment.json \
--remote-device 192.168.1.100:5555
-
Re-run analysis without re-executing the model when needed:
python model_profiling/scripts/mac_pipeline.py \
--config model_profiling/configs/my_experiment.json \
--analysis-only
-
Validate the run directory:
python model_profiling/scripts/validate_results.py \
--results model_profiling/out_toy_cnn/runs/mac
Validate XNNPACK trace evidence:
python model_profiling/scripts/validate_results.py \
--results model_profiling/out_toy_cnn/runs/mac_trace \
--require-sme2-kernels