-
Notifications
You must be signed in to change notification settings - Fork 637
Support for Dtye Selective Build from Dictionary API in OSS (cmake) #12873
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
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/12873
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 1 New Failure, 81 PendingAs of commit 6ba45eb with merge base 8651d31 ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@pytorchbot label "release notes: none" |
@@ -66,6 +66,11 @@ option(EXECUTORCH_SELECT_ALL_OPS | |||
"Whether to register all ops defined in portable kernel library." OFF | |||
) | |||
|
|||
# Option to enable parsing ops and dtypes from json formatted dictionary | |||
option(EXECUTORCH_SELECT_OPS_FROM_DICT | |||
"Enable op selection from json formattting string during build." OFF |
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.
Could we add a link to the supported dtype strings, e.g. https://github.com/pytorch/executorch/blame/0211a0346455f5b1ce445c2bdf6fce89a9aa04c9/shim_et/xplat/executorch/codegen/codegen.bzl#L51
^ actually I think this list is too broad and not all supported in ET 😅
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.
I think there are actually only 8 dtypes that are supported and tested. I remember seeing a list of them somewhere in the code base, will note them here.
849311e
to
6828f13
Compare
6828f13
to
6ba45eb
Compare
Summary
When attempting to build minimal binary size with only a select number of operators and dtypes, it's advantageous to simply specify only the needed selections at compile time. This PR allows one to specify a JSON formatted string to select operators and dtypes to be included in the final binary. An example is also provided.
Test plan
This feature was tested with the added example in
examples/selective_build/test_selective_build.sh
which now has a function namedtest_cmake_select_ops_in_dict()
. This function exemplifies the usage of the newly added dictionary API.