|
| 1 | +# Ascend, through the same island |
| 2 | + |
| 3 | +`op_kernel/` beside `op_host/` is how CANN's own operator libraries are already |
| 4 | +laid out — every operator in `ops-math` splits that way on disk. The island is |
| 5 | +therefore not a shape mcpp imposes on Ascend; it is the shape Ascend already |
| 6 | +has, and this example writes it in mcpp's vocabulary. |
| 7 | + |
| 8 | +`.asc` is that seam made checkable, exactly as `.sycl` is in the SYCL example: |
| 9 | +the file's content is C++ and nothing in it would tell a reader otherwise. What |
| 10 | +makes it a device translation unit is that it goes to BiSheng — a compiler with |
| 11 | +a device back end, and one that does not accept C++20 modules. |
| 12 | + |
| 13 | +## This example does not build yet |
| 14 | + |
| 15 | +Two pieces do not exist: |
| 16 | + |
| 17 | +| Missing | What it is | |
| 18 | +|---|---| |
| 19 | +| `mcpp.rules.ascendc` | the rule package that drives BiSheng, the sibling of `rules-cuda` / `rules-spirv` | |
| 20 | +| `xim:cann-toolkit` | an index package carrying the toolkit | |
| 21 | + |
| 22 | +Nothing else is missing, and that is why the manifest is written out rather than |
| 23 | +described. It is listed in `.github/tools/build_examples.sh` as skipped, with |
| 24 | +that reason. |
| 25 | + |
| 26 | +## What was established about the toolkit |
| 27 | + |
| 28 | +Measured 2026-09-07 and recorded in |
| 29 | +`.agents/docs/2026-09-07-general-build-infrastructure-gaps-design.md` section 10: |
| 30 | + |
| 31 | +* **One payload, not two.** BiSheng and the simulator live in the same toolkit: |
| 32 | + `compiler/ccec_compiler/bin/bisheng` and `*/simulator/<SoC>/lib`. |
| 33 | +* **It can be obtained anonymously.** The official distribution is a container |
| 34 | + image, `swr.cn-south-1.myhuaweicloud.com/ascendhub/cann`, and its registry |
| 35 | + issues a pull token without credentials. Fetching from the vendor's own |
| 36 | + registry is the tier this ecosystem's invariant already permits — linked |
| 37 | + where it is, never copied into a release of ours. |
| 38 | +* **A device is not required to verify a device build.** Ascend C has three run |
| 39 | + modes, and `sim` needs no hardware. It is not a substitute for `cpu` mode: |
| 40 | + `cpu` links `tikicpulib` and compiles the same kernel source with the HOST |
| 41 | + compiler, so that graph contains no island at all and passing in it would |
| 42 | + prove the kernel's arithmetic rather than the build. Every `RUN_MODE` test in |
| 43 | + asc-devkit is `STREQUAL "cpu"` — there is no `sim` branch — so `sim` takes the |
| 44 | + same path as `npu` and BiSheng is invoked. |
| 45 | + |
| 46 | +## Why `accelerator = "none"` for the fallback |
| 47 | + |
| 48 | +`not(accelerator = "ascend")` would work today and rot tomorrow: `accelerator` |
| 49 | +is an open vocabulary, so a fallback written by enumerating what it is not |
| 50 | +changes meaning every time the ecosystem gains a backend. Ascend is itself an |
| 51 | +instance of that growth, which is the neatest possible argument for the |
| 52 | +spelling. |
0 commit comments