You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[kernels/quantized] Enable -Werror and fix format specifier warnings
Summary:
Enable -Werror for kernels/quantized and fix format specifier mismatches
that were causing -Wformat warnings when tensor dimension/size values
(int64_t in ATen mode) were formatted with %zd (for ssize_t).
Changes:
- Add -Werror to _common_compile_options in kernels/quantized/CMakeLists.txt
- Replace %zd with ET_PRI_TENSOR_DIM for tensor .dim(), .size(), and .numel() calls in:
- op_embedding.cpp
- embeddingxb.cpp
- op_choose_qparams.cpp
- op_quantize.cpp
- Fix ET_CHECK_VALID_DIM macro in tensor_util.h to use ET_PRI_TENSOR_DIM
ET_PRI_TENSOR_DIM is the portable format specifier macro that adapts to
the build mode (PRId64 for ATen mode, "zd" for portable mode).
Test Plan:
Build with: cmake --build cmake-out -j9 --target quantized_kernels
Verify no -Wformat errors with -Werror enabled.
0 commit comments