Skip to content

Commit bdf658b

Browse files
authored
[CMake] Add preset for building executor_runner with profiling (#12682)
Adding a new preset for users to build executor_runner for profiling. I will follow up later with a script on generating a .csv for the models per-operator profiling information ``` cmake --preset profiling cmake --build cmake-out/ --target executor_runner ```
1 parent 3f77fac commit bdf658b

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed

.github/workflows/build-presets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
preset: [macos, ios, ios-simulator, pybind, llm]
23+
preset: [macos, ios, ios-simulator, pybind, profiling, llm]
2424
with:
2525
job-name: build
2626
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}

CMakePresets.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,26 @@
100100
"list": ["Darwin", "Linux", "Windows"]
101101
}
102102
},
103+
{
104+
"name": "profiling",
105+
"displayName": "Build ExecuTorch with Profiling Enabled",
106+
"inherits": [
107+
"common"
108+
],
109+
"cacheVariables": {
110+
"EXECUTORCH_BUILD_PRESET_FILE": "${sourceDir}/tools/cmake/preset/profiling.cmake",
111+
"CMAKE_OSX_DEPLOYMENT_TARGET": "12.0"
112+
},
113+
"condition": {
114+
"type": "inList",
115+
"string": "${hostSystemName}",
116+
"list": [
117+
"Darwin",
118+
"Linux",
119+
"Windows"
120+
]
121+
}
122+
},
103123
{
104124
"name": "zephyr",
105125
"displayName": "Build ExecuTorch for Zephyr RTOS",

tools/cmake/preset/profiling.cmake

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
6+
7+
# Presets to enable profiling in executor runner
8+
9+
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER ON)
10+
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR ON)
11+
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_MODULE ON)
12+
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_TENSOR ON)
13+
set_overridable_option(EXECUTORCH_BUILD_KERNELS_LLM ON)
14+
set_overridable_option(EXECUTORCH_BUILD_KERNELS_OPTIMIZED ON)
15+
set_overridable_option(EXECUTORCH_BUILD_KERNELS_QUANTIZED ON)
16+
set_overridable_option(EXECUTORCH_BUILD_XNNPACK ON)
17+
set_overridable_option(EXECUTORCH_BUILD_DEVTOOLS ON)
18+
19+
# Presets to build executor runner
20+
21+
set_overridable_option(EXECUTORCH_BUILD_EXECUTOR_RUNNER ON)
22+
set_overridable_option(EXECUTORCH_ENABLE_EVENT_TRACER ON)
23+
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_EVALUE_UTIL ON)
24+
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL ON)

0 commit comments

Comments
 (0)