-
Notifications
You must be signed in to change notification settings - Fork 706
Fix warning when building kernel libraries #15405
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
Conversation
Getting warnings like the following:
```
/home/larryliu/executorch/kernels/portable/cpu/op_maximum.cpp: In lambda function:
/home/larryliu/executorch/kernels/portable/cpu/op_maximum.cpp:52:9: note: the ABI for passing parameters with 32-byte alignment has changed in GCC 4.6
52 | [](const auto val_a, const auto val_b) {
| ^
/home/larryliu/executorch/../executorch/runtime/core/exec_aten/util/scalar_type_util.h:919:7: note: in definition of macro 'ET_INTERNAL_SWITCH'
919 | __VA_ARGS__ \
| ^~~~~~~~~~~
/home/larryliu/executorch/../executorch/runtime/core/exec_aten/util/scalar_type_util.h:931:3: note: in expansion of macro 'ET_INTERNAL_SWITCH_CASE'
931 | ET_INTERNAL_SWITCH_CASE( \
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/larryliu/executorch/../executorch/runtime/core/exec_aten/util/scalar_type_util.h:957:3: note: in expansion of macro 'ET_INTERNAL_SWITCH_CASE_INT_TYPES'
957 | ET_INTERNAL_SWITCH_CASE_INT_TYPES(CTYPE_ALIAS, __VA_ARGS__) \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/larryliu/executorch/../executorch/runtime/core/exec_aten/util/scalar_type_util.h:1008:3: note: in expansion of macro 'ET_INTERNAL_SWITCH_CASE_REAL_TYPES'
1008 | ET_INTERNAL_SWITCH_CASE_REAL_TYPES(CTYPE_ALIAS, __VA_ARGS__) \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/larryliu/executorch/../executorch/runtime/core/exec_aten/util/scalar_type_util.h:1136:7: note: in expansion of macro 'ET_INTERNAL_SWITCH_CASE_REAL_TYPES_AND'
1136 | ET_INTERNAL_SWITCH_CASE_REAL_TYPES_AND( \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/larryliu/executorch/../executorch/runtime/core/exec_aten/util/scalar_type_util.h:1172:3: note: in expansion of macro 'ET_SWITCH_REAL_TYPES_AND'
1172 | ET_SWITCH_REAL_TYPES_AND(Bool, TYPE, CONTEXT, NAME, CTYPE_ALIAS, __VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~~~
/home/larryliu/executorch/kernels/portable/cpu/op_maximum.cpp:47:3: note: in expansion of macro 'ET_SWITCH_REALB_TYPES'
47 | ET_SWITCH_REALB_TYPES(compute_type, ctx, op_name, CTYPE_COMPUTE, [&]() {
| ^~~~~~~~~~~~~~~~~~~~~
```
Fixing them in this PR
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/15405
Note: Links to docs will display an error until the docs builds have been completed. ❗ 2 Active SEVsThere are 2 currently active SEVs. If your PR is affected, please view them below:
⏳ No Failures, 7 PendingAs of commit c23e44f with merge base 72b1fa1 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this in D85778660. |
Getting warnings like the following:
Fixing them in this PR
Overview
This branch addresses GCC compiler warnings related to 32-byte alignment (ABI) when passing SIMD vector types to lambda functions in both portable and optimized kernel implementations.
Key Changes:
-Wno-psabicompiler flag to suppress ABI warnings for GNU compiler:$<$<CXX_COMPILER_ID:GNU>:-Wno-psabi><CTYPE>and changed lambda parameters from reference&to value (pass by value) fromat::vec::map()andat::vec::map3()calls&for lambdas being passed toapply_bitensor_elementwise_fn()and similar functions.Problem Solved
Before: GCC compiler produced numerous warnings like:
note: the ABI for passing parameters with 32-byte alignment has changed in GCC 4.6These warnings appeared when SIMD vector types (e.g.,
__m256from AVX) were passed to lambda functions, cluttering build output and making it difficult to spot real issues.After: Clean builds with no ABI warnings, while maintaining identical functionality and performance characteristics.