Loading...
Loading...
Huawei Ascend NPU natural language management skill, supporting both local direct connection and SSH remote modes. Provides comprehensive npu-smi command capabilities including device queries, configuration management, firmware upgrade, vNPU virtualization, certificate management, and compute power testing (FLOPS). Enables remote management and monitoring of Ascend NPU devices with real-time metrics tracking. Use this skill when the user wants to: (1) query NPU device status and health, (2) monitor temperature, power, memory/HBM utilization, (3) configure ECC settings and fan modes, (4) perform firmware upgrades, (5) manage vNPU virtualization, (6) run compute power tests, (7) check certificate information. Trigger: user mentionsnpu', 'ascend', 'NPU', 'Ascend', 'temperature', 'power', 'HBM', 'firmware', 'upgrade', 'vNPU', 'virtualization', 'certificate', 'FLOPS', 'compute', 'health', 'memory', 'utilization', 'ECC', 'fan', '昇腾', '昇腾卡', '昇腾状态', '显存', '算力', '设备查询', 'NPU监控'"
npx skill4agent add huaweicloud/huaweicloud-skills huawei-cloud-ascend-commandhuawei-cloud-ascend-remote-connectnpu-smi-skillmodel-deploy-test-skill┌─────────────────────────────────────────────────────────────────────┐
│ Agent Orchestration │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ 1. Parse user intent → Match Trigger keywords │ │
│ │ 2. Prepare params → host, user, password explicit │ │
│ │ 3. Invoke Skill → skill exec --name ascend-command │ │
│ │ 4. Return result → User │ │
│ └────────────────────────────┬────────────────────────────────┘ │
│ │ Explicit param passing (Rule 1) │
│ ▼ │
├─────────────────────────────────────────────────────────────────────┤
│ User Interaction Layer │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ Natural Language Commands / CLI Arguments │ │
│ │ (NPU health check, temperature, firmware upgrade) │ │
│ └────────────────────────────┬────────────────────────────────┘ │
│ │ │
│ ▼ │
├─────────────────────────────────────────────────────────────────────┤
│ Skill Core Components (Stateless (Rule 2)) │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Command Executor│←→│ NPU Client │←→│ Trend Recorder │ │
│ │ - NL Parsing │ │ - npu-smi cmd │ │ - Metric Log │ │
│ │ - Command Route│ │ - Local/SSH │ │ - Trend Analysis│ │
│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
│ │ │ │
│ ▼ ▼ │
├─────────────────────────────────────────────────────────────────────┤
│ Huawei Cloud Ascend Infrastructure │
│ Data Flow: Agent → Skill(host,user,pwd) → SSH → npu-smi → Response │
└─────────────────────────────────────────────────────────────────────┘User request: "Query NPU status on 116.204.23.145"
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Agent parses intent │
│ - Keyword "NPU" → Match ascend-command │
│ - IP address → SSH params needed │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Agent prepares params (explicit, Rule 1) │
│ --host 116.204.23.145 │
│ --user root │
│ --password *** │
│ --command "NPU list" │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Skill executes (Stateless, Rule 2) │
│ - NpuClient(host, user, password) explicit receive │
│ - Execute npu-smi command │
│ - Return result │
└─────────────────────────────────────────────────────────────┘
│
▼
Return to user| Skill | Purpose | Orchestration Scenario |
|---|---|---|
| SSH remote ops | Agent selects when user needs disk/Docker/logs |
| NPU management | Alternative impl, Agent selects by scenario |
| Model deploy | Use ascend-command to monitor NPU after deploy |
Prerequisite check: Python3 requiredbashpython3 --version # Python3 >= 3.8
Security rules (must be followed):
- Prohibited from reading, echoing, or printing password values
- Prohibited from asking the user to input passwords directly in the conversation
- Only allowed to read credentials from command line arguments
| Parameter | Required | Description |
|---|---|---|
| command | Yes (one-shot) | Natural language command to execute |
| host | No | SSH remote host IP address |
| user | No | SSH username |
| password | No | SSH password |
python3 scripts/main.py --command "NPU health check"python3 scripts/main.py --command "NPU list" --host 192.168.1.100 --user root --password xxxpython3 scripts/main.pyList all NPU devices
NPU health check
Get NPU temperature
Get NPU power usage
Get NPU memory infoSet ECC mode
Set fan modeQuery firmware version
Upgrade firmwareQuery vNPU info
Create vNPURun FLOPS test
Run FP32 FLOPS test
Run multi-device FLOPS test{
"status": "success",
"command": "npu-smi info -l",
"description": "List all NPU devices"
}[ERROR] <error-code>
Message: <error-description>
Suggestion: <troubleshooting-tip>python3 --version # Verify Python 3.8+python3 scripts/main.py --command "NPU list"python3 scripts/main.py --host <ascend-ip> --user root --password <pwd> --command "NPU health check"| Test Case | Expected Output |
|---|---|
| Environment check | Python version >= 3.8 |
| Local command | NPU device information or "npu-smi not found" |
| Remote command | NPU status from remote server |
handle_command(text)confirm_sensitive()list_devices()get_health()get_temperature()get_power()get_memory()set_ecc_enable()upgrade_query()create_vnpu()get_tls_cert()| Natural Language | Command | Description |
|---|---|---|
| List all NPU devices | | List all NPU devices |
| NPU card info | | Card and chip mapping |
| NPU info | | Full NPU information |
| Natural Language | Command | Description |
|---|---|---|
| NPU health check | | Check device health |
| Check NPU status | | Check device health |
| Natural Language | Command | Description |
|---|---|---|
| NPU temperature | | Get temperature |
| NPU power | | Get power usage |
| NPU memory | | Get memory info |
| NPU utilization | | Get utilization |
| Natural Language | Command | Description |
|---|---|---|
| Set ECC | | Enable ECC (requires confirmation) |
| Set fan mode | | Set fan mode (requires confirmation) |
| Natural Language | Command | Description |
|---|---|---|
| Firmware version | | Query firmware version |
| Upgrade firmware | | Upload firmware (requires confirmation) |
| Natural Language | Command | Description |
|---|---|---|
| vNPU info | | Query vNPU info |
| Template info | | Query template info |
| Create vNPU | | Create vNPU (requires confirmation) |
| Natural Language | Command | Description |
|---|---|---|
| Certificate info | | View TLS certificate |
| Certificate expiration | | Query certificate expiration threshold |
| Natural Language | Command | Description |
|---|---|---|
| FLOPS test | | Default: NPU 0, FP16 |
| NPU FLOPS | | Same as above |
| NPU 3 FLOPS | | Specify NPU 3 |
| FP32 FLOPS | | FP32 precision |
| All devices FLOPS | 8 devices async parallel | All NPUs tested simultaneously |
| Optimization | Description | Effect |
|---|---|---|
| SSH persistent connection | ControlMaster reuse | Connection time ~0.1s |
| Batch execution | | Reduce SSH round trips |
| Parallel query | | 16s -> 2s |
| Single parse | | O(N) -> O(1) |
npu-smi infonpu-smi info -t board -i <npu_id>huawei-cloud-ascend-command/
├── SKILL.md # Skill description (required)
├── scripts/ # Scripts directory (required)
│ ├── __init__.py # Module export
│ ├── main.py # Skill entry file (required)
│ ├── executor.py # NPU command executor
│ └── npu_client.py # NPU client
└── references/ # Reference documentation
├── acceptance-criteria.md # Acceptance criteria
├── verification-method.md # Verification steps
├── troubleshooting.md # Troubleshooting guide
├── device-queries.md # Device queries reference
├── configuration.md # Configuration reference
├── firmware-upgrade.md # Firmware upgrade reference
├── virtualization.md # Virtualization reference
└── certificate-management.md # Certificate management| Document | Description |
|---|---|
| acceptance-criteria.md | Acceptance criteria for skill validation |
| verification-method.md | Verification steps and test methods |
| troubleshooting.md | Troubleshooting guide and common issues |
| device-queries.md | Device queries command reference |
| configuration.md | Configuration management reference |
| firmware-upgrade.md | Firmware upgrade reference |
| virtualization.md | Virtualization management reference |
| certificate-management.md | Certificate management reference |