-
Notifications
You must be signed in to change notification settings - Fork 5
program-data-separation demo #42
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
11059f6
to
bd2e5c2
Compare
@@ -2,3 +2,8 @@ | |||
path = mv2/cpp/executorch | |||
url = https://github.com/pytorch/executorch.git | |||
branch = release/0.6 | |||
|
|||
[submodule "program-data-separation/cpp/executorch"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have ET as a submodule for each project, though?
Note: we don't have a release for 0.7, once we do we could potentially update and consolidate the two submodules?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, eventually we could just have a common submodule directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for now, don't worry about it
bd2e5c2
to
588ae93
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See inline
# Program Data Separation Examples | ||
|
||
This directory provides an example of the Program Data Separation APIs in ExecuTorch. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Give some motivation and high-level context of what and why
``` | ||
Or alternatively, [install conda on your machine](https://conda.io/projects/conda/en/latest/user-guide/install/index.html) | ||
```bash | ||
conda create -yn executorch-examples-mv2 python=3.10.0 && conda activate executorch-examples-mv2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use a different conda env name. executorch-examples-mv2 is a bit confusing
@@ -0,0 +1,45 @@ | |||
|
|||
cmake_minimum_required(VERSION 3.18 FATAL_ERROR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might need to update to 3.29 now
@@ -0,0 +1,45 @@ | |||
|
|||
cmake_minimum_required(VERSION 3.18 FATAL_ERROR) | |||
project(executorch_mv2_demo CXX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use different project name
@@ -2,3 +2,8 @@ | |||
path = mv2/cpp/executorch | |||
url = https://github.com/pytorch/executorch.git | |||
branch = release/0.6 | |||
|
|||
[submodule "program-data-separation/cpp/executorch"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, eventually we could just have a common submodule directory
[submodule "program-data-separation/cpp/executorch"] | ||
path = program-data-separation/cpp/executorch | ||
url = https://github.com/pytorch/executorch.git | ||
branch = main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have 'release/0.7' branch, so it should just work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only pip install executorch==0.7.0
will not work for the time being
const char *data_path = FLAGS_data_path.c_str(); | ||
|
||
// Load the model. | ||
Module module(model_path, data_path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have support for swift and java bindings?
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#include <executorch/extension/module/module.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to update this doc?
https://docs.pytorch.org/executorch/main/extension-module.html
with open(pte_file, "wb") as fp: | ||
executorch_program.write_to_file(fp) | ||
if executorch_program._tensor_data.get("_default_external_constant"): | ||
executorch_program._tensor_data[model_name] = ( | ||
executorch_program._tensor_data.pop("_default_external_constant") | ||
) | ||
executorch_program.write_tensor_data_to_file(args.outdir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where are these AOT APIs document?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we update this doc too?
https://docs.pytorch.org/executorch/main/using-executorch-export.html
@@ -2,3 +2,8 @@ | |||
path = mv2/cpp/executorch | |||
url = https://github.com/pytorch/executorch.git | |||
branch = release/0.6 | |||
|
|||
[submodule "program-data-separation/cpp/executorch"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for now, don't worry about it
Add examples on how to generate PTE, PTD files, and how to run them in ExecuTorch via Module.
Note: I created a separate ET submodule --> we need the changes from 0.7 for this. However, I'm not sure we should be creating a new submodule for each project.
Issue: pytorch/executorch#12215