Skip to content

Install examples and domain libraries as last (optional) step #11653

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 16, 2025

Conversation

mergennachin
Copy link
Contributor

@mergennachin mergennachin commented Jun 13, 2025

Install requirements is installing so many things that's not necessary for core executorch runtime. For example, it's not necessary to install packages that is used in examples.

Ideally, developers should just run to install core ET.

install_requirement.sh
pip install . -e

Copy link

pytorch-bot bot commented Jun 13, 2025

🔗 Helpful Links

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

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

⏳ No Failures, 179 Pending

As of commit 9e0e259 with merge base 884e901 (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 Jun 13, 2025
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Comment on lines 209 to 216
DOMAIN_LIBRARIES = [
(
f"torchvision==0.23.0.{NIGHTLY_VERSION}"
if use_pytorch_nightly
else "torchvision"
),
f"torchaudio==2.8.0.{NIGHTLY_VERSION}" if use_pytorch_nightly else "torchaudio",
]
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the benefit of doing this here vs. in install_requirements? When developing the wheel people will run install_executorch.py multiple times, so now this will cause pip to attempt to install these examples multiple time (even though it won't cause it's already installed)

Copy link
Contributor Author

@mergennachin mergennachin Jun 13, 2025

Choose a reason for hiding this comment

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

Even today, when people run install_executorch.py, it will transitively call install_requirements.py anyway.

The reason i did it here is to install the non core optional steps as last time. That way, people can do,

./install_requirements.py
pip install .e

to install minimal core package.

This is useful for running on Intel Mac OS for instance. We can compile torch from source and use it as part of ET. Now today, we will require people to also compile torchvision and torchaudio from source on top of torch. See context here: #10652

@mergennachin mergennachin force-pushed the extract_out_examples branch 3 times, most recently from 33ad487 to 390171f Compare June 13, 2025 23:07
@@ -180,9 +181,13 @@ def main(args):
# This option is used in CI to make sure that PyTorch build from the pinned commit
# is used instead of nightly. CI jobs wouldn't be able to catch regression from the
# latest PT commit otherwise
install_requirements(use_pytorch_nightly=not args.use_pt_pinned_commit)
os.execvp(
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 had to change back from os.execvp to subprocess since install_optional_example_requirement is never reachable because os.execvp completely replaces the current process with the pip install command

@mergennachin mergennachin force-pushed the extract_out_examples branch 2 times, most recently from fe94337 to bc9bfb8 Compare June 16, 2025 16:39
@mergennachin mergennachin force-pushed the extract_out_examples branch from bc9bfb8 to 9e0e259 Compare June 16, 2025 16:40
@mergennachin mergennachin merged commit 3237348 into main Jun 16, 2025
194 of 195 checks passed
@mergennachin mergennachin deleted the extract_out_examples branch June 16, 2025 16:54
@mergennachin mergennachin mentioned this pull request Jun 16, 2025
abhinaykukkadapu pushed a commit to abhinaykukkadapu/executorch that referenced this pull request Jun 17, 2025
…h#11653)

Install requirements is installing so many things that's not necessary
for core executorch runtime. For example, it's not necessary to install
packages that is used in examples.

Ideally, developers should just run to install core ET. 

```
install_requirement.sh
pip install . -e
```
larryliu0820 added a commit that referenced this pull request Jun 19, 2025
#11653 added `--example` argument to install torchvision. We need to add that for testing wheels.
larryliu0820 added a commit that referenced this pull request Jun 19, 2025
#11653 added `--example` argument to install torchvision. We need to add
that for testing wheels.
hinriksnaer pushed a commit to hinriksnaer/executorch that referenced this pull request Jun 26, 2025
pytorch#11653 added `--example` argument to install torchvision. We need to add
that for testing wheels.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants