build(ascend): support custom kernel builds#602
Merged
voltjia merged 2 commits intoJul 2, 2026
Conversation
8aabd09 to
251faac
Compare
9ac252e to
4df58e5
Compare
4df58e5 to
91f73a0
Compare
Ziminli
reviewed
Jun 30, 2026
Ziminli
approved these changes
Jul 2, 2026
voltjia
approved these changes
Jul 2, 2026
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
BUILD_CUSTOM_KERNELpath withBUILD_ASCEND_CUSTOMand drive customAscendCkernels through the standalonesrc/native/ascend/custom/build.shsub-build.libno_workspace_kernel.aand link it into generated Python bindings with--whole-archive.SOC_VERSIONdetection insrc/native/ascend/custom/cmake/detect_soc.cmake.MAIN_SRC_DIRexplicitly soCANNcan find host objects even when the repo is checked out under.worktrees.master(d67759e).Motivation
Custom
AscendCkernels are needed by upcoming Ascend operator implementations. Building them through a standalone sub-build avoids theCANNextract_host_stub.pypath handling issue seen inscikit-build-coretemporary builds while keeping the artifacts underbuild/build_ascend_custom/.N/A. No issue is linked.
Type of Change
feat- new feature / new operator / new platformfix- bug fixperf- performance improvement (no behavioral change)refactor- code restructuring without behavior changetest- adding or fixing tests onlydocs- documentation onlybuild/ci- build system or CI configurationchore- tooling, formatting, or other non-code changes!in the Conventional Commits prefix or aBREAKING CHANGE:footer)Platforms Affected
WITH_CPU)WITH_NVIDIA)WITH_ILUVATAR)WITH_METAX)WITH_CAMBRICON)WITH_MOORE)WITH_ASCEND)WITH_TORCH)Test Results on Supported Platforms
pytestResult91f73a0.Local checks
Both commands passed locally after rebasing onto
upstream/masterd67759e.GitHub CI re-run
Benchmark / Performance Impact
N/A. This PR changes build plumbing only.
Notes for Reviewers
src/base/operator API is changed in this PR.CANNhelper script limitation where recursive Pythonglobskips host object paths containing hidden directory components.BUILD_ASCEND_CUSTOMis enabled.Checklist
Title, Branch, and Commits
<type>/xxx-yyyy-zzzz.master.fixup!/squash!/wipcommits remain.Scope and Design
TODOentries.src/base/public API is changed.General Code Hygiene
backticks.C++ Specific
N/A. No C++ source files are changed.
Python Specific
N/A. No Python source files are changed.
Testing
Build, CI, and Tooling
git diff --checkpasses.bash -n src/native/ascend/custom/build.shpasses.Documentation
SOC_VERSIONdetection.Security and Safety