Skip to content

Enable Training Pybindings in OSS #8073

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 10 commits into from
Feb 3, 2025
Merged

Enable Training Pybindings in OSS #8073

merged 10 commits into from
Feb 3, 2025

Conversation

JacobSzwejbka
Copy link
Contributor

@JacobSzwejbka JacobSzwejbka commented Jan 30, 2025

Enable the pybindings for the training lib in oss

Test plan

Open up a python terminal and try importing and using the optimizer from the bindings. (Also double checked that I didnt break the normal core pybindings)

build locally with

./install_executorch.sh --pybind training

Copy link

pytorch-bot bot commented Jan 30, 2025

🔗 Helpful Links

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

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

⏳ No Failures, 6 Pending

As of commit 4677709 with merge base 6b58e2e (image):
💚 Looks good so far! There are no failures yet. 💚

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 Jan 30, 2025
@dbort
Copy link
Contributor

dbort commented Jan 30, 2025

If you're adding a new python extension, you'll need to let setup.py know about it so it can include it in the wheel. You'll at least need an entry at

if ShouldBuild.pybindings():
, but you'll also need to tell cmake to build it for you like
if ShouldBuild.pybindings():

@dbort
Copy link
Contributor

dbort commented Jan 30, 2025

Once you add it to the wheel, you can test it by running install_executorch.sh into a conda env and then running a .py file that tries importing and using the new APIs

@JacobSzwejbka JacobSzwejbka added the release notes: api Changes to public facing apis (any interfaces, pybinded runtime methods, etc.) label Feb 3, 2025
CMakeLists.txt Outdated
@@ -240,6 +240,17 @@ cmake_dependent_option(
"NOT EXECUTORCH_BUILD_ARM_BAREMETAL" OFF
)

if(EXECUTORCH_BUILD_PYBIND)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved these here to better match the pattern in the rest of the file and also it makes the shared dependencies between training and pybind a little easier to handle

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This weirdly broke apple builds so undid

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@JacobSzwejbka JacobSzwejbka merged commit 9441003 into main Feb 3, 2025
43 of 45 checks passed
@JacobSzwejbka JacobSzwejbka deleted the Training_pybindings branch February 3, 2025 23:59
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. release notes: api Changes to public facing apis (any interfaces, pybinded runtime methods, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't run training example: No module named 'executorch.extension.training.pybindings._training_lib
4 participants