Skip to content

Enable selective build in OSS #11540

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

Merged
merged 1 commit into from
Jun 11, 2025
Merged

Enable selective build in OSS #11540

merged 1 commit into from
Jun 11, 2025

Conversation

larryliu0820
Copy link
Contributor

@larryliu0820 larryliu0820 commented Jun 10, 2025

This pull request introduces a new selective_build pybind module to enhance code generation tools in the executorch project. It includes changes to integrate the module into the build system, define its functionality, and add tests for validation. The most important changes are grouped into themes: module creation, integration into the build system, and testing.

Module Creation:

  • Added selective_build.cpp to define the selective_build pybind module, which provides functionality for extracting operator and IO metadata from serialized programs.
  • Added type definitions in selective_build.pyi for the selective_build module, including _Program, _IOMetaData, and associated methods.

Integration into Build System:

  • Updated CMakeLists.txt to include the codegen/tools directory for the selective_build module when EXECUTORCH_BUILD_PYBIND is enabled.
  • Modified setup.py to add selective_build as a build target and link it to the appropriate CMake flags. [1] [2]
  • Updated targets.bzl to define build rules for the selective_build module and its dependencies, ensuring compatibility with the runtime environment. [1] [2] [3]

Testing:

  • Added test/test_selective_build.py to validate the functionality of the selective_build module, including tests for operator extraction and IO metadata retrieval.

Differential Revision: D76380110

@larryliu0820 larryliu0820 requested a review from lucylq as a code owner June 10, 2025 23:23
Copy link

pytorch-bot bot commented Jun 10, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/11540

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure

As of commit a6298d4 with merge base 72a095f (image):

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 10, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D76380110

@facebook-github-bot
Copy link
Contributor

@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@larryliu0820 larryliu0820 added the release notes: none Do not include this in the release notes label Jun 11, 2025
@BujSet BujSet self-assigned this Jun 11, 2025
facebook-github-bot pushed a commit that referenced this pull request Jun 11, 2025
Summary:
This pull request introduces a new `selective_build` pybind module to enhance code generation tools in the `executorch` project. It includes changes to integrate the module into the build system, define its functionality, and add tests for validation. The most important changes are grouped into themes: module creation, integration into the build system, and testing.

### Module Creation:
* Added `selective_build.cpp` to define the `selective_build` pybind module, which provides functionality for extracting operator and IO metadata from serialized programs.
* Added type definitions in `selective_build.pyi` for the `selective_build` module, including `_Program`, `_IOMetaData`, and associated methods.

