Provides Huawei Ascend NPU natural language command translation and execution. Supports full npu-smi commands: device queries, configuration management, firmware upgrade, vNPU virtualization, certificate management, and compute power testing.
Overview
This skill provides natural language management for Huawei Ascend NPU devices via npu-smi commands. Supports both local direct execution and SSH remote modes.
Related Skills:
huawei-cloud-ascend-remote-connect - General SSH remote operations (disk, Docker, logs, processes)
npu-smi-skill - Alternative NPU management implementation
model-deploy-test-skill - Model deployment and testing on Ascend DevServer
Capabilities:
- Device queries (health, temperature, power, HBM, ECC, topology)
- Configuration management (ECC, fan mode, fan speed)
- Firmware upgrade and status
- vNPU virtualization
- Certificate management
- Compute power testing (FLOPS)
Architecture
System Architecture Diagram
┌─────────────────────────────────────────────────────────────────────┐
│ 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 │
└─────────────────────────────────────────────────────────────────────┘
Agent Orchestration Flow
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
Related Skills (Agent orchestrated, no direct call, Rule 3)
| Skill |
Purpose |
Orchestration Scenario |
huawei-cloud-ascend-remote-connect |
SSH remote ops |
Agent selects when user needs disk/Docker/logs |
npu-smi-skill |
NPU management |
Alternative impl, Agent selects by scenario |
model-deploy-test-skill |
Model deploy |
Use ascend-command to monitor NPU after deploy |
Note: No direct calls between Skills, orchestrated by Agent based on user intent.
Prerequisites
System Requirements
- Python 3.8+
- Pure Python standard library implementation, no additional dependencies required
Environment Check
Prerequisite check: Python3 required
python3 --version # Python3 >= 3.8
Authentication
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 Confirmation
Input Parameters
| 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 |
Confirmation Requirements
The following operations require explicit user confirmation:
- ECC enable/disable
- Fan mode changes
- Firmware upgrade
- vNPU creation/deletion
- Certificate management
Core Workflow
Task 1: One-Shot Command Execution
python3 scripts/main.py --command "NPU health check"
Task 2: SSH Remote Execution
python3 scripts/main.py --command "NPU list" --host 192.168.1.100 --user root --password xxx
Task 3: Interactive Mode
python3 scripts/main.py
Usage Instructions
Device Queries
List all NPU devices
NPU health check
Get NPU temperature
Get NPU power usage
Get NPU memory info
Configuration Management
Set ECC mode
Set fan mode
Firmware Upgrade
Query firmware version
Upgrade firmware
Virtualization
Query vNPU info
Create vNPU
FLOPS Test
Run FLOPS test
Run FP32 FLOPS test
Run multi-device FLOPS test
Output Format
Standard Response Format
All command outputs follow a structured format:
{
"status": "success",
"command": "npu-smi info -l",
"description": "List all NPU devices"
}
Error Response Format
[ERROR] <error-code>
Message: <error-description>
Suggestion: <troubleshooting-tip>
Verification Method
Basic Verification Steps
Environment Check
python3 --version # Verify Python 3.8+
Local Command Test
python3 scripts/main.py --command "NPU list"
Remote Command Test
python3 scripts/main.py --host <ascend-ip> --user root --password <pwd> --command "NPU health check"
Expected Results
| 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 |
Script Files
Entry File
- main.py: Skill entry file (required)
- Function: Provide interactive mode, one-shot mode, SSH remote mode
- Supports: Command line arguments, interactive prompt
Core Scripts
Command Translation Mapping
Device Queries
| Natural Language |
Command |
Description |
| List all NPU devices |
npu-smi info -l |
List all NPU devices |
| NPU card info |
npu-smi info -m |
Card and chip mapping |
| NPU info |
npu-smi info |
Full NPU information |
Health Check
| Natural Language |
Command |
Description |
| NPU health check |
npu-smi info -t health -i 0 |
Check device health |
| Check NPU status |
npu-smi info -t health -i 0 |
Check device health |
Temperature/Power/Memory
| Natural Language |
Command |
Description |
| NPU temperature |
npu-smi info -t temp -i 0 -c 0 |
Get temperature |
| NPU power |
npu-smi info -t power -i 0 -c 0 |
Get power usage |
| NPU memory |
npu-smi info -t memory -i 0 -c 0 |
Get memory info |
| NPU utilization |
npu-smi info -t usages -i 0 -c 0 |
Get utilization |
Configuration
| Natural Language |
Command |
Description |
| Set ECC |
npu-smi set -t ecc-enable -i 0 -c 0 -d 1 |
Enable ECC (requires confirmation) |
| Set fan mode |
npu-smi set -t pwm-mode -d 0 |
Set fan mode (requires confirmation) |
Firmware Upgrade
| Natural Language |
Command |
Description |
| Firmware version |
npu-smi upgrade -b mcu -i 0 |
Query firmware version |
| Upgrade firmware |
npu-smi upgrade -t mcu -i 0 -f file.hpm |
Upload firmware (requires confirmation) |
Virtualization
| Natural Language |
Command |
Description |
| vNPU info |
npu-smi info -t info-vnpu -i 0 -c 0 |
Query vNPU info |
| Template info |
npu-smi info -t template-info -i 0 |
Query template info |
| Create vNPU |
npu-smi set -t create-vnpu -i 0 -c 0 -f vir04 |
Create vNPU (requires confirmation) |
Certificate Management
| Natural Language |
Command |
Description |
| Certificate info |
npu-smi info -t tls-cert -i 0 -c 0 |
View TLS certificate |
| Certificate expiration |
npu-smi info -t tls-cert-period -i 0 -c 0 |
Query certificate expiration threshold |
FLOPS Test (ascend-dmi)
Default behavior: single device FP16, fast return (~2 seconds)
| Natural Language |
Command |
Description |
| FLOPS test |
ascend-dmi -f -d 0 -t fp16 -q |
Default: NPU 0, FP16 |
| NPU FLOPS |
ascend-dmi -f -d 0 -t fp16 -q |
Same as above |
| NPU 3 FLOPS |
ascend-dmi -f -d 3 -t fp16 -q |
Specify NPU 3 |
| FP32 FLOPS |
ascend-dmi -f -d 0 -t fp32 -q |
FP32 precision |
| All devices FLOPS |
8 devices async parallel |
All NPUs tested simultaneously |
Execution strategy:
- Single device: Direct execution, ~2 seconds return
- Multi-device: Async parallel execution, total ~2 seconds (not serial 16 seconds)
- Precision: Default fp16, supports fp32/bf16/int8/hf32
Performance Optimization
| Optimization |
Description |
Effect |
| SSH persistent connection |
ControlMaster reuse |
Connection time ~0.1s |
| Batch execution |
execute_batch() for multiple commands |
Reduce SSH round trips |
| Parallel query |
test_flops_parallel() 8-device async test |
16s -> 2s |
| Single parse |
parse_full_info() get all card info at once |
O(N) -> O(1) |
Troubleshooting
Command Not Recognized
- Check if input contains supported keywords
- Try using more explicit commands
SSH Connection Failed
- Verify SSH parameters are correct
- Ensure SSH service is running on target machine
npu-smi Not Available
- Ensure CANN and npu-smi are installed on target machine
- Check LD_LIBRARY_PATH environment variable
Notes
Security Warnings
- Sensitive operations require user confirmation before execution
- Passwords are only stored in memory during session
- Blocked commands cannot be bypassed
Limitations
- Requires npu-smi or ascend-dmi installed on target machine
- SSH password authentication only (no interactive password prompt)
Best Practices
Best Practices
Connection Mode Selection
- Local direct: For NPU installed on local machine
- SSH remote: For managing remote Ascend servers
Command Execution Tips
- Sensitive ops (firmware upgrade, config change) require user confirmation
- Test on single card before batch operations
Performance Monitoring
- Regularly check NPU temperature and power
- Monitor HBM usage to avoid OOM
Troubleshooting
- First check NPU health:
npu-smi info
- View detailed error log:
npu-smi info -t board -i <npu_id>
- See troubleshooting.md
Trigger Keywords
- Chinese: NPU, 昇腾, 显存, 算力, 温度, 功耗, 固件, 虚拟化
- English: npu, ascend, temperature, power, HBM, firmware, vNPU, FLOPS
Directory Structure
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
References
| 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 |
Technical Support
1---
2name: huawei-cloud-ascend-command
3description: |
4 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.
5 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.
6 Trigger: user mentionsnpu', 'ascend', 'NPU', 'Ascend', 'temperature', 'power', 'HBM', 'firmware', 'upgrade', 'vNPU', 'virtualization', 'certificate', 'FLOPS', 'compute', 'health', 'memory', 'utilization', 'ECC', 'fan', '昇腾', '昇腾卡', '昇腾状态', '显存', '算力', '设备查询', 'NPU监控'"
7version: 1.0.0
8tags: [huawei-cloud, ascend, npu, npu-smi, remote]
9allowed-tools:
10 - python3
11 - bash
12 - ssh
13---
14
15Provides Huawei Ascend NPU natural language command translation and execution. Supports full npu-smi commands: device queries, configuration management, firmware upgrade, vNPU virtualization, certificate management, and compute power testing.
16
17## Overview
18
19This skill provides natural language management for Huawei Ascend NPU devices via npu-smi commands. Supports both local direct execution and SSH remote modes.
20
21**Related Skills**:
22- `huawei-cloud-ascend-remote-connect` - General SSH remote operations (disk, Docker, logs, processes)
23- `npu-smi-skill` - Alternative NPU management implementation
24- `model-deploy-test-skill` - Model deployment and testing on Ascend DevServer
25
26**Capabilities**:
27- Device queries (health, temperature, power, HBM, ECC, topology)
28- Configuration management (ECC, fan mode, fan speed)
29- Firmware upgrade and status
30- vNPU virtualization
31- Certificate management
32- Compute power testing (FLOPS)
33
34## Architecture
35
36### System Architecture Diagram
37
38```
39┌─────────────────────────────────────────────────────────────────────┐
40│ Agent Orchestration │
41│ ┌─────────────────────────────────────────────────────────────┐ │
42│ │ 1. Parse user intent → Match Trigger keywords │ │
43│ │ 2. Prepare params → host, user, password explicit │ │
44│ │ 3. Invoke Skill → skill exec --name ascend-command │ │
45│ │ 4. Return result → User │ │
46│ └────────────────────────────┬────────────────────────────────┘ │
47│ │ Explicit param passing (Rule 1) │
48│ ▼ │
49├─────────────────────────────────────────────────────────────────────┤
50│ User Interaction Layer │
51│ ┌─────────────────────────────────────────────────────────────┐ │
52│ │ Natural Language Commands / CLI Arguments │ │
53│ │ (NPU health check, temperature, firmware upgrade) │ │
54│ └────────────────────────────┬────────────────────────────────┘ │
55│ │ │
56│ ▼ │
57├─────────────────────────────────────────────────────────────────────┤
58│ Skill Core Components (Stateless (Rule 2)) │
59│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
60│ │ Command Executor│←→│ NPU Client │←→│ Trend Recorder │ │
61│ │ - NL Parsing │ │ - npu-smi cmd │ │ - Metric Log │ │
62│ │ - Command Route│ │ - Local/SSH │ │ - Trend Analysis│ │
63│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
64│ │ │ │
65│ ▼ ▼ │
66├─────────────────────────────────────────────────────────────────────┤
67│ Huawei Cloud Ascend Infrastructure │
68│ Data Flow: Agent → Skill(host,user,pwd) → SSH → npu-smi → Response │
69└─────────────────────────────────────────────────────────────────────┘
70```
71
72### Agent Orchestration Flow
73
74```
75User request: "Query NPU status on 116.204.23.145"
76 │
77 ▼
78┌─────────────────────────────────────────────────────────────┐
79│ Agent parses intent │
80│ - Keyword "NPU" → Match ascend-command │
81│ - IP address → SSH params needed │
82└─────────────────────────────────────────────────────────────┘
83 │
84 ▼
85┌─────────────────────────────────────────────────────────────┐
86│ Agent prepares params (explicit, Rule 1) │
87│ --host 116.204.23.145 │
88│ --user root │
89│ --password *** │
90│ --command "NPU list" │
91└─────────────────────────────────────────────────────────────┘
92 │
93 ▼
94┌─────────────────────────────────────────────────────────────┐
95│ Skill executes (Stateless, Rule 2) │
96│ - NpuClient(host, user, password) explicit receive │
97│ - Execute npu-smi command │
98│ - Return result │
99└─────────────────────────────────────────────────────────────┘
100 │
101 ▼
102 Return to user
103```
104
105### Related Skills (Agent orchestrated, no direct call, Rule 3)
106
107| Skill | Purpose | Orchestration Scenario |
108|-------|------|----------|
109| `huawei-cloud-ascend-remote-connect` | SSH remote ops | Agent selects when user needs disk/Docker/logs |
110| `npu-smi-skill` | NPU management | Alternative impl, Agent selects by scenario |
111| `model-deploy-test-skill` | Model deploy | Use ascend-command to monitor NPU after deploy |
112
113**Note**: No direct calls between Skills, orchestrated by Agent based on user intent.
114
115## Prerequisites
116
117### System Requirements
118
119- Python 3.8+
120- Pure Python standard library implementation, no additional dependencies required
121
122### Environment Check
123
124> **Prerequisite check: Python3 required**
125> ```bash
126> python3 --version # Python3 >= 3.8
127> ```
128
129## Authentication
130
131> **Security rules (must be followed):**
132> - **Prohibited** from reading, echoing, or printing password values
133> - **Prohibited** from asking the user to input passwords directly in the conversation
134> - **Only allowed** to read credentials from command line arguments
135
136## Parameter Confirmation
137
138### Input Parameters
139
140| Parameter | Required | Description |
141|-----------|----------|-------------|
142| command | Yes (one-shot) | Natural language command to execute |
143| host | No | SSH remote host IP address |
144| user | No | SSH username |
145| password | No | SSH password |
146
147### Confirmation Requirements
148
149The following operations require explicit user confirmation:
150- ECC enable/disable
151- Fan mode changes
152- Firmware upgrade
153- vNPU creation/deletion
154- Certificate management
155
156## Core Workflow
157
158### Task 1: One-Shot Command Execution
159
160```bash
161python3 scripts/main.py --command "NPU health check"
162```
163
164### Task 2: SSH Remote Execution
165
166```bash
167python3 scripts/main.py --command "NPU list" --host 192.168.1.100 --user root --password xxx
168```
169
170### Task 3: Interactive Mode
171
172```bash
173python3 scripts/main.py
174```
175
176## Usage Instructions
177
178### Device Queries
179
180```
181List all NPU devices
182NPU health check
183Get NPU temperature
184Get NPU power usage
185Get NPU memory info
186```
187
188### Configuration Management
189
190```
191Set ECC mode
192Set fan mode
193```
194
195### Firmware Upgrade
196
197```
198Query firmware version
199Upgrade firmware
200```
201
202### Virtualization
203
204```
205Query vNPU info
206Create vNPU
207```
208
209### FLOPS Test
210
211```
212Run FLOPS test
213Run FP32 FLOPS test
214Run multi-device FLOPS test
215```
216
217---
218
219## Output Format
220
221### Standard Response Format
222
223All command outputs follow a structured format:
224
225```json
226{
227 "status": "success",
228 "command": "npu-smi info -l",
229 "description": "List all NPU devices"
230}
231```
232
233### Error Response Format
234
235```
236[ERROR] <error-code>
237Message: <error-description>
238Suggestion: <troubleshooting-tip>
239```
240
241---
242
243## Verification Method
244
245### Basic Verification Steps
246
2471. **Environment Check**
248 ```bash
249 python3 --version # Verify Python 3.8+
250 ```
251
2522. **Local Command Test**
253 ```bash
254 python3 scripts/main.py --command "NPU list"
255 ```
256
2573. **Remote Command Test**
258 ```bash
259 python3 scripts/main.py --host <ascend-ip> --user root --password <pwd> --command "NPU health check"
260 ```
261
262### Expected Results
263
264| Test Case | Expected Output |
265|-----------|----------------|
266| Environment check | Python version >= 3.8 |
267| Local command | NPU device information or "npu-smi not found" |
268| Remote command | NPU status from remote server |
269
270---
271
272## Script Files
273
274### Entry File
275
276- **main.py**: Skill entry file (required)
277 - Function: Provide interactive mode, one-shot mode, SSH remote mode
278 - Supports: Command line arguments, interactive prompt
279
280### Core Scripts
281
282- **executor.py**: NPU command executor (main entry)
283 - Function: Natural language parsing, command routing, sensitive operation confirmation
284 - Supported commands: Device queries, configuration, firmware upgrade, virtualization, certificate management
285 - Core methods: `handle_command(text)`, `confirm_sensitive()`
286
287- **npu_client.py**: NPU client
288 - Function: Wraps npu-smi command execution, supports local and SSH remote execution
289 - Core methods: `list_devices()`, `get_health()`, `get_temperature()`, `get_power()`, `get_memory()`, `set_ecc_enable()`, `upgrade_query()`, `create_vnpu()`, `get_tls_cert()`
290 - Optimization: SSH ControlMaster, batch execution, parallel FLOPS testing
291
292---
293
294## Command Translation Mapping
295
296### Device Queries
297
298| Natural Language | Command | Description |
299|-----------------|---------|-------------|
300| List all NPU devices | `npu-smi info -l` | List all NPU devices |
301| NPU card info | `npu-smi info -m` | Card and chip mapping |
302| NPU info | `npu-smi info` | Full NPU information |
303
304### Health Check
305
306| Natural Language | Command | Description |
307|-----------------|---------|-------------|
308| NPU health check | `npu-smi info -t health -i 0` | Check device health |
309| Check NPU status | `npu-smi info -t health -i 0` | Check device health |
310
311### Temperature/Power/Memory
312
313| Natural Language | Command | Description |
314|-----------------|---------|-------------|
315| NPU temperature | `npu-smi info -t temp -i 0 -c 0` | Get temperature |
316| NPU power | `npu-smi info -t power -i 0 -c 0` | Get power usage |
317| NPU memory | `npu-smi info -t memory -i 0 -c 0` | Get memory info |
318| NPU utilization | `npu-smi info -t usages -i 0 -c 0` | Get utilization |
319
320### Configuration
321
322| Natural Language | Command | Description |
323|-----------------|---------|-------------|
324| Set ECC | `npu-smi set -t ecc-enable -i 0 -c 0 -d 1` | Enable ECC (requires confirmation) |
325| Set fan mode | `npu-smi set -t pwm-mode -d 0` | Set fan mode (requires confirmation) |
326
327### Firmware Upgrade
328
329| Natural Language | Command | Description |
330|-----------------|---------|-------------|
331| Firmware version | `npu-smi upgrade -b mcu -i 0` | Query firmware version |
332| Upgrade firmware | `npu-smi upgrade -t mcu -i 0 -f file.hpm` | Upload firmware (requires confirmation) |
333
334### Virtualization
335
336| Natural Language | Command | Description |
337|-----------------|---------|-------------|
338| vNPU info | `npu-smi info -t info-vnpu -i 0 -c 0` | Query vNPU info |
339| Template info | `npu-smi info -t template-info -i 0` | Query template info |
340| Create vNPU | `npu-smi set -t create-vnpu -i 0 -c 0 -f vir04` | Create vNPU (requires confirmation) |
341
342### Certificate Management
343
344| Natural Language | Command | Description |
345|-----------------|---------|-------------|
346| Certificate info | `npu-smi info -t tls-cert -i 0 -c 0` | View TLS certificate |
347| Certificate expiration | `npu-smi info -t tls-cert-period -i 0 -c 0` | Query certificate expiration threshold |
348
349### FLOPS Test (ascend-dmi)
350
351**Default behavior: single device FP16, fast return (~2 seconds)**
352
353| Natural Language | Command | Description |
354|-----------------|---------|-------------|
355| FLOPS test | `ascend-dmi -f -d 0 -t fp16 -q` | Default: NPU 0, FP16 |
356| NPU FLOPS | `ascend-dmi -f -d 0 -t fp16 -q` | Same as above |
357| NPU 3 FLOPS | `ascend-dmi -f -d 3 -t fp16 -q` | Specify NPU 3 |
358| FP32 FLOPS | `ascend-dmi -f -d 0 -t fp32 -q` | FP32 precision |
359| All devices FLOPS | 8 devices async parallel | All NPUs tested simultaneously |
360
361**Execution strategy:**
362- **Single device**: Direct execution, ~2 seconds return
363- **Multi-device**: Async parallel execution, total ~2 seconds (not serial 16 seconds)
364- **Precision**: Default fp16, supports fp32/bf16/int8/hf32
365
366---
367
368## Performance Optimization
369
370| Optimization | Description | Effect |
371|-------------|-------------|--------|
372| SSH persistent connection | ControlMaster reuse | Connection time ~0.1s |
373| Batch execution | `execute_batch()` for multiple commands | Reduce SSH round trips |
374| Parallel query | `test_flops_parallel()` 8-device async test | 16s -> 2s |
375| Single parse | `parse_full_info()` get all card info at once | O(N) -> O(1) |
376
377---
378
379## Troubleshooting
380
381### Command Not Recognized
382- Check if input contains supported keywords
383- Try using more explicit commands
384
385### SSH Connection Failed
386- Verify SSH parameters are correct
387- Ensure SSH service is running on target machine
388
389### npu-smi Not Available
390- Ensure CANN and npu-smi are installed on target machine
391- Check LD_LIBRARY_PATH environment variable
392
393---
394
395## Notes
396
397### Security Warnings
398
399- Sensitive operations require user confirmation before execution
400- Passwords are only stored in memory during session
401- Blocked commands cannot be bypassed
402
403### Limitations
404
405- Requires npu-smi or ascend-dmi installed on target machine
406- SSH password authentication only (no interactive password prompt)
407
408---
409
410
411## Best Practices
412
413### Best Practices
414
4151. **Connection Mode Selection**
416 - Local direct: For NPU installed on local machine
417 - SSH remote: For managing remote Ascend servers
418
4192. **Command Execution Tips**
420 - Sensitive ops (firmware upgrade, config change) require user confirmation
421 - Test on single card before batch operations
422
4233. **Performance Monitoring**
424 - Regularly check NPU temperature and power
425 - Monitor HBM usage to avoid OOM
426
4274. **Troubleshooting**
428 - First check NPU health: `npu-smi info`
429 - View detailed error log: `npu-smi info -t board -i <npu_id>`
430 - See [troubleshooting.md](references/troubleshooting.md)
431
4325. **Trigger Keywords**
433 - Chinese: NPU, 昇腾, 显存, 算力, 温度, 功耗, 固件, 虚拟化
434 - English: npu, ascend, temperature, power, HBM, firmware, vNPU, FLOPS
435
436## Directory Structure
437
438```
439huawei-cloud-ascend-command/
440├── SKILL.md # Skill description (required)
441├── scripts/ # Scripts directory (required)
442│ ├── __init__.py # Module export
443│ ├── main.py # Skill entry file (required)
444│ ├── executor.py # NPU command executor
445│ └── npu_client.py # NPU client
446└── references/ # Reference documentation
447 ├── acceptance-criteria.md # Acceptance criteria
448 ├── verification-method.md # Verification steps
449 ├── troubleshooting.md # Troubleshooting guide
450 ├── device-queries.md # Device queries reference
451 ├── configuration.md # Configuration reference
452 ├── firmware-upgrade.md # Firmware upgrade reference
453 ├── virtualization.md # Virtualization reference
454 └── certificate-management.md # Certificate management
455```
456
457## References
458
459| Document | Description |
460|----------|-------------|
461| [acceptance-criteria.md](references/acceptance-criteria.md) | Acceptance criteria for skill validation |
462| [verification-method.md](references/verification-method.md) | Verification steps and test methods |
463| [troubleshooting.md](references/troubleshooting.md) | Troubleshooting guide and common issues |
464| [device-queries.md](references/device-queries.md) | Device queries command reference |
465| [configuration.md](references/configuration.md) | Configuration management reference |
466| [firmware-upgrade.md](references/firmware-upgrade.md) | Firmware upgrade reference |
467| [virtualization.md](references/virtualization.md) | Virtualization management reference |
468| [certificate-management.md](references/certificate-management.md) | Certificate management reference |
469
470## Technical Support
471
472- Ascend Official Documentation: https://www.hiascend.com/document
473- npu-smi Command Reference: https://www.hiascend.com/document/detail/zh/Atlas%20200I%20A2/260RC1/re/npu/npusmi_007.html