-
Notifications
You must be signed in to change notification settings - Fork 767
Add runtime control to Android ETDump profiling #16359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/16359
Note: Links to docs will display an error until the docs builds have been completed. ❌ 7 New Failures, 5 Unrelated FailuresAs of commit 24ee8a9 with merge base 479791d ( NEW FAILURES - The following jobs have failed:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
|
Mind hint me about the relationship between Android ETDump and devtool one? Basically it is our ETDump + an Android Wrapper if I understand corrent? |
Yes Android ET Dump is simply a wrapper , Core ETDump + High level Android Dump helper APIs , making it very flexible for Android apps to profile dynamically |
fc48173 to
1c67290
Compare
Enhances existing EXECUTORCH_ANDROID_PROFILING with runtime control API.
Replaces hardcoded profiling with flexible, production-ready implementation.
New Capabilities:
- Runtime profiling control via ETDump.enableProfiling()/disableProfiling()
- Configurable output paths
- Programmatic data access with getETDumpData()
- Zero performance overhead when profiling is disabled
- Single APK deployment (enable/disable at runtime)
Implementation:
- Add ETDump.java: Public Java API for profiling control
- Add executorch_jni_etdump.cpp: JNI implementation with global ETDumpManager
- Modify jni_layer.cpp: Integrate ETDump with Module loading
- Modify CMakeLists.txt: Enhance EXECUTORCH_ANDROID_PROFILING flag
Backward Compatible:
- Same build flag (EXECUTORCH_ANDROID_PROFILING)
- Default behavior: profiling disabled (zero overhead)
- Users who already enable profiling get new features automatically
Usage:
// Build with: -DEXECUTORCH_ANDROID_PROFILING=ON
ETDump.enableProfiling("/sdcard/profile.etdump");
Module module = Module.load("model.pte");
module.forward(inputs);
ETDump.writeETDump();
ETDump.disableProfiling();
Enhances existing EXECUTORCH_ANDROID_PROFILING with runtime control API.
Replaces hardcoded profiling with flexible, production-ready implementation.
New Capabilities:
Implementation:
Backward Compatible:
Usage:
// Build with: -DEXECUTORCH_ANDROID_PROFILING=ON
Summary
[PLEASE REMOVE] See CONTRIBUTING.md's Pull Requests for ExecuTorch PR guidelines.
[PLEASE REMOVE] If this PR closes an issue, please add a
Fixes #<issue-id>line.[PLEASE REMOVE] If this PR introduces a fix or feature that should be the upcoming release notes, please add a "Release notes: " label. For a list of available release notes labels, check out CONTRIBUTING.md's Pull Requests.
Test plan
Test Command: EXECUTORCH_ANDROID_PROFILING=ON sh scripts/build_android_library.sh