### Integration into Build System:
* Updated `CMakeLists.txt` to include the `codegen/tools` directory for the `selective_build` module when `EXECUTORCH_BUILD_PYBIND` is enabled.
* Modified `setup.py` to add `selective_build` as a build target and link it to the appropriate CMake flags. [[1]](diffhunk://#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R732) [[2]](diffhunk://#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R794-R798)
* Updated `targets.bzl` to define build rules for the `selective_build` module and its dependencies, ensuring compatibility with the runtime environment. [[1]](diffhunk://#diff-3847c39f66d06290c190e38ef87820edbe0a9f8193db33bd556376123eb4875fL22-R22) [[2]](diffhunk://#diff-3847c39f66d06290c190e38ef87820edbe0a9f8193db33bd556376123eb4875fL32-R32) [[3]](diffhunk://#diff-3847c39f66d06290c190e38ef87820edbe0a9f8193db33bd556376123eb4875fR158-R195)

### Testing:
* Added `test/test_selective_build.py` to validate the functionality of the `selective_build` module, including tests for operator extraction and IO metadata retrieval.


Test Plan:
Imported from GitHub, without a `Test Plan:` line.

Rollback Plan:

Reviewed By: BujSet

Differential Revision: D76380110

Pulled By: larryliu0820
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D76380110

larryliu0820 added a commit that referenced this pull request Jun 11, 2025
Summary:
This pull request introduces a new `selective_build` pybind module to enhance code generation tools in the `executorch` project. It includes changes to integrate the module into the build system, define its functionality, and add tests for validation. The most important changes are grouped into themes: module creation, integration into the build system, and testing.

### Module Creation:
* Added `selective_build.cpp` to define the `selective_build` pybind module, which provides functionality for extracting operator and IO metadata from serialized programs.
* Added type definitions in `selective_build.pyi` for the `selective_build` module, including `_Program`, `_IOMetaData`, and associated methods.

### Integration into Build System:
* Updated `CMakeLists.txt` to include the `codegen/tools` directory for the `selective_build` module when `EXECUTORCH_BUILD_PYBIND` is enabled.
* Modified `setup.py` to add `selective_build` as a build target and link it to the appropriate CMake flags. [[1]](diffhunk://#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R732) [[2]](diffhunk://#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R794-R798)
* Updated `targets.bzl` to define build rules for the `selective_build` module and its dependencies, ensuring compatibility with the runtime environment. [[1]](diffhunk://#diff-3847c39f66d06290c190e38ef87820edbe0a9f8193db33bd556376123eb4875fL22-R22) [[2]](diffhunk://#diff-3847c39f66d06290c190e38ef87820edbe0a9f8193db33bd556376123eb4875fL32-R32) [[3]](diffhunk://#diff-3847c39f66d06290c190e38ef87820edbe0a9f8193db33bd556376123eb4875fR158-R195)

### Testing:
* Added `test/test_selective_build.py` to validate the functionality of the `selective_build` module, including tests for operator extraction and IO metadata retrieval.


Test Plan:
Imported from GitHub, without a `Test Plan:` line.

Rollback Plan:

Reviewed By: BujSet

Differential Revision: D76380110

Pulled By: larryliu0820
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D76380110

larryliu0820 added a commit that referenced this pull request Jun 11, 2025
Summary:
This pull request introduces a new `selective_build` pybind module to enhance code generation tools in the `executorch` project. It includes changes to integrate the module into the build system, define its functionality, and add tests for validation. The most important changes are grouped into themes: module creation, integration into the build system, and testing.

### Module Creation:
* Added `selective_build.cpp` to define the `selective_build` pybind module, which provides functionality for extracting operator and IO metadata from serialized programs.
* Added type definitions in `selective_build.pyi` for the `selective_build` module, including `_Program`, `_IOMetaData`, and associated methods.

### Integration into Build System:
* Updated `CMakeLists.txt` to include the `codegen/tools` directory for the `selective_build` module when `EXECUTORCH_BUILD_PYBIND` is enabled.
* Modified `setup.py` to add `selective_build` as a build target and link it to the appropriate CMake flags. [[1]](diffhunk://#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R732) [[2]](diffhunk://#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R794-R798)
* Updated `targets.bzl` to define build rules for the `selective_build` module and its dependencies, ensuring compatibility with the runtime environment. [[1]](diffhunk://#diff-3847c39f66d06290c190e38ef87820edbe0a9f8193db33bd556376123eb4875fL22-R22) [[2]](diffhunk://#diff-3847c39f66d06290c190e38ef87820edbe0a9f8193db33bd556376123eb4875fL32-R32) [[3]](diffhunk://#diff-3847c39f66d06290c190e38ef87820edbe0a9f8193db33bd556376123eb4875fR158-R195)

### Testing:
* Added `test/test_selective_build.py` to validate the functionality of the `selective_build` module, including tests for operator extraction and IO metadata retrieval.

Pull Request resolved: #11540

Test Plan:
Imported from GitHub, without a `Test Plan:` line.

Rollback Plan:

Reviewed By: BujSet

Differential Revision: D76380110

Pulled By: larryliu0820
facebook-github-bot pushed a commit that referenced this pull request Jun 11, 2025
Summary:
This pull request introduces a new `selective_build` pybind module to enhance code generation tools in the `executorch` project. It includes changes to integrate the module into the build system, define its functionality, and add tests for validation. The most important changes are grouped into themes: module creation, integration into the build system, and testing.

### Module Creation:
* Added `selective_build.cpp` to define the `selective_build` pybind module, which provides functionality for extracting operator and IO metadata from serialized programs.
* Added type definitions in `selective_build.pyi` for the `selective_build` module, including `_Program`, `_IOMetaData`, and associated methods.

### Integration into Build System:
* Updated `CMakeLists.txt` to include the `codegen/tools` directory for the `selective_build` module when `EXECUTORCH_BUILD_PYBIND` is enabled.
* Modified `setup.py` to add `selective_build` as a build target and link it to the appropriate CMake flags. [[1]](diffhunk://#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R732) [[2]](diffhunk://#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R794-R798)
* Updated `targets.bzl` to define build rules for the `selective_build` module and its dependencies, ensuring compatibility with the runtime environment. [[1]](diffhunk://#diff-3847c39f66d06290c190e38ef87820edbe0a9f8193db33bd556376123eb4875fL22-R22) [[2]](diffhunk://#diff-3847c39f66d06290c190e38ef87820edbe0a9f8193db33bd556376123eb4875fL32-R32) [[3]](diffhunk://#diff-3847c39f66d06290c190e38ef87820edbe0a9f8193db33bd556376123eb4875fR158-R195)

### Testing:
* Added `test/test_selective_build.py` to validate the functionality of the `selective_build` module, including tests for operator extraction and IO metadata retrieval.


Test Plan:
Imported from GitHub, without a `Test Plan:` line.

Rollback Plan:

Reviewed By: lucylq, BujSet

Differential Revision: D76380110

Pulled By: larryliu0820
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D76380110

Summary:
This pull request introduces a new `selective_build` pybind module to enhance code generation tools in the `executorch` project. It includes changes to integrate the module into the build system, define its functionality, and add tests for validation. The most important changes are grouped into themes: module creation, integration into the build system, and testing.

### Module Creation:
* Added `selective_build.cpp` to define the `selective_build` pybind module, which provides functionality for extracting operator and IO metadata from serialized programs.
* Added type definitions in `selective_build.pyi` for the `selective_build` module, including `_Program`, `_IOMetaData`, and associated methods.

### Integration into Build System:
* Updated `CMakeLists.txt` to include the `codegen/tools` directory for the `selective_build` module when `EXECUTORCH_BUILD_PYBIND` is enabled.
* Modified `setup.py` to add `selective_build` as a build target and link it to the appropriate CMake flags. [[1]](diffhunk://#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R732) [[2]](diffhunk://#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R794-R798)
* Updated `targets.bzl` to define build rules for the `selective_build` module and its dependencies, ensuring compatibility with the runtime environment. [[1]](diffhunk://#diff-3847c39f66d06290c190e38ef87820edbe0a9f8193db33bd556376123eb4875fL22-R22) [[2]](diffhunk://#diff-3847c39f66d06290c190e38ef87820edbe0a9f8193db33bd556376123eb4875fL32-R32) [[3]](diffhunk://#diff-3847c39f66d06290c190e38ef87820edbe0a9f8193db33bd556376123eb4875fR158-R195)

### Testing:
* Added `test/test_selective_build.py` to validate the functionality of the `selective_build` module, including tests for operator extraction and IO metadata retrieval.


Test Plan:
Imported from GitHub, without a `Test Plan:` line.

Rollback Plan:

Reviewed By: lucylq, BujSet

Differential Revision: D76380110

Pulled By: larryliu0820
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D76380110

BujSet pushed a commit to BujSet/executorch that referenced this pull request Jun 11, 2025
Summary:
This pull request introduces a new `selective_build` pybind module to enhance code generation tools in the `executorch` project. It includes changes to integrate the module into the build system, define its functionality, and add tests for validation. The most important changes are grouped into themes: module creation, integration into the build system, and testing.

### Module Creation:
* Added `selective_build.cpp` to define the `selective_build` pybind module, which provides functionality for extracting operator and IO metadata from serialized programs.
* Added type definitions in `selective_build.pyi` for the `selective_build` module, including `_Program`, `_IOMetaData`, and associated methods.

### Integration into Build System:
* Updated `CMakeLists.txt` to include the `codegen/tools` directory for the `selective_build` module when `EXECUTORCH_BUILD_PYBIND` is enabled.
* Modified `setup.py` to add `selective_build` as a build target and link it to the appropriate CMake flags. [[1]](diffhunk://#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R732) [[2]](diffhunk://#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R794-R798)
* Updated `targets.bzl` to define build rules for the `selective_build` module and its dependencies, ensuring compatibility with the runtime environment. [[1]](diffhunk://#diff-3847c39f66d06290c190e38ef87820edbe0a9f8193db33bd556376123eb4875fL22-R22) [[2]](diffhunk://#diff-3847c39f66d06290c190e38ef87820edbe0a9f8193db33bd556376123eb4875fL32-R32) [[3]](diffhunk://#diff-3847c39f66d06290c190e38ef87820edbe0a9f8193db33bd556376123eb4875fR158-R195)

### Testing:
* Added `test/test_selective_build.py` to validate the functionality of the `selective_build` module, including tests for operator extraction and IO metadata retrieval.


Test Plan:
Imported from GitHub, without a `Test Plan:` line.

Rollback Plan:

Reviewed By: lucylq, BujSet

Differential Revision: D76380110

Pulled By: larryliu0820
BujSet pushed a commit to BujSet/executorch that referenced this pull request Jun 11, 2025
Summary:
This pull request introduces a new `selective_build` pybind module to enhance code generation tools in the `executorch` project. It includes changes to integrate the module into the build system, define its functionality, and add tests for validation. The most important changes are grouped into themes: module creation, integration into the build system, and testing.

### Module Creation:
* Added `selective_build.cpp` to define the `selective_build` pybind module, which provides functionality for extracting operator and IO metadata from serialized programs.
* Added type definitions in `selective_build.pyi` for the `selective_build` module, including `_Program`, `_IOMetaData`, and associated methods.

### Integration into Build System:
* Updated `CMakeLists.txt` to include the `codegen/tools` directory for the `selective_build` module when `EXECUTORCH_BUILD_PYBIND` is enabled.
* Modified `setup.py` to add `selective_build` as a build target and link it to the appropriate CMake flags. [[1]](diffhunk://#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R732) [[2]](diffhunk://#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R794-R798)
* Updated `targets.bzl` to define build rules for the `selective_build` module and its dependencies, ensuring compatibility with the runtime environment. [[1]](diffhunk://#diff-3847c39f66d06290c190e38ef87820edbe0a9f8193db33bd556376123eb4875fL22-R22) [[2]](diffhunk://#diff-3847c39f66d06290c190e38ef87820edbe0a9f8193db33bd556376123eb4875fL32-R32) [[3]](diffhunk://#diff-3847c39f66d06290c190e38ef87820edbe0a9f8193db33bd556376123eb4875fR158-R195)

### Testing:
* Added `test/test_selective_build.py` to validate the functionality of the `selective_build` module, including tests for operator extraction and IO metadata retrieval.


Test Plan:
Imported from GitHub, without a `Test Plan:` line.

Rollback Plan:

Reviewed By: lucylq, BujSet

Differential Revision: D76380110

Pulled By: larryliu0820
@facebook-github-bot facebook-github-bot merged commit 6a4df94 into main Jun 11, 2025
101 of 104 checks passed
@facebook-github-bot facebook-github-bot deleted the export-D76380110 branch June 11, 2025 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported release notes: none Do not include this in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants