-
Notifications
You must be signed in to change notification settings - Fork 539
Create a helper to define overridable configs #10731
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
+447
−3
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/10731
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 2 PendingAs of commit 738e250 with merge base cebe051 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
0016cdd
to
ec90eda
Compare
171b0de
to
dcf72ee
Compare
dcf72ee
to
50c54c1
Compare
larryliu0820
reviewed
May 7, 2025
return result | ||
|
||
|
||
class CMakeTestCase(unittest.TestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow thanks for writing the tests! I didn't know CMake is testable
larryliu0820
reviewed
May 7, 2025
larryliu0820
reviewed
May 7, 2025
larryliu0820
reviewed
May 7, 2025
larryliu0820
reviewed
May 7, 2025
larryliu0820
approved these changes
May 7, 2025
larryliu0820
reviewed
May 7, 2025
jhelsby
pushed a commit
to jhelsby/executorch
that referenced
this pull request
May 9, 2025
### Summary Context: pytorch#10661. As part pytorch#10716, this creates a helper to define ET configs. #### Why define_overridable_config? This is a simple wrapper to configure an option via the user or fallback to a default value. Instead of having people do this manually, this is convenient and consistent. More specifically: - If the option is set via the CLI or `set`, then save that value in the cache — with our own description - If the option is unset, then fallback to the default value The user options will be loaded *before* loading the `default.cmake` file. This means, when we load the default file, we can use the user set options or fallback on defaults. Then finally we can do a final sweet of option validations. After this point, all options will be frozen and immutable. Moreover, having a helper function will allow us to enforce standards on options. For example, naming standards done in this PR. #### Migration plan For now, I've only migrated a simple option `EXECUTORCH_ENABLE_LOGGING`. We'll incrementally migrate remaining options in future PRs. ### Test plan For changes to `EXECUTORCH_ENABLE_LOGGING`, I changed the release modes and checked the finaly `CMakeCache.txt` file. Rely on CI for full tests. For python tests: ``` $ python3 -m unittest discover -s tools/cmake -p "*.py" ``` I will include this test in CI in the next diff.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
ciflow/binaries
ciflow/trunk
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
module: build/install
Issues related to the cmake and buck2 builds, and to installing ExecuTorch
release notes: build
Changes related to build, including dependency upgrades, build flags, optimizations, etc.
topic: not user facing
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Context: #10661. As part #10716, this creates a helper to define ET configs.
Why define_overridable_config?
This is a simple wrapper to configure an option via the user or fallback to a default value. Instead of having people do this manually, this is convenient and consistent. More specifically:
set
, then save that value in the cache — with our own descriptionThe user options will be loaded before loading the
default.cmake
file. This means, when we load the default file, we can use the user set options or fallback on defaults. Then finally we can do a final sweet of option validations. After this point, all options will be frozen and immutable.Moreover, having a helper function will allow us to enforce standards on options. For example, naming standards done in this PR.
Migration plan
For now, I've only migrated a simple option
EXECUTORCH_ENABLE_LOGGING
. We'll incrementally migrate remaining options in future PRs.Test plan
For changes to
EXECUTORCH_ENABLE_LOGGING
, I changed the release modes and checked the finalyCMakeCache.txt
file. Rely on CI for full tests.For python tests:
I will include this test in CI in the next diff.
cc @larryliu0820