Skip to content
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

Handle custom_ops like any other ET lib in Android and examples/models/lla{m,v}a/CMakeLists.txt #8946

Merged
merged 16 commits into from
Mar 7, 2025

Conversation

swolchok
Copy link
Contributor

@swolchok swolchok commented Mar 4, 2025

The old way was a holdover from when custom_ops lived in examples/models/llama (and was copy/pasted to llava and Android).

Needed for #8947.

swolchok added 4 commits March 4, 2025 11:35
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@swolchok swolchok requested a review from lucylq as a code owner March 4, 2025 22:54
Copy link

pytorch-bot bot commented Mar 4, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit b478275 with merge base 484231c (image):
💚 Looks good so far! There are no failures yet. 💚

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

swolchok added 7 commits March 4, 2025 18:23
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@swolchok
Copy link
Contributor Author

swolchok commented Mar 5, 2025

linker errors say reduce_util.cpp is in both portable_lib and custom_ops. indeed, executorch_srcs.cmake says it's there too! can't get rid of that file (executorch_srcs.cmake) soon enough, but until then I'll have to fix it.

[ghstack-poisoned]
@swolchok
Copy link
Contributor Author

swolchok commented Mar 5, 2025

looks like we have to handle the Android demo as well

Base automatically changed from gh/swolchok/306/head to main March 5, 2025 18:08
@@ -15,7 +15,7 @@
# ~~~
# It should also be cmake-lint clean.
#
cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.24) # 3.24 is required for WHOLE_ARCHIVE
Copy link
Contributor Author

@swolchok swolchok Mar 5, 2025

Choose a reason for hiding this comment

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

wondering how high we can bump this and if we can raise it globally

Copy link
Contributor Author

Choose a reason for hiding this comment

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

as I said on Discord:

the concern would be if there are projects that would want to take an ExecuTorch dep, but actually need an older CMake version. seems like we can raise it, but should avoid doing so unnecessarily.

so, i'm going to make this change in this PR but not roll it out to the top-level ExecuTorch CMakeLists.txt.

Copy link
Contributor

Choose a reason for hiding this comment

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

is that the only way to achieve whole-archive? I dont know much on the implication of requiring this but I suppose non-trivial number of folks using et may come to use for llama

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we pip install latest cmake anyway. people who follow our directions will get 3.31.

Copy link
Contributor

Choose a reason for hiding this comment

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

It would be good if we can do a codemod to change all CMakeLists.txt to have the same requirement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

change all CMakeLists.txt to have the same requirement.

@larryliu0820 I wouldn't mind doing this, I just thought it might be beneficial to only increase the requirement for the llama example use cases that need this stuff and leave the core/embedded cases lower. What do you think?

[ghstack-poisoned]
@swolchok swolchok changed the title Handle custom_ops like any other ET lib in examples/models/lla{m,v}a/CMakeLists.txt Handle custom_ops like any other ET lib in Android and examples/models/lla{m,v}a/CMakeLists.txt Mar 5, 2025
@swolchok
Copy link
Contributor Author

swolchok commented Mar 5, 2025

noting that CI is 100% green in case I rebase

[ghstack-poisoned]
[ghstack-poisoned]
@swolchok
Copy link
Contributor Author

swolchok commented Mar 6, 2025

Copy link
Contributor

@kimishpatel kimishpatel left a comment

Choose a reason for hiding this comment

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

I think @larryliu0820 should review this but left some comments

@swolchok swolchok requested a review from larryliu0820 March 7, 2025 17:35
[ghstack-poisoned]
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. topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants