-
Notifications
You must be signed in to change notification settings - Fork 221
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
Building executorch runtime #1178
Comments
After reading in detail the documentation on deployment on Android devices a number of times, I have some feedback which I hope you will find of some use:
Thanks |
@adonnini for your immediate question on which directory, it should be the "executorch" directory. Same as what is listed in the steps at https://pytorch.org/executorch/stable/getting-started-setup. I do think we can update the documentation to make this clear and you feedback is helpful here. |
These are great suggestions. Let me get to them to either address or understand better.
This is absolutely fair. Particularly documentation around integrating executorch in your own app is something I would call WIP. This is because for our first release, we did not get around to focusing on this aspect largely due to competing priorities and resource constraints. I love that you have raised it here as this is something we can target to improve upon immediately.
Can you say a little more on this? Documentation does list "pre-requisite", but perhaps something is not clear and we can improve that.
This is a good point. I think as part of addressing your 1st concern, we should cover this. |
@kimishpatel, Thanks. Below you will find the commands I ran at "executorch" together with the traceback for the failure. What am I doing wrong?
|
@kimishpatel With regards to your question about my point on "starting points", I apologize. I was not clear. I was referring to the fact that the documentation as I read it does not say something as simple as: "...Starting from //executorch run the following commands..." In other words, set the stage, give the coordinates so to speak. My wording is poor but I hope you understand what I mean. By the way, I completely understand about your priorities. Developers benefit from what you are prioritizing. Keeping this in mind, I would say that the documentation is really very good. https://pytorch.org/executorch/stable/demo-apps-android.html#building-an-executorch-android-demo-app seems to have been put together in a hurry, and not by an Android app developer. |
100% agree on this. |
Hi @adonnini, in our repo we usually assume the cwd is root directory (executorch/), and we often assume that buck2 is extracted to /tmp/buck2 (see https://pytorch.org/executorch/stable/getting-started-setup.html#building-a-runtime). You brought up a good point about we should make these assumptions clear. |
@adonnini let us know if this helps. As @kirklandsign pointed out this is related to where buck2 is installed. Totally sympathize with your pain points btw. Some of these may not be communicated clearly. @kirklandsign can we fix the documentation for a few different things that have been brought up here. |
UPDATE All the steps in Next I tried to build the runtime library for the executorch Android demo app again Before doing that I ran
as per the instructions in The attempt to build the runtime ended in failure. Please see the traceback log below. I fulfilled the prerequisites described in Does it matter that I am running Debian 12 and not one of the Linux variants listed in the prerequisites column? I am at a loss as to what I should do next, and what I did wrong. Please let me know what you think I should do. Thanks
|
I was able to complete by changing in cmake .. NEXT STEPSI ran my android application using
As I thought, in order to run inference in my application using the executorch runtime, I need a "generic" executorch naitve library. Is such a library in your plans? Alternatively, I could try to set up a ""com.example.executorchdemo.executor" package in my application. This could be a shor-term solution. In any event, I would appreciate knowing whether a general purpose native library for running the executorch runtime in an Android application is planned. Thanks |
Currently we hardcoded the JNI code in https://github.com/pytorch/executorch/blob/main/examples/demo-apps/android/jni/jni_layer.cpp and the corresponding java code is https://github.com/pytorch/executorch/tree/main/examples/demo-apps/android/ExecuTorchDemo/app/src/main/java/com/example/executorchdemo/executor. The official API for java apps is not released yet at the time, but yes it is planned. |
@kirklandsign I understand. Thanks. In the meantime, I will add the com.example.executorchdemo.executor package to my app. Is the best way for me to keep track of progress towards the API for Java apps to monitor the executor github?. |
@adonnini the java APIs as well as android distributions are very much works in progress. Our first release in Oct'23 was just MVP. We will be following this up with subsequent releases and please stay tuned on the progress there. In the meantime, we would appreciate your feedback as well as feature requests |
@kimishpatel Is a pre-release of the Java API available? Where could I find it? I thought @kirklandsign said that it was not released. Even a pre-release (with all the caveats that go along with it) would be very useful because right now, I cannot continue working on this as libexecutorchdemo.so is hard coded to work with the demo app only. |
@adonnini yeah so unfortunately java bindings (JNI) are hardcoded in the demo app. Let me get back to you on factoring that out to make it work outside of the demo app. Do you mind filing another issue specifically for this and we can close this one? |
Sorry for this question.
From
https://pytorch.org/executorch/stable/demo-apps-android.html#xnnpack
it is not clear where in the directory tree to run the commands listed in this section.
I tried running them in a number of locations including
executorch/examples/demo-apps/android/jni
where the error wasadd_subdirectory given source "/home/adonnini1/Development/ContextQSourceCode/NeuralNetworks/trajectory-prediction-transformers-master/executorch/examples/demo-apps/android/../../../third-party/fbjni" which is not an existing directory.
I guess it should be "obvious". It isn't to me. Sorry.
Thanks
The text was updated successfully, but these errors were encountered: