Skip to content

Support ETDump Generation in JNI Bindings #8135

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

Open
GregoryComer opened this issue Feb 3, 2025 · 3 comments
Open

Support ETDump Generation in JNI Bindings #8135

GregoryComer opened this issue Feb 3, 2025 · 3 comments
Labels
module: android Issues related to Android code, build, and execution module: user experience Issues related to reducing friction for users triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@GregoryComer
Copy link
Member

GregoryComer commented Feb 3, 2025

🚀 The feature, motivation and pitch

ExecuTorch provides the ability to generate ETDumps through the native API surface, but this functionality is not currently exposed through the JNI bindings. It would desirable to be able to generate an ETDump from Java, as right now there is no way to do this.

Alternatives

No response

Additional context

No response

RFC (Optional)

No response

cc @kirklandsign @mergennachin @byjlw

@GregoryComer GregoryComer added module: android Issues related to Android code, build, and execution module: user experience Issues related to reducing friction for users labels Feb 3, 2025
@github-project-automation github-project-automation bot moved this to To triage in ExecuTorch DevX Feb 3, 2025
@digantdesai digantdesai added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Feb 3, 2025
@kirklandsign
Copy link
Contributor

Hi @GregoryComer I'm curious about the use case. Could you please add a bit more details?

@GregoryComer
Copy link
Member Author

GregoryComer commented Feb 6, 2025

Hi @GregoryComer I'm curious about the use case. Could you please add a bit more details?

This is part of the general goal of reaching API parity for Java bindings, such that Android devs can rely solely on Java APIs without needing to drop down to C++ for common use cases. Since performance profiling is a relatively common part of onboarding a model, it would be desirable to be able to generate an ETDump entirely within Java.

Right now, if a user starts with Java and wants to profile in-app, they'll have to re-write their inference code in C++ and integrate native build. Runners might help, but they are somewhat high friction and also don't necessarily capture any CPU or resource contention happening in-app.

I was thinking we can maybe just add a Java EventTracer class which can be passed into Module, the same way it works in C++. https://github.com/pytorch/executorch/blob/main/extension/module/module.h#L52. Any objections?

@GregoryComer GregoryComer moved this from To triage to Ready in ExecuTorch DevX Feb 6, 2025
@mergennachin
Copy link
Contributor

Actually, I would have to set low-pri for this use-case, considering the basics for Android ready first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: android Issues related to Android code, build, and execution module: user experience Issues related to reducing friction for users triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
Status: Backlog
Development

No branches or pull requests

4 participants