Uh oh!
There was an error while loading. Please reload this page.
Make sure size_test CI uses -Wall -Werror - #8016
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/8016
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
mergennachin
commented
Jan 28, 2025
Continuing where I left off: #7940 Not changing CMakeLists.txt this time. |
348754d to
89bd6acCompareswolchok
commented
Jan 28, 2025
I don't see size_test in the CI jobs? |
Just rebased (which contain CI fixes) size_test for clang12 passed, but not for gcc9 https://github.com/pytorch/executorch/actions/runs/13022554836/job/36326025227?pr=8016 |
| return; | ||
| } | ||
| strncpy(buf, "v1/", 3); | ||
| strcpy(buf, "v1/"); |
There was a problem hiding this comment.
/pytorch/executorch/runtime/kernel/operator_registry.cpp:187:3: note: in expansion of macro 'ET_LOG_TENSOR_META'
187 | ET_LOG_TENSOR_META(meta_list);
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/string.h:535,
from /usr/include/c++/9/cstring:42,
from /pytorch/executorch/../executorch/runtime/kernel/operator_registry.h:11,
from /pytorch/executorch/runtime/kernel/operator_registry.cpp:9:
In function 'char* strncpy(char*, const char*, size_t)',
inlined from 'void executorch::runtime::internal::make_kernel_key_string(executorch::runtime::Span<const executorch::runtime::TensorMeta>, char*)' at /pytorch/executorch/runtime/kernel/operator_registry.cpp:138:10:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:95:34: error: 'char* __builtin_strncpy(char*, const char*, long unsigned int)' output truncated before terminating nul copying 3 bytes from a string of the same length [-Werror=stringop-truncation]
There was a problem hiding this comment.
the warning here was unhelpful IMO
There was a problem hiding this comment.
Should this just be memcpy(buf, "v1/", 3);? Or are we relying on the NUL byte that strcpy adds?
There was a problem hiding this comment.
I completely rewrote this function in #8327, so watch out for merge conflicts (if mine lands first)
There was a problem hiding this comment.
yeah, thanks for the heads up, will be careful during rebase
mergennachin
commented
Feb 3, 2025
|
facebook-github-bot
commented
Feb 3, 2025
@mergennachin has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
facebook-github-bot
commented
Feb 3, 2025
@mergennachin has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
| ET_SWITCH_SCALAR_OBJ_TYPES(val_type, ctx, name, CTYPE_VAL, [&] { | ||
| CTYPE_VAL val; | ||
| utils::extract_scalar(fill_value, &val); | ||
| ET_KERNEL_CHECK( |
There was a problem hiding this comment.
Had to adjust due to errors like this:
https://github.com/pytorch/executorch/actions/runs/13123283587/job/36614101657?pr=8016
There was a problem hiding this comment.
I don't think ET_KERNEL_CHECK will do the right thing in a lambda -- it returns from the lambda, not the operator
There was a problem hiding this comment.
any suggestions on how to fix?
i think it's fine, since it will return void from the lambda, but sets context to be fail, with error code InvalidArgument.
| ET_SWITCH_SCALAR_OBJ_TYPES(val_type, ctx, name, CTYPE_VAL, [&] { | ||
| CTYPE_VAL val; | ||
| utils::extract_scalar(fill_value, &val); | ||
| ET_KERNEL_CHECK( |
There was a problem hiding this comment.
I don't think ET_KERNEL_CHECK will do the right thing in a lambda -- it returns from the lambda, not the operator
| return; | ||
| } | ||
| strncpy(buf, "v1/", 3); | ||
| strcpy(buf, "v1/"); |
There was a problem hiding this comment.
the warning here was unhelpful IMO
| # shellcheck source=/dev/null | ||
| source "$(dirname "${BASH_SOURCE[0]}")/../.ci/scripts/utils.sh" | ||
| # Remove -Wno-sign-compare (https://github.com/pytorch/executorch/issues/8149) |
There was a problem hiding this comment.
did you mean to put a TODO here?
swolchok
commented
Feb 8, 2025
@mergennachin do you need anything else from me on this one? |
i don't think we have come to a resolution on errors on boolean errors: https://github.com/pytorch/executorch/actions/runs/13123890485/job/36616081625?pr=8016 i can specialize for boolean cases, and use &&= |
swolchok
commented
Feb 10, 2025
&&= does not exist; you'd need &=. IMO such a change would be clear uglification of the code only to suppress a warning |
mergennachin
commented
Feb 10, 2025
But it's a legitimate warning, no? You can today pass in a random memory location and define it as "boolean" tensor, which will cause some undefined behavior. unless you pass in UBSAN flag |
I don't think the code change you are considering would address the issue you just raised above. |
988ee15 to
ae885e7Comparemergennachin
commented
Feb 10, 2025
Okay, I will suppress that error for now and create a follow-up issue to track it |
8b9425b to
0c82c8bCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
facebook-github-bot
commented
Feb 11, 2025
@mergennachin has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
| b_shape_str.data()); | ||
| tensor_shape_to_c_string(a_size_span).data(), | ||
| tensor_shape_to_c_string(b_size_span).data()); | ||
| #endif |
swolchok
commented
Feb 12, 2025
@mergennachin it seems suboptimal for us to enforce -Wall -Werror, but only in a CI job that runs only on trunk, as this will result in unnecessarily-delayed detection of broken trunk. could we perhaps have a pull-time CI job that builds with these flags? |
swolchok
commented
Feb 12, 2025
e.g. #8314 promptly broke this on trunk because of -Werror |
I am not changing the default compilation option for all of ExecuTorch. I'm only changing the compile option for size_test and size_test_all_ops tests.
We don't run size_test for Windows, at least for today
Test Plan:
Run
sh test/build_size_test.shAdd op_fill.cpp with this patch at the end of the file.
Make sure the compilation fails, https://gist.github.com/mergennachin/25b78c63069b9e9b2203e66f94b1a0be
Make sure the compilation succeeds without the "-Wall -Werror" flags.