Skip to content

[cadence][hifi] Fix CMake build errors TOT#17119

Merged
zonglinpeng merged 4 commits intomainfrom
cadence/fix-hifi-cmake-kernel-build
Feb 4, 2026
Merged

[cadence][hifi] Fix CMake build errors TOT#17119
zonglinpeng merged 4 commits intomainfrom
cadence/fix-hifi-cmake-kernel-build

Conversation

@zonglinpeng
Copy link
Contributor

@zonglinpeng zonglinpeng commented Feb 2, 2026

Summary

Fix build and deps for cadence HiFi

Test plan

Cmake and xtrun

Zonglin Peng 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
```
@pytorch-bot
Copy link

pytorch-bot bot commented Feb 2, 2026

🔗 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 Failures

As of commit bf83dc5 with merge base 6f780c7 (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 2, 2026
@github-actions
Copy link

github-actions bot commented Feb 4, 2026

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@zonglinpeng zonglinpeng merged commit 267a59d into main Feb 4, 2026
177 of 181 checks passed
@zonglinpeng zonglinpeng deleted the cadence/fix-hifi-cmake-kernel-build branch February 4, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants