huaweicloud/huaweicloud-skills/huawei-cloud-ascend-small-model-migrate
Claude Code and agent skill by huaweicloud/huaweicloud-skills
- community
Checking that the SKILL.md file is still in the repository.
Migrate vision/detection/segmentation small models to Ascend NPU, covering the full workflow: model structure analysis, migration verification, performance profiling, and optimization. Based on torch_npu and msprof Use this skill when the user wants to: (1) migrate encoder-only models like ResNet, YOLO, UNet to Ascend NPU, (2) analyze model structure for migration feasibility, (3) verify model inference on NPU, (4) identify performance bottlenecks and get optimization suggestions Trigger: user mentions "migrate", "migration", "Ascend", "NPU", "YOLO", "ResNet", "encoder-only", "detection", "segmentation", "adaptation", "adapt", "迁移", "昇腾迁移", "小模型", "适配", "昇腾适配", "GPU迁移", "NPU适配", "适配NPU", "适配昇腾"
Install
npx vskill@latest install huaweicloud/huaweicloud-skills/huawei-cloud-ascend-small-model-migrateSKILL.md
The same SKILL.md was published earlier as huaweicloud/huaweicloud-skills/huawei-cloud-ascend-small-model-migrate.
Huawei Cloud Ascend Small Model Migration
Overview
This skill guides the migration workflow for small vision models to Ascend NPU, covering structure analysis → migration verification → performance optimization.
Architecture: Model Analysis → Environment Setup → NPU Inference → Performance Profiling → Bottleneck Analysis → Optimization Recommendations
Related Skills:
huawei-cloud-msmodelslim-model-analysis- Model structure analysis for migration path determinationhuawei-cloud-msot-msopprof-operator-profiler- Operator performance data collectionhuawei-cloud-ascend-profiler-db-explorer- Profiling database analysis for bottleneck identificationhuawei-cloud-ascendc-operator-performance-optim- Optional: AscendC operator optimization for bottleneck operators
Architecture Components
This skill involves the following cloud services and components:
- Ascend NPU: Target hardware for model deployment (Ascend 910B series)
- torch_npu: PyTorch adapter for Ascend NPU
- MSProf: Ascend profiling tool for performance analysis
- Ultralytics: YOLO model framework support
- Docker: Container environment for consistent deployment
Use Cases
Typical Problem Scenarios:
- Migrating vision models from GPU to Ascend NPU
- Deploying YOLO/ResNet/UNet models on Ascend hardware
- Optimizing small model performance on NPU
- Verifying model accuracy after migration
- Identifying performance bottlenecks in computer vision models
Typical User Phrases:
- "Migrate YOLOv8 to Ascend NPU
- "How to run ResNet on Ascend?
- "Optimize UNet inference on NPU
- "Verify model accuracy after migration
- "Analyze performance bottlenecks in my vision model
- "YOLOModelMigrationAscendNPU
- "AscendModel?
- "ModelMigrationNPU?
Scope
Supported:
- Encoder-only architectures (ResNet, VGG, EfficientNet)
- Detection models (YOLO, Faster-RCNN, SSD)
- Segmentation models (UNet, DeepLab)
- Other non-Decoder-only LLM models
Not supported:
- Decoder-only LLM (Qwen, LLaMA, DeepSeek) - requires adapter-based quantization approach
- Understanding VLM text backbone - requires adapter-based quantization approach
Workflow
Step 1: Model Structure Analysis
1.1 Analysis Process
Read the model configuration to analyze:
- Model implementation source (transformers or local directory)
- Architecture type (Decoder-only / Encoder-only / Encoder-Decoder)
- Layer-by-layer loading requirements
- MoE fused weight risks
1.2 Migration Path Determination
| Architecture Type | Recommended Path | |
|---|---|---|
| Decoder-only LLM | Adapter-based quantization | |
| Understanding VLM text backbone | Adapter-based quantization | |
| Encoder-only / Detection / Segmentation | Continue with this skill | |
| Other | Manual determination required |
1.3 Output Analysis Report
Step 2: Environment Preparation + Migration Verification
2.1 Default Verification Environment
- Server: ascend-server-01
- Container: skill-the
- Image: quay.io/ascend/vllm-ascend:v0.18.0
- NPU: 8× Ascend 910B3
2.2 Environment Configuration
2.3 Migration Verification Script
2.4 Output Migration Verification Report
Step 3: Performance Data Collection
3.1 Performance Collection Process
Collect operator performance data using the profiling skill:
- On-board collection (device mode)
- Or simulation collection (simulator mode)
3.2 Output Performance Data Location
Step 4: Performance Analysis
4.1 Analysis Process
Query and analyze:
- Top N operator time consumption
- Group statistics by operator type
- AI_CPU / AI_CORE / AI_VECTOR_CORE distribution
4.2 SQL Query Example
4.3 Output Performance Analysis Report
Step 5: Optimization Suggestions
5.1 Common Bottlenecks and Solutions
| Bottleneck Type | Cause | Optimization Solution | |
|---|---|---|---|
| Index operator high time | AI_CPU implementation | Develop optimized version with AscendC | |
| TransData high time | Format conversion overhead | Reduce CPU-NPU data transfer | |
| NMS fallback to CPU | Operator not NPU supported | Develop NPU version NMS with AscendC | |
| Upsample slow | Vector core efficiency | Optimize upsample operator |
5.2 Output Optimization Suggestions Report
Complete Report Template
After completing each migration task, output a complete report:
Default Environment
- Server: ascend-server-01:22 (root/Hhuawei@smb)
- Container: skill-the
- NPU: 8× Ascend 910B3 (64G HBM each)
- CANN: cann-version-placeholder.220
Prerequisites
System Requirements
- Python 3.8+
- torch_npu >= 2.0.0
- msprof >= 7.0.0
- ultralytics >= 8.0.0 (for YOLO models)
Environment Check
Prerequisite check: Python3 + torch_npu + msprof required```bashpython3 --version # Python3 >= 3.8python3 -c "import torch_npu; print('OK')" # NPU PyTorch supportpython3 -c "import msprof; print('OK')" # Profiling library```If not installed:pip3 install --user torch_npu msprof ultralytics
Additional System Dependencies
For computer vision models:
Enhanced Features
Performance Baseline Comparison Module
This skill includes a performance baseline comparison mechanism that compares current model performance against industry-standard baselines:
Features:
- Pre-defined Baselines: Baseline data for common models (YOLOv8, ResNet50, UNet, EfficientNet) on Ascend NPU
- Delta Analysis: Generates performance gap analysis and optimization potential assessment
- Performance Ranking: Compares against similar models in the benchmark database
- Trend Analysis: Tracks performance improvements across migration iterations
Baseline Database:
| Model | Batch Size | Latency (ms) | Throughput (FPS) | Accuracy | |
|---|---|---|---|---|---|
| YOLOv8n | 32 | 2.3 | 434 | 53.1% mAP | |
| YOLOv8s | 16 | 4.8 | 208 | 60.6% mAP | |
| ResNet50 | 64 | 1.2 | 533 | 76.1% top-1 | |
| UNet | 8 | 8.5 | 94 | - |
Delta Analysis Output:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/ai/modelarts/huawei-cloud-ascend-small-model-migrate/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/huaweicloud/huaweicloud-skills/huawei-cloud-ascend-small-model-migrate)