From e66b7d910764c28c13ccbd593f7e71beb11de4a6 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Fri, 20 Feb 2026 14:27:49 -0800 Subject: [PATCH 1/3] Remove duplicate executorch submodule, use symlink instead Replace the program-data-separation/cpp/executorch submodule (tracking main) with a symlink to third-party/executorch (release/1.0), matching the pattern used by mv2/cpp, mv2/wasm, efficient_sam/wasm, and stories110M/wasm. All CMake build options needed by program-data-separation exist in release/1.0. Saves ~700MB of vendored code and eliminates drift risk between two copies. Update lora and linear example READMEs to reference the shared submodule path and recommend nightly pip install for LoRA export features. --- .gitmodules | 4 ---- program-data-separation/cpp/executorch | 2 +- .../cpp/linear_example/README.md | 4 ++-- .../cpp/lora_example/README.md | 23 +++++++++---------- 4 files changed, 14 insertions(+), 19 deletions(-) mode change 160000 => 120000 program-data-separation/cpp/executorch diff --git a/.gitmodules b/.gitmodules index 870bf10c..b035b996 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,7 +3,3 @@ url = https://github.com/pytorch/executorch.git branch = release/1.0 -[submodule "program-data-separation/cpp/executorch"] - path = program-data-separation/cpp/executorch - url = https://github.com/pytorch/executorch.git - branch = main diff --git a/program-data-separation/cpp/executorch b/program-data-separation/cpp/executorch deleted file mode 160000 index 035d25c1..00000000 --- a/program-data-separation/cpp/executorch +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 035d25c19bb99fe7b1a1b19babf8117afe1b4d66 diff --git a/program-data-separation/cpp/executorch b/program-data-separation/cpp/executorch new file mode 120000 index 00000000..09b3b7f6 --- /dev/null +++ b/program-data-separation/cpp/executorch @@ -0,0 +1 @@ +../../third-party/executorch \ No newline at end of file diff --git a/program-data-separation/cpp/linear_example/README.md b/program-data-separation/cpp/linear_example/README.md index 1e8a0f95..2ad9b35a 100644 --- a/program-data-separation/cpp/linear_example/README.md +++ b/program-data-separation/cpp/linear_example/README.md @@ -39,7 +39,7 @@ Note: See [program-data-separation](../../README.md) for instructions. ## Install runtime dependencies. -The ExecuTorch repository is configured as a git submodule at `~/executorch-examples/program-data-separation/cpp/executorch`. To initialize it: +The ExecuTorch repository is configured as a git submodule at `~/executorch-examples/third-party/executorch`, with `program-data-separation/cpp/executorch` being a symlink to it. To initialize: ```bash cd ~/executorch-examples/ git submodule sync @@ -48,7 +48,7 @@ git submodule update --init --recursive Install dev requirements for ExecuTorch ```bash -cd ~/executorch-examples/program-data-separation/cpp/executorch +cd ~/executorch-examples/third-party/executorch pip install -r requirements-dev.txt ``` diff --git a/program-data-separation/cpp/lora_example/README.md b/program-data-separation/cpp/lora_example/README.md index 877dd803..317f00a1 100644 --- a/program-data-separation/cpp/lora_example/README.md +++ b/program-data-separation/cpp/lora_example/README.md @@ -29,11 +29,18 @@ If you want to train your own LoRA adapters, [Unsloth](https://unsloth.ai/) prov ## Install ExecuTorch -[Install from source](https://docs.pytorch.org/executorch/stable/using-executorch-building-from-source.html#install-executorch-pip-package-from-source): +Install from a recent nightly build (recommended for LoRA export features): +```bash +pip install executorch==1.1.0.devYYYYMMDD --extra-index-url https://download.pytorch.org/whl/nightly/cpu +``` + +Use a recent nightly, as some LoRA export features are not available in executorch==1.0.0. + +Alternatively, [install from source](https://docs.pytorch.org/executorch/stable/using-executorch-building-from-source.html#install-executorch-pip-package-from-source): ```bash # Navigate to the executorch submodule -cd ~/executorch-examples/program-data-separation/cpp/executorch +cd ~/executorch-examples/third-party/executorch # Update submodules git submodule sync @@ -43,13 +50,6 @@ git submodule update --init --recursive ./install_executorch.sh --editable ``` -Alternatively, install from a recent nightly build: -```bash -pip install executorch==1.1.0.devYYYYMMDD --extra-index-url https://download.pytorch.org/whl/nightly/cpu -``` - -Use main or a recent nightly, as some features are not available in executorch==1.0.0. - ## Export models ```bash @@ -87,20 +87,19 @@ models/ ## Install runtime dependencies -The ExecuTorch repository is configured as a git submodule at `~/executorch-examples/program-data-separation/cpp/executorch`. To initialize it: +The ExecuTorch repository is configured as a git submodule at `~/executorch-examples/third-party/executorch`, with `program-data-separation/cpp/executorch` being a symlink to it. To initialize: ```bash cd ~/executorch-examples/ # Update submodules -git submodule update --remote program-data-separation/cpp/executorch git submodule sync git submodule update --init --recursive ``` Install dev requirements for ExecuTorch: ```bash -cd ~/executorch-examples/program-data-separation/cpp/executorch +cd ~/executorch-examples/third-party/executorch pip install -r requirements-dev.txt ``` From d7d058ea7fb647b9966f8dcf03d9da85a1d1d4a3 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Fri, 20 Feb 2026 14:37:58 -0800 Subject: [PATCH 2/3] Fix import --- program-data-separation/export_linear.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/program-data-separation/export_linear.py b/program-data-separation/export_linear.py index a30fe29b..aed3afda 100644 --- a/program-data-separation/export_linear.py +++ b/program-data-separation/export_linear.py @@ -22,7 +22,7 @@ to_edge_transform_and_lower, ) from executorch.exir.passes.external_constants_pass import ( - delegate_external_constants_pass, + delegate_external_constants_pass_unlifted, ) from executorch.exir.program import ExecutorchProgramManager from torch.export import export @@ -78,7 +78,7 @@ def main() -> None: ) partial_function = partial( - delegate_external_constants_pass, + delegate_external_constants_pass_unlifted, ep=exported_program, gen_tag_fn=lambda x: model_name, ) From 86777a0061c8540037156411baa3e065d615b71c Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Fri, 20 Feb 2026 14:49:05 -0800 Subject: [PATCH 3/3] Simplify ExecuTorch install instructions to use stable release >=1.1.0 --- program-data-separation/cpp/lora_example/README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/program-data-separation/cpp/lora_example/README.md b/program-data-separation/cpp/lora_example/README.md index 317f00a1..cafb3755 100644 --- a/program-data-separation/cpp/lora_example/README.md +++ b/program-data-separation/cpp/lora_example/README.md @@ -29,13 +29,11 @@ If you want to train your own LoRA adapters, [Unsloth](https://unsloth.ai/) prov ## Install ExecuTorch -Install from a recent nightly build (recommended for LoRA export features): +Install executorch>=1.1.0: ```bash -pip install executorch==1.1.0.devYYYYMMDD --extra-index-url https://download.pytorch.org/whl/nightly/cpu +pip install executorch>=1.1.0 ``` -Use a recent nightly, as some LoRA export features are not available in executorch==1.0.0. - Alternatively, [install from source](https://docs.pytorch.org/executorch/stable/using-executorch-building-from-source.html#install-executorch-pip-package-from-source): ```bash