Skip to content

Commit 7bd5493

Browse files
authored
patch global cmake build errors
Differential Revision: D84854901 Pull Request resolved: #15211
1 parent b5946cf commit 7bd5493

File tree

6 files changed

+45
-28
lines changed

6 files changed

+45
-28
lines changed

backends/cadence/aot/functions_vision.yaml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
- op: _softmax.out
2121
kernels:
2222
- arg_meta: null
23-
kernel_name: impl::vision::native::_softmax_out
23+
kernel_name: impl::vision::_softmax_out
2424

2525
- op: add.out
2626
kernels:
2727
- arg_meta: null
28-
kernel_name: impl::vision::native::add_out
28+
kernel_name: impl::vision::add_out
2929

3030
- op: bmm.out
3131
kernels:
@@ -55,7 +55,7 @@
5555
- op: embedding.out
5656
kernels:
5757
- arg_meta: null
58-
kernel_name: impl::vision::native::embedding_out
58+
kernel_name: impl::vision::embedding_out
5959

6060
- op: empty.out
6161
kernels:
@@ -70,7 +70,7 @@
7070
- op: full.out
7171
kernels:
7272
- arg_meta: null
73-
kernel_name: impl::vision::native::full_out
73+
kernel_name: impl::vision::full_out
7474

7575
- op: gelu.out
7676
kernels:
@@ -135,7 +135,7 @@
135135
- op: view_copy.out
136136
kernels:
137137
- arg_meta: null
138-
kernel_name: impl::vision::native::view_copy_out
138+
kernel_name: impl::vision::view_copy_out
139139

140140
- op: where.self_out
141141
kernels:
@@ -182,94 +182,94 @@
182182
variants: function
183183
kernels:
184184
- arg_meta: null
185-
kernel_name: impl::vision::native::quantize_per_tensor_out
185+
kernel_name: impl::vision::quantize_per_tensor_out
186186

187187
- func: cadence::dequantize_per_tensor.out(Tensor input, float scale, int zero_point, int quant_min, int quant_max, ScalarType dtype, *, Tensor(a!) out) -> Tensor(a!)
188188
variants: function
189189
kernels:
190190
- arg_meta: null
191-
kernel_name: impl::vision::native::dequantize_per_tensor_out
191+
kernel_name: impl::vision::dequantize_per_tensor_out
192192

193193
- func: cadence::quantized_conv.out(Tensor input, Tensor weight, Tensor bias, int[] stride, SymInt[] padding, int[] dilation, int groups, int input_zero_point, Tensor weight_zero_point, Tensor bias_scale, float out_scale, int out_zero_point, Tensor out_multiplier, Tensor out_shift, bool channel_last=False, *, Tensor(a!) out) -> Tensor(a!)
194194
kernels:
195195
- arg_meta: null
196-
kernel_name: impl::vision::native::quantized_conv_out
196+
kernel_name: impl::vision::quantized_conv_out
197197

198198
- func: cadence::quantized_conv2d_nchw.out(Tensor input, Tensor weight, Tensor bias, int[] stride, SymInt[] padding, int[] dilation, int groups, int input_zero_point, Tensor weight_zero_point, Tensor bias_scale, float out_scale, int out_zero_point, Tensor out_multiplier, Tensor out_shift, *, Tensor(a!) out) -> Tensor(a!)
199199
kernels:
200200
- arg_meta: null
201-
kernel_name: impl::vision::native::quantized_conv2d_nchw_out
201+
kernel_name: impl::vision::quantized_conv2d_nchw_out
202202

203203
- func: cadence::quantized_conv2d_nhwc.out(Tensor input, Tensor weight, Tensor bias, int[] stride, SymInt[] padding, int[] dilation, int groups, int input_zero_point, Tensor weight_zero_point, Tensor bias_scale, float out_scale, int out_zero_point, Tensor out_multiplier, Tensor out_shift, *, Tensor(a!) out) -> Tensor(a!)
204204
kernels:
205205
- arg_meta: null
206-
kernel_name: impl::vision::native::quantized_conv2d_nhwc_out
206+
kernel_name: impl::vision::quantized_conv2d_nhwc_out
207207

