Skip to main content

cann-cann

一行代码快速检查环境上的 NPU 与 CANN 参数

看看你的 UB 有多大😎

安装

pip install cann-cann

支持 Python >= 3.10;需要安装 CANN 并加载环境变量

命令行

提供 cann-cann 与作为简称的 ccann 命令,使用任一命令均可

ccann npu-name               # Ascend950PR_XXXX
ccann UB --kb                # 248
ccann -n A3 memory --gb      # 64
ccann cann-version           # 9.1.0
ccann cores                  # AI、Cube、Vector 核数量

Python 接口

import cann_cann

cann_cann.npu_name()  # "Ascend950PR_XXXX"
cann_cann.ub_size(unit="kb")  # 248
cann_cann.memory_size(npu_name="A3", unit="gb")  # 64
cann_cann.cann_version()  # "9.1.0"

完整的查询列表、Python API、NPU 型号简称、单位和错误处理请参阅使用指南

参与开发

参与开发时,先安装开发依赖并启用提交前检查

uv sync --dev
uv run pre-commit install

启用后,每次提交前都会使用 Ruff 自动检查并格式化 Python 代码。也可手动检查所有文件

uv run pre-commit run --all-files

完整检查、测试与构建

uv run ruff format --check .
uv run ruff check .
uv run pytest
uv build

Metadata

Release files for cann-cann 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cann-cann 0.2.0
File Size Uploaded Provenance
cann_cann-0.2.0.tar.gz 15.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cann-cann 0.2.0
File Interpreter ABI Platform
cann_cann-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 31.7 kB

Release files / cann_cann-0.2.0.tar.gz

Download URL cann_cann-0.2.0.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ec4a952b5d0117d0804088512d88303967b8615d0f745cde4c414f65c03450c1
BLAKE2b-256 checksum
How to use checksums
14c96db6a3bc17e95e352a0a00978e526b6b71ade670ab9d9121f9c0ca56a5d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / cann_cann-0.2.0-py3-none-any.whl

Download URL cann_cann-0.2.0-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2aef0eb259cd9b5fda7a8e121fc68ccdff8e246f56beba2231dc5a0dd556fcc8
BLAKE2b-256 checksum
How to use checksums
99a142762db5ad427a808da3e646b8f1e65871a399262ad60495bacec055efc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for cann-cann 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page