[cadence][hifi] Fix CMake build errors TOT#17119
Merged
zonglinpeng merged 4 commits intomainfrom Feb 4, 2026
Merged
Conversation
added 2 commits
February 2, 2026 13:44
Summary:
Fix linker errors in HiFi build caused by HiFi operators calling functions
in the impl::generic::native namespace that weren't being linked.
The HiFi operators (op_quantized_linear_out, op_quantized_matmul_out,
op_quantized_conv2d_out) fall back to generic implementations for certain
code paths. These generic implementations depend on:
1. Generic operator source files (op_quantized_linear.cpp, etc.)
2. Generic kernel functions (quantize/dequantize from kernels.cpp)
Changes:
- Added generic kernels.cpp to custom_ops library for quantize/dequantize functions
- Added generic operator source files to HiFi build
- Fixed missing .cpp extensions on operator file entries in CMakeLists.txt
Test Plan:
Build cadence runner with HiFi flavor:
```bash
rm -rf cmake-out
cmake_prefix_path=$(python3 -c "import torch; print(torch.utils.cmake_prefix_path)")
wp CXXFLAGS="-fno-exceptions -fno-rtti" cmake \
-DCMAKE_PREFIX_PATH="${cmake_prefix_path}" \
-DCMAKE_TOOLCHAIN_FILE=./backends/cadence/cadence.cmake \
-DCMAKE_INSTALL_PREFIX=cmake-out \
-DEXECUTORCH_BUILD_SDK=ON \
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=OFF \
-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \
-DEXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL=ON \
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DFLATCC_ALLOW_WERROR=OFF \
-DEXECUTORCH_ENABLE_LOGGING=ON \
-DEXECUTORCH_BUILD_CADENCE=ON \
-DCADENCE_FLAVOR_HIFI=ON \
-Bcmake-out
wp cmake --build cmake-out --target install --config Release -j8
```
Summary:
Fix linker errors in HiFi build caused by HiFi operators calling functions
in the impl::generic::native namespace that weren't being linked.
The HiFi operators (op_quantized_linear_out, op_quantized_matmul_out,
op_quantized_conv2d_out) fall back to generic implementations for certain
code paths. These generic implementations depend on:
1. Generic operator source files (op_quantized_linear.cpp, etc.)
2. Generic kernel functions (quantize/dequantize from kernels.cpp)
Changes:
- Added generic kernels.cpp to custom_ops library for quantize/dequantize functions
- Added generic operator source files to HiFi build
- Fixed missing .cpp extensions on operator file entries in CMakeLists.txt
- Removed unused commented code from functions_hifi.yaml and operator files
Test Plan:
Build cadence runner with HiFi flavor:
```bash
rm -rf cmake-out
wp cmake -DCMAKE_TOOLCHAIN_FILE=./backends/cadence/cadence.cmake \
-DEXECUTORCH_BUILD_CADENCE=ON -DCADENCE_FLAVOR_HIFI=ON -Bcmake-out
wp cmake --build cmake-out --target install --config Release -j8
```
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17119
Note: Links to docs will display an error until the docs builds have been completed. ❌ 4 New FailuresAs of commit bf83dc5 with merge base 6f780c7 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
ethansfng
approved these changes
Feb 2, 2026
This PR needs a
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix build and deps for cadence HiFi
Test plan
Cmake and xtrun