208208
- func: cadence::quantized_layer_norm.out(Tensor input, Tensor in_scale, Tensor in_zero_point, int[] normalized_shape, Tensor weight, Tensor bias, float eps, float output_scale, int output_zero_point, *, Tensor(a!) out) -> Tensor(a!)
209209
kernels:
210210
- arg_meta: null
211-
kernel_name: impl::vision::native::quantized_layer_norm_out
211+
kernel_name: impl::vision::quantized_layer_norm_out
212212
- func: cadence::quantized_layer_norm.per_tensor_out(Tensor input, float in_scale, int in_zero_point, int[] normalized_shape, Tensor weight, Tensor bias, float eps, float output_scale, int output_zero_point, *, Tensor(a!) out) -> Tensor(a!)
213213
kernels:
214214
- arg_meta: null
215-
kernel_name: impl::vision::native::quantized_layer_norm_per_tensor_out
215+
kernel_name: impl::vision::quantized_layer_norm_per_tensor_out
216216

217217
- func: cadence::quantized_linear.out(Tensor src, Tensor weight, Tensor bias, int src_zero_point, Tensor weight_zero_point, Tensor out_multiplier, Tensor out_shift, int out_zero_point, Tensor? offset, *, Tensor(a!) out) -> Tensor(a!)
218218
kernels:
219219
- arg_meta: null
220-
kernel_name: impl::vision::native::quantized_linear_out
220+
kernel_name: impl::vision::quantized_linear_out
221221

222222
- func: cadence::quantized_relu.out(Tensor X, Tensor X_zero_point, int out_zero_point, Tensor out_multiplier, Tensor out_shift, *, Tensor(a!) out) -> Tensor(a!)
223223
kernels:
224224
- arg_meta: null
225-
kernel_name: impl::vision::native::quantized_relu_out
225+
kernel_name: impl::vision::quantized_relu_out
226226

227227
- func: cadence::quantized_relu.per_tensor_out(Tensor X, int X_zero_point, int out_zero_point, int out_multiplier, int out_shift, *, Tensor(a!) out) -> Tensor(a!)
228228
kernels:
229229
- arg_meta: null
230-
kernel_name: impl::vision::native::quantized_relu_per_tensor_out
230+
kernel_name: impl::vision::quantized_relu_per_tensor_out
231231

232232
- func: cadence::quantized_matmul.out(Tensor X, int X_zero_point, Tensor Y, int Y_zero_point, Tensor? bias, int out_multiplier, int out_shift, int out_zero_point, bool transposed, *, Tensor(a!) out) -> Tensor(a!)
233233
kernels:
234234
- arg_meta: null
235-
kernel_name: impl::vision::native::quantized_matmul_out
235+
kernel_name: impl::vision::quantized_matmul_out
236236

237237
- func: cadence::quantized_linear.per_tensor_out(Tensor src, Tensor weight, Tensor bias, SymInt src_zero_point, SymInt weight_zero_point, SymInt out_multiplier, SymInt out_shift, SymInt out_zero_point, Tensor? offset, *, Tensor(a!) out) -> Tensor(a!)
238238
kernels:
239239
- arg_meta: null
240-
kernel_name: impl::vision::native::quantized_linear_per_tensor_out
240+
kernel_name: impl::vision::quantized_linear_per_tensor_out
241241

242242
- func: cadence::im2row.out(Tensor input, int[2] kernel_size, int[2] dilation, int[2] padding, int[2] stride, Tensor in_zero_point, bool channel_last=False, *, Tensor(a!) out) -> Tensor(a!)
243243
kernels:
244244
- arg_meta: null
245-
kernel_name: impl::vision::native::im2row_out
245+
kernel_name: impl::vision::im2row_out
246246

247247
- func: cadence::im2row.per_tensor_out(Tensor input, int[2] kernel_size, int[2] dilation, int[2] padding, int[2] stride, int in_zero_point, bool channel_last=False, *, Tensor(a!) out) -> Tensor(a!)
248248
kernels:
249249
- arg_meta: null
250-
kernel_name: impl::vision::native::im2row_per_tensor_out
250+
kernel_name: impl::vision::im2row_per_tensor_out
251251

