build(ascend): support custom kernel builds#602
Draft
zhangyue207 wants to merge 1 commit into
Draft
Conversation
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.Motivation
Custom
AscendCkernels are needed by the upcomingRmsNormandAddRmsNormAscend 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
pytestResult36 skipped in 0.07sfortests/test_rms_norm.pyinfiniops-ci/ascend:latestcontainer on Ascend 910B4.Build and pytest output
Benchmark / Performance Impact
N/A. This PR changes build plumbing only.
Notes for Reviewers
src/base/operator API is changed in this PR.tests/test_rms_norm.pyskips because this PR intentionally does not add the AscendRmsNormoperator wrapper; the operator PR will provide the runnable focused tests.CANNhelper script limitation where recursive Pythonglobskips host object paths containing hidden directory components.Checklist
Title, Branch, and Commits
<type>/xxx-yyyy-zzzz.master— the branch is rebased cleanly on top of the currentmaster.fixup!/squash!/wipcommits remain.Scope and Design
printf/std::cout/print(...)left behind, orTODOwithout an owner and issue link.src/base/public API is changed.General Code Hygiene
C++ Specific
N/A. No C++ source files are changed.
Python Specific
N/A. No Python source files are changed.
Testing
pytest tests/test_rms_norm.py --devices ascend -v --tb=shortwas run in the project Ascend container.Build, CI, and Tooling
pip install .[dev]on the affected Ascend configuration.compile_commands.jsonstill regenerates through the build.git diff --checkpasses.bash -n src/native/ascend/custom/build.shpasses.Documentation
SOC_VERSIONdetection.Security and Safety