From 85b2389de54de04cdc9f442d5eafece1a744b08b Mon Sep 17 00:00:00 2001 From: Barak Ugav Date: Wed, 12 Nov 2025 14:22:09 +0200 Subject: [PATCH 1/4] Fix data_map name in Cargo.toml --- examples/data_map/Cargo.lock | 2 +- examples/data_map/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/data_map/Cargo.lock b/examples/data_map/Cargo.lock index 0bce063..0ab3a04 100644 --- a/examples/data_map/Cargo.lock +++ b/examples/data_map/Cargo.lock @@ -186,7 +186,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] -name = "example-hello-world" +name = "example-data-map" version = "0.0.0" dependencies = [ "executorch", diff --git a/examples/data_map/Cargo.toml b/examples/data_map/Cargo.toml index b607c81..4ffb6ff 100644 --- a/examples/data_map/Cargo.toml +++ b/examples/data_map/Cargo.toml @@ -1,6 +1,6 @@ [package] publish = false -name = "example-hello-world" +name = "example-data-map" version = "0.0.0" edition = "2021" From 6f7d80f9eff5b23de722c6f88753b3770036b32c Mon Sep 17 00:00:00 2001 From: Barak Ugav Date: Thu, 27 Nov 2025 08:46:17 +0200 Subject: [PATCH 2/4] Bump Cpp lib to 1.0.1 --- .github/workflows/ci_requirements.txt | 2 +- README.md | 2 +- etc/setup_dev_env.py | 2 +- examples/llama3/README.md | 2 +- executorch-sys/README.md | 2 +- executorch-sys/build.rs | 2 +- executorch-sys/src/lib.rs | 4 ++-- executorch-sys/third-party/executorch/version.txt | 2 +- executorch/README.md | 2 +- executorch/src/lib.rs | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci_requirements.txt b/.github/workflows/ci_requirements.txt index 54a1c72..f0604d8 100644 --- a/.github/workflows/ci_requirements.txt +++ b/.github/workflows/ci_requirements.txt @@ -1,4 +1,4 @@ -# Copy of executorch/requirements-dev.txt as of v1.0.0 +# Copy of executorch/requirements-dev.txt as of v1.0.1 cmake>=3.29, <4.0.0 packaging>=24.2 pip>=23 diff --git a/README.md b/README.md index f674648..bbda575 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ See `example/hello_world` for a complete example. ## Build To use the library you must compile the C++ executorch library yourself, as there are many configurations that determines which modules, backends, and operations are supported. See the `executorch-sys` crate for more info. -Currently the supported Cpp executorch version is `1.0.0`. +Currently the supported Cpp executorch version is `1.0.0` (or `1.0.1`). ## Cargo Features diff --git a/etc/setup_dev_env.py b/etc/setup_dev_env.py index 2aa64ec..8143e31 100644 --- a/etc/setup_dev_env.py +++ b/etc/setup_dev_env.py @@ -70,7 +70,7 @@ def clone_executorch(): "--depth", "1", "--branch", - "v1.0.0", + "v1.0.1", "https://github.com/pytorch/executorch.git", ".", ], diff --git a/examples/llama3/README.md b/examples/llama3/README.md index 9c25aef..646d28d 100644 --- a/examples/llama3/README.md +++ b/examples/llama3/README.md @@ -72,4 +72,4 @@ To run the example, follow these steps (note that some steps should run from the The llama model can be exported with many options, such as quantization, different data types (f32, bf16), different backends, kv caching, etc. This example use a specific set of options, as specified above. Different options require different export commands and modifications to the code and build script which you can play around with. -See the [llama README](https://github.com/pytorch/executorch/blob/v1.0.0/examples/models/llama/README.md) at the Cpp executorch repository for more details. +See the [llama README](https://github.com/pytorch/executorch/blob/v1.0.1/examples/models/llama/README.md) at the Cpp executorch repository for more details. diff --git a/executorch-sys/README.md b/executorch-sys/README.md index 64a3a1e..0ee14d2 100644 --- a/executorch-sys/README.md +++ b/executorch-sys/README.md @@ -10,7 +10,7 @@ In the following example we build the C++ library with the necessary flags to ru ```bash # Clone the C++ library cd ${EXECUTORCH_CPP_DIR} -git clone --depth 1 --branch v1.0.0 https://github.com/pytorch/executorch.git . +git clone --depth 1 --branch v1.0.1 https://github.com/pytorch/executorch.git . git submodule sync --recursive git submodule update --init --recursive diff --git a/executorch-sys/build.rs b/executorch-sys/build.rs index 0fbd4d4..6751ad9 100644 --- a/executorch-sys/build.rs +++ b/executorch-sys/build.rs @@ -1,6 +1,6 @@ use std::path::{Path, PathBuf}; -// const EXECUTORCH_VERSION: &str = "1.0.0"; +// const EXECUTORCH_VERSION: &str = "1.0.1"; fn main() { // TODO: verify on runtime we use the correct version of executorch diff --git a/executorch-sys/src/lib.rs b/executorch-sys/src/lib.rs index db80938..0b4dab6 100644 --- a/executorch-sys/src/lib.rs +++ b/executorch-sys/src/lib.rs @@ -19,7 +19,7 @@ //! ```bash //! # Clone the C++ library //! cd ${EXECUTORCH_CPP_DIR} -//! git clone --depth 1 --branch v1.0.0 https://github.com/pytorch/executorch.git . +//! git clone --depth 1 --branch v1.0.1 https://github.com/pytorch/executorch.git . //! git submodule sync --recursive //! git submodule update --init --recursive //! @@ -133,7 +133,7 @@ extern crate core as std; extern crate link_cplusplus; /// The version of the ExecuTorch C++ library that this crate is compatible and linked with. -pub const EXECUTORCH_CPP_VERSION: &str = "1.0.0"; +pub const EXECUTORCH_CPP_VERSION: &str = "1.0.1"; mod c_bridge; pub use c_bridge::*; diff --git a/executorch-sys/third-party/executorch/version.txt b/executorch-sys/third-party/executorch/version.txt index 41432f0..a315b1b 100644 --- a/executorch-sys/third-party/executorch/version.txt +++ b/executorch-sys/third-party/executorch/version.txt @@ -1 +1 @@ -1.0.0a0 +1.0.1a0 diff --git a/executorch/README.md b/executorch/README.md index f674648..bbda575 100644 --- a/executorch/README.md +++ b/executorch/README.md @@ -62,7 +62,7 @@ See `example/hello_world` for a complete example. ## Build To use the library you must compile the C++ executorch library yourself, as there are many configurations that determines which modules, backends, and operations are supported. See the `executorch-sys` crate for more info. -Currently the supported Cpp executorch version is `1.0.0`. +Currently the supported Cpp executorch version is `1.0.0` (or `1.0.1`). ## Cargo Features diff --git a/executorch/src/lib.rs b/executorch/src/lib.rs index 10fab48..cadeeeb 100644 --- a/executorch/src/lib.rs +++ b/executorch/src/lib.rs @@ -111,7 +111,7 @@ //! ## Build //! To use the library you must compile the C++ executorch library yourself, as there are many configurations that //! determines which modules, backends, and operations are supported. See the `executorch-sys` crate for more info. -//! Currently the supported Cpp executorch version is `1.0.0`. +//! Currently the supported Cpp executorch version is `1.0.0` (or `1.0.1`). //! //! ## Embedded Systems //! The library is designed to be used both in `std` and `no_std` environments. The `no_std` environment is useful for From f7aa490c7f72d8b1a0780a42135beac18fc7e866 Mon Sep 17 00:00:00 2001 From: Barak Ugav Date: Thu, 27 Nov 2025 18:48:42 +0200 Subject: [PATCH 3/4] Fix nanogpt example --- examples/llama3/build.rs | 1 - examples/nano-gpt/build.rs | 30 +++++++++++++++++++++++++++--- examples/run_all.py | 4 ---- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/examples/llama3/build.rs b/examples/llama3/build.rs index 3244392..9e57af4 100644 --- a/examples/llama3/build.rs +++ b/examples/llama3/build.rs @@ -5,7 +5,6 @@ fn main() { println!("cargo::rustc-link-search=native={libs_dir}/kernels/portable/"); println!("cargo::rustc-link-lib=static=portable_kernels"); - // println!("cargo::rustc-link-lib=static:+whole-archive=portable_ops_lib"); println!("cargo::rustc-link-search=native={libs_dir}/configurations/"); println!("cargo::rustc-link-lib=static:+whole-archive=optimized_native_cpu_ops_lib"); diff --git a/examples/nano-gpt/build.rs b/examples/nano-gpt/build.rs index b641c77..7e456eb 100644 --- a/examples/nano-gpt/build.rs +++ b/examples/nano-gpt/build.rs @@ -4,9 +4,33 @@ fn main() { .expect("EXECUTORCH_RS_EXECUTORCH_LIB_DIR is not set, can't locate executorch static libs"); println!("cargo::rustc-link-search=native={libs_dir}/kernels/portable/"); - println!("cargo::rustc-link-lib=static:+whole-archive=portable_kernels"); - println!("cargo::rustc-link-lib=static:+whole-archive=portable_ops_lib"); + println!("cargo::rustc-link-lib=static=portable_kernels"); println!("cargo::rustc-link-search=native={libs_dir}/configurations/"); - println!("cargo::rustc-link-lib=static=optimized_native_cpu_ops_lib"); + println!("cargo::rustc-link-lib=static:+whole-archive=optimized_native_cpu_ops_lib"); + + println!("cargo::rustc-link-search=native={libs_dir}/kernels/optimized/"); + println!("cargo::rustc-link-lib=static:+whole-archive=optimized_kernels"); + println!("cargo::rustc-link-lib=static:+whole-archive=eigen_blas"); + println!("cargo::rustc-link-lib=static:+whole-archive=cpublas"); + + println!("cargo::rustc-link-search=native={libs_dir}/extension/threadpool/"); + println!("cargo::rustc-link-lib=static:+whole-archive=extension_threadpool"); + + println!("cargo::rustc-link-search=native={libs_dir}/backends/xnnpack/"); + println!("cargo::rustc-link-search=native={libs_dir}/backends/xnnpack/third-party/XNNPACK/"); + println!("cargo::rustc-link-search=native={libs_dir}/backends/xnnpack/third-party/cpuinfo/"); + println!( + "cargo::rustc-link-search=native={libs_dir}/backends/xnnpack/third-party/pthreadpool/" + ); + println!("cargo::rustc-link-lib=static:+whole-archive=xnnpack_backend"); + println!("cargo::rustc-link-lib=static:+whole-archive=XNNPACK"); + println!("cargo::rustc-link-lib=static:+whole-archive=xnnpack-microkernels-prod"); + println!("cargo::rustc-link-lib=static:+whole-archive=cpuinfo"); + println!("cargo::rustc-link-lib=static:+whole-archive=pthreadpool"); + + if cfg!(target_arch = "arm") || cfg!(target_arch = "aarch64") { + println!("cargo::rustc-link-search=native={libs_dir}/kleidiai/"); + println!("cargo::rustc-link-lib=static:+whole-archive=kleidiai"); + } } diff --git a/examples/run_all.py b/examples/run_all.py index 258a367..5ac18e2 100644 --- a/examples/run_all.py +++ b/examples/run_all.py @@ -26,10 +26,6 @@ ): extra_args = [] case "nano-gpt": - # TODO: https://github.com/pytorch/executorch/issues/15285 - # TODO: remove when we bump cpp lib to 1.0.1 - print("Skipping nanogpt example...") - continue extra_args = [ *["--model", "nanogpt.pte"], *["--tokenizer", "vocab.json"], From 3752d540debdfa8ad7f32c056a5ead06cd57ffda Mon Sep 17 00:00:00 2001 From: Barak Ugav Date: Sat, 18 Oct 2025 12:27:21 +0300 Subject: [PATCH 4/4] Build gpt and llama in CI --- .github/workflows/ci.yaml | 12 ++++-------- examples/llama3/build.rs | 2 +- examples/nano-gpt/build.rs | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 66b0dc4..167df99 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -144,16 +144,12 @@ jobs: cargo run working-directory: examples/etdump - - name: Check nano-gpt example - run: cargo check + - name: Build nano-gpt example + run: cargo build working-directory: examples/nano-gpt - env: - EXECUTORCH_RS_LINK: 0 - - name: Check llama3 example - run: cargo check + - name: Build llama3 example + run: cargo build working-directory: examples/llama3 - env: - EXECUTORCH_RS_LINK: 0 check: runs-on: ${{ matrix.runner }} diff --git a/examples/llama3/build.rs b/examples/llama3/build.rs index 9e57af4..4134464 100644 --- a/examples/llama3/build.rs +++ b/examples/llama3/build.rs @@ -4,7 +4,7 @@ fn main() { .expect("EXECUTORCH_RS_EXECUTORCH_LIB_DIR is not set, can't locate executorch static libs"); println!("cargo::rustc-link-search=native={libs_dir}/kernels/portable/"); - println!("cargo::rustc-link-lib=static=portable_kernels"); + println!("cargo::rustc-link-lib=static:+whole-archive=portable_kernels"); println!("cargo::rustc-link-search=native={libs_dir}/configurations/"); println!("cargo::rustc-link-lib=static:+whole-archive=optimized_native_cpu_ops_lib"); diff --git a/examples/nano-gpt/build.rs b/examples/nano-gpt/build.rs index 7e456eb..05a5073 100644 --- a/examples/nano-gpt/build.rs +++ b/examples/nano-gpt/build.rs @@ -4,7 +4,7 @@ fn main() { .expect("EXECUTORCH_RS_EXECUTORCH_LIB_DIR is not set, can't locate executorch static libs"); println!("cargo::rustc-link-search=native={libs_dir}/kernels/portable/"); - println!("cargo::rustc-link-lib=static=portable_kernels"); + println!("cargo::rustc-link-lib=static:+whole-archive=portable_kernels"); println!("cargo::rustc-link-search=native={libs_dir}/configurations/"); println!("cargo::rustc-link-lib=static:+whole-archive=optimized_native_cpu_ops_lib");