252252
- func: cadence::quantized_conv.per_tensor_out(Tensor input, Tensor weight, Tensor bias, int[] stride, SymInt[] padding, int[] dilation, int groups, int input_zero_point, int weight_zero_point, float bias_scale, float out_scale, int out_zero_point, int out_multiplier, int out_shift, bool channel_last=False, *, Tensor(a!) out) -> Tensor(a!)
253253
kernels:
254254
- arg_meta: null
255-
kernel_name: impl::vision::native::quantized_conv_per_tensor_out
255+
kernel_name: impl::vision::quantized_conv_per_tensor_out
256256

257257
- func: cadence::quantized_fully_connected.out(Tensor src, Tensor weight, Tensor bias, int src_zero_point, Tensor weight_zero_point, Tensor out_multiplier, Tensor out_shift, int out_zero_point, Tensor? offset, *, Tensor(a!) out) -> Tensor(a!)
258258
kernels:
259259
- arg_meta: null
260-
kernel_name: impl::vision::native::quantized_fully_connected_out
260+
kernel_name: impl::vision::quantized_fully_connected_out
261261

262262
- func: cadence::quantized_fully_connected.per_tensor_out(Tensor src, Tensor weight, Tensor bias, int src_zero_point, int weight_zero_point, int out_multiplier, int out_shift, int out_zero_point, Tensor? offset, *, Tensor(a!) out) -> Tensor(a!)
263263
kernels:
264264
- arg_meta: null
265-
kernel_name: impl::vision::native::quantized_fully_connected_per_tensor_out
265+
kernel_name: impl::vision::quantized_fully_connected_per_tensor_out
266266

267267
- func: cadence::requantize.out(Tensor input, Tensor in_scale, Tensor in_zero_point, Tensor out_scale, Tensor out_zero_point, ScalarType out_dtype, *, Tensor(a!) out) -> Tensor(a!)
268268
kernels:
269269
- arg_meta: null
270-
kernel_name: impl::vision::native::requantize_out
270+
kernel_name: impl::vision::requantize_out
271271

272272
- func: cadence::requantize.per_tensor_out(Tensor input, float in_scale, int in_zero_point, float out_scale, int out_zero_point, ScalarType out_dtype, *, Tensor(a!) out) -> Tensor(a!)
273273
kernels:
274274
- arg_meta: null
275-
kernel_name: impl::vision::native::requantize_per_tensor_out
275+
kernel_name: impl::vision::requantize_per_tensor_out

backends/cadence/build_cadence_fusionG3.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ if $STEPWISE_BUILD; then
3333
-DEXECUTORCH_USE_DL=OFF \
3434
-DEXECUTORCH_BUILD_CADENCE=OFF \
3535
-DHAVE_FNMATCH_H=OFF \
36+
-DFLATCC_ALLOW_WERROR=OFF \
3637
-Bcmake-out .
3738

3839
echo "Building any Cadence-specific binaries on top"
@@ -51,6 +52,7 @@ if $STEPWISE_BUILD; then
5152
-DPYTHON_EXECUTABLE=python3 \
5253
-DEXECUTORCH_FUSION_G3_OPT=ON \
5354
-DHAVE_FNMATCH_H=OFF \
55+
-DFLATCC_ALLOW_WERROR=OFF \
5456
-Bcmake-out/backends/cadence \
5557
backends/cadence
5658
cmake --build cmake-out/backends/cadence -j8
@@ -76,6 +78,7 @@ else
7678
-DPYTHON_EXECUTABLE=python3 \
7779
-DEXECUTORCH_FUSION_G3_OPT=ON \
7880
-DHAVE_FNMATCH_H=OFF \
81+
-DFLATCC_ALLOW_WERROR=OFF \
7982
-Bcmake-out
8083
cmake --build cmake-out --target install --config Release -j8
8184
fi

backends/cadence/build_cadence_hifi4.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ if $STEPWISE_BUILD; then
3232
-DEXECUTORCH_ENABLE_LOGGING=ON \
3333
-DEXECUTORCH_USE_DL=OFF \
3434
-DEXECUTORCH_BUILD_CADENCE=OFF \
35+
-DFLATCC_ALLOW_WERROR=OFF \
3536
-Bcmake-out .
3637

