Commit 9a22d3a
zhangyue
build(ascend-custom): pip-buildable custom kernels via pre-built static lib
`BUILD_CUSTOM_KERNEL=ON` under `scikit-build-core` / `pip install` trips a
`CANN` `extract_host_stub.py` path-handling bug (`KeyError` on the
`/./workspace/...` path produced by `$<TARGET_OBJECTS>` in CMake 4.x).
`CMakeLists.txt` already notes the issue and suggests the standalone
`src/ascend/custom/build.sh` script as the workaround.
- `src/CMakeLists.txt`: when a pre-built
`src/ascend/custom/build/lib/libno_workspace_kernel.a` exists, import
it as `IMPORTED STATIC` and link via `$<TARGET_FILE:…>` +
`--whole-archive`. Falls back to in-tree `ascendc_library()` when the
pre-built is absent (works for direct `cmake` builds outside `pip`).
- `src/ascend/custom/CMakeLists.txt`: pushes the main `src/` onto the
interface target's `INCLUDES` property so the kernel TU can
`#include "data_type.h"` — the `ascendc_library()` macro forwards this
into its nested `ExternalProject_Add` sub-build.
- `src/ascend/custom/add_rms_norm/op_kernel/.clang-tidy`: disables all
`clang-tidy` checks for device code under this directory (compiled by
`ccec`, absent from `compile_commands.json`, `__aicore__` macro parses
incorrectly without `kernel_operator.h`).1 parent b6821a5 commit 9a22d3a
3 files changed
Lines changed: 40 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
246 | 264 | | |
247 | 265 | | |
248 | 266 | | |
| |||
379 | 397 | | |
380 | 398 | | |
381 | 399 | | |
| 400 | + | |
| 401 | + | |
382 | 402 | | |
383 | 403 | | |
384 | | - | |
| 404 | + | |
385 | 405 | | |
386 | 406 | | |
387 | 407 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
66 | 75 | | |
67 | 76 | | |
68 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
0 commit comments