executorch icon indicating copy to clipboard operation
executorch copied to clipboard

[Android] Java API for runtime info

Open kirklandsign opened this issue 7 months ago • 1 comments

🚀 The feature, motivation and pitch

In https://github.com/pytorch/executorch/issues/10439 we will add a new Runtime.java.

Now add some API where we can query

  • String[] getRegisteredOps()
  • String[] getRegisteredBackends()

This can help user debug issue when like missing ops.

Alternatives

No response

Additional context

No response

RFC (Optional)

No response

cc @cbilgin

kirklandsign avatar Apr 24 '25 19:04 kirklandsign

I’d be happy to work on this

keyprocedure avatar Apr 27 '25 15:04 keyprocedure

Hi @kirklandsign, I've implemented Runtime.java (along with a unit test) and hooked it up via JNI, but I realized the list of ops is only available on the Python side.

Do you have any suggestions on generating the delegate and ops list? Would you prefer I hardcode it in Runtime.java for the supported delegates (XNNPACK, MediaTek, Qualcomm, Vulkan) for now, or write a Python script to generate it at build time?

I was able to find lists of supported ops for XNNPACK, Qualcomm, and Vulkan, but haven't been able to find the ops available for MediaTek.

keyprocedure avatar Apr 30 '25 18:04 keyprocedure