[csrc][bugfix] Add compile-time Ascend950/910_95 compatibility for custom ops between CANN8.5 and 9.0 (#6936)

### What this PR does / why we need it?
Remove hardcoded ASCEND910_95 usage in csrc custom-op host/tiling code
and
select the SoC target at CMake configure time.

- Probe CANN headers with check_cxx_source_compiles:
prefer platform_ascendc::SocVersion::ASCEND950, fallback to
ASCEND910_95.
- Export the selected enum/config string via shared compile definitions
(VLLM_ASCEND_950_SOC_ENUM / VLLM_ASCEND_950_SOC_CONFIG).
- Apply the shared macros to affected paths (moe_gating_top_k,
add_rms_norm_bias) to avoid per-file hardcoding.
- Keep behavior unchanged; this is an internal build-compatibility fix
for CANN 8.5 and 9.x.

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?

- vLLM version: v0.16.0
- vLLM main:
15d76f74e2

---------

Signed-off-by: linfeng-yuan <1102311262@qq.com>
This commit is contained in:
linfeng-yuan
2026-03-03 17:08:22 +08:00
committed by GitHub
parent 2064afe380
commit cb893bcdb0
6 changed files with 57 additions and 8 deletions

View File

@@ -64,6 +64,8 @@ target_compile_definitions(intf_pub
INTERFACE
$<$<COMPILE_LANGUAGE:CXX>:_GLIBCXX_USE_CXX11_ABI=0>
$<$<CONFIG:Release>:_FORTIFY_SOURCE=2>
$<$<COMPILE_LANGUAGE:CXX>:VLLM_ASCEND_950_SOC_ENUM=${VLLM_ASCEND_950_SOC_ENUM}>
$<$<COMPILE_LANGUAGE:CXX>:VLLM_ASCEND_950_SOC_CONFIG=\"${VLLM_ASCEND_950_SOC_CONFIG}\">
)
target_link_options(intf_pub
INTERFACE