-
Notifications
You must be signed in to change notification settings - Fork 821
Closed
Labels
module: build/installIssues related to the cmake and buck2 builds, and to installing ExecuTorchIssues related to the cmake and buck2 builds, and to installing ExecuTorchmodule: user experienceIssues related to reducing friction for usersIssues related to reducing friction for userstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Milestone
Description
🚀 The feature, motivation and pitch
Blocking #2871
Context:
The current pattern of setup.py in ExecuTorch:
- Build extensions in
CustomBuildclass (extendingbuild). Run CMake build commands to build pybind extensions. Triggered fromcmdclass["build"] - After extensions are built, run
InstallerBuildExtclass to install the extension artifacts (.so etc). The class takes a list ofext_modulesto learn what is the source path (normally .so files in cmake-out/) and what is the destination path in the package.ext_moduleslist is also controlled by the same CMake flags for custom build. This step is triggered fromcmdclass["build_ext"] - Lastly,
setup.pyrunsbuild_pyto copy python files to package directories. This step is triggered fromcmdclass["build_py"].
This pattern is different from the common pattern, but it works without issue.
Assumption:
We want to support editable mode (pip install -e .). In editable installation we should perform the exact same installation steps as normal mode, respecting the same options as normal mode.
For example, the plain command
pip install -e .
Should install portable_lib extension because by default EXECUTORCH_BUILD_PYBIND=ON
Problem:
The current pattern doesn’t work for editable mode. Here are the reasons:
- The
buildstep doesn’t even run when editable mode is on. This is causingbuild_extto error out because it’s expecting the .so files to be present in the build directory but they are missing. - We don’t want to diverge the installation behavior between editable mode on and off as much as possible. This means we don’t want to do if editable mode on do A otherwise do B.
Proposal:
Move the python extension installation step (CMake commands) into one of ext_modules.
Alternatives
No response
Additional context
No response
RFC (Optional)
No response
Metadata
Metadata
Assignees
Labels
module: build/installIssues related to the cmake and buck2 builds, and to installing ExecuTorchIssues related to the cmake and buck2 builds, and to installing ExecuTorchmodule: user experienceIssues related to reducing friction for usersIssues related to reducing friction for userstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Type
Projects
Status
Done
Status
Done