Coverage for src/flag_gems/runtime/backend/_ascend/__init__.py: 79%
14 statements
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-19 02:32 +0800
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-19 02:32 +0800
1from backend_utils import VendorInfoBase # noqa: E402
3from .utils import CORE_NUM # noqa: F401
6def get_triton_extra_name():
7 try:
8 import triton
9 from packaging import version
11 if version.parse(triton.__version__) <= version.parse("3.2.0"):
12 return "ascend"
13 else:
14 return "cann"
15 except Exception:
16 return "ascend"
19vendor_info = VendorInfoBase(
20 vendor_name="ascend",
21 device_name="npu",
22 device_query_cmd="npu-smi info",
23 dispatch_key="PrivateUse1",
24 triton_extra_name=get_triton_extra_name(),
25)
27CUSTOMIZED_UNUSED_OPS = (
28 "contiguous",
29 "sort",
30 "sort_stable",
31 "copy_",
32 "_to_copy",
33)
36__all__ = ["*"]