3738
echo "Building any Cadence-specific binaries on top"
@@ -50,6 +51,7 @@ if $STEPWISE_BUILD; then
5051
-DPYTHON_EXECUTABLE=python3 \
5152
-DEXECUTORCH_NNLIB_OPT=ON \
5253
-DHAVE_FNMATCH_H=OFF \
54+
-DFLATCC_ALLOW_WERROR=OFF \
5355
-Bcmake-out/backends/cadence \
5456
backends/cadence
5557
cmake --build cmake-out/backends/cadence -j8
@@ -74,6 +76,7 @@ else
7476
-DPYTHON_EXECUTABLE=python3 \
7577
-DEXECUTORCH_NNLIB_OPT=ON \
7678
-DHAVE_FNMATCH_H=OFF \
79+
-DFLATCC_ALLOW_WERROR=OFF \
7780
-Bcmake-out
7881
cmake --build cmake-out --target install --config Release -j8
7982
fi

backends/cadence/build_cadence_vision.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ if $STEPWISE_BUILD; then
3232
-DEXECUTORCH_ENABLE_LOGGING=ON \
3333
-DEXECUTORCH_USE_DL=OFF \
3434
-DEXECUTORCH_BUILD_CADENCE=OFF \
35+
-DFLATCC_ALLOW_WERROR=OFF \
3536
-Bcmake-out .
3637

3738
echo "Building any Cadence-specific binaries on top"
@@ -50,6 +51,7 @@ if $STEPWISE_BUILD; then
5051
-DPYTHON_EXECUTABLE=python3 \
5152
-DEXECUTORCH_VISION_OPT=ON \
5253
-DHAVE_FNMATCH_H=OFF \
54+
-DFLATCC_ALLOW_WERROR=OFF \
5355
-Bcmake-out/backends/cadence \
5456
backends/cadence
5557
cmake --build cmake-out/backends/cadence -j8
@@ -74,6 +76,7 @@ else
7476
-DPYTHON_EXECUTABLE=python3 \
7577
-DEXECUTORCH_VISION_OPT=ON \
7678
-DHAVE_FNMATCH_H=OFF \
79+
-DFLATCC_ALLOW_WERROR=OFF \
7780
-Bcmake-out
7881
cmake --build cmake-out --target install --config Release -j8
7982
fi

backends/cadence/cadence.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,12 @@ set(CMAKE_CROSSCOMPILING TRUE)
4141
set(CMAKE_C_COMPILER ${TOOLCHAIN_HOME}/bin/${CROSS_COMPILE_TARGET}-clang)
4242
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_HOME}/bin/${CROSS_COMPILE_TARGET}-clang++)
4343

44-
set(CMAKE_C_FLAGS_INIT "-stdlib=libc++ -mtext-section-literals -mlongcalls")
45-
set(CMAKE_CXX_FLAGS_INIT "-stdlib=libc++ -mtext-section-literals -mlongcalls")
44+
set(CMAKE_C_FLAGS_INIT
45+
"-stdlib=libc++ -mtext-section-literals -mlongcalls -DET_ENABLE_ENUM_STRINGS=0"
46+
)
47+
set(CMAKE_CXX_FLAGS_INIT
48+
"-stdlib=libc++ -mtext-section-literals -mlongcalls -DET_ENABLE_ENUM_STRINGS=0"
49+
)
4650
# workaround for larger compilation time
4751
set(CMAKE_CXX_FLAGS_INIT "${CMAKE_CXX_FLAGS_INIT} -fno-strict-aliasing")
4852

backends/cadence/vision/operators/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ set(_common_include_directories
7777
)
7878

7979
target_include_directories(
80-
aten_ops_cadence PUBLIC ${ROOT_DIR}/.. ${CMAKE_BINARY_DIR}
81-
${_common_include_directories}
80+
aten_ops_cadence
81+
PUBLIC ${ROOT_DIR}/.. ${CMAKE_BINARY_DIR} ${_common_include_directories}
82+
${CMAKE_CURRENT_SOURCE_DIR}/../third-party
8283
)
8384

8485
# Custom ops that are needed to run the test model.
@@ -118,3 +119,6 @@ message("Generated cadence x86 files ${gen_command_sources}")
118119
gen_operators_lib(
119120
LIB_NAME "cadence_ops_lib" KERNEL_LIBS custom_ops DEPS aten_ops_cadence
120121
)
122+
123+
# Link custom_ops to the generated library to ensure the symbols are available
124+
target_link_libraries(cadence_ops_lib PUBLIC custom_ops)

0 commit comments

Comments
 (0)