external-gitcode-ascend-model-migration
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "external-gitcode-ascend-model-migration" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-397d61bfdb7e0d87898673d0abc9cc667fd2b20a8039083fd3938501de51e37a. Verify the upstream source and version against https://github.com/ascend-ai-coding/awesome-ascend-skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Model migration skill for Ascend NPU. Invoked when a user needs to clone and migrate model code for Ascend NPU.
Introduction source: third_party · ascend-ai-coding · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Model code migration for Ascend NPU. Invoke when user needs to clone
- Software, accounts and paid services
- ```bash
- Testing
- Not tested
Browse files
Frontmatter
name: external-gitcode-ascend-model-migration
description: Model code migration for Ascend NPU. Invoke when user needs to clone
open-source repo and apply NPU adaptation patches.
original-name: model-migration
synced-from: https://gitcode.com/Ascend/agent-skills
synced-date: '2026-05-26'
synced-commit: 1f7666e7768a0ceb21bb1d40ce4b5179fcb6f1d6
license: UNKNOWNModel Migration Skill
Clone open-source model repositories and apply NPU adaptation patches for Ascend NPU training.
When to Invoke
- User wants to migrate open-source model to Ascend NPU
- User needs to clone model repository
- User needs to apply DrivingSDK patches
- User asks about preparing model code for NPU training
Information to Collect
Ask user for the following:
1. Model name (e.g., BEVFormer)
2. Working directory path on server
3. Dataset path (if already prepared)
4. Pre-trained weights path (if available)
重要:DrivingSDK仓库地址为 https://gitcode.com/Ascend/DrivingSDK,包含所有必要的patch文件和训练脚本。
Workflow
Step 1: Clone Repository in DrivingSDK model_examples Directory
重要:必须在 DrivingSDK/model_examples/<model_name>/ 目录下克隆模型仓库,而不是在外部创建新目录。
# 进入DrivingSDK的model_examples目录
cd <DrivingSDK_path>/model_examples/BEVFormer
# 克隆模型仓库(会在当前目录下创建BEVFormer子目录)
git clone https://github.com/fundamentalvision/BEVFormer.git
Step 2: Copy Patch to Model Directory
# 将patch文件复制到克隆的模型目录中
cp bev_former_config.patch BEVFormer/
Step 3: Checkout Specific Commit
cd BEVFormer
git checkout 66b65f3a1f58caf0507cb2a971b9c0e7f842376c
Step 4: Apply NPU Patches
# 在模型目录内应用patch
git apply --reject --whitespace=fix bev_former_config.patch
Step 5: Setup Dataset and Weight Links
# 创建数据和权重目录
mkdir -p data ckpts
# 设置数据集软链接
ln -sf <dataset_path>/nuscenes data/nuscenes
ln -sf <dataset_path>/can_bus data/can_bus
# 设置预训练权重软链接
ln -sf <weight_path>/r101_dcn_fcos3d_pretrain.pth ckpts/
Step 6: Return to Parent Directory for Training
# 返回到model_examples/BEVFormer目录
cd ..
# 执行训练脚本
bash test/train_performance_8p_base_fp32.sh --batch-size=1 --num-npu=8
Supported Models
BEVFormer
Repository: https://github.com/fundamentalvision/BEVFormer.git
Commit: 66b65f3a1f58caf0507cb2a971b9c0e7f842376c
Patch: bev_former_config.patch
Dataset Required:
- nuscenes (processed)
- can_bus
Weights Required:
r101_dcn_fcos3d_pretrain.pth
Commands:
# 进入DrivingSDK的model_examples/BEVFormer目录
cd <DrivingSDK_path>/model_examples/BEVFormer
# 克隆BEVFormer仓库
git clone https://github.com/fundamentalvision/BEVFormer.git
# 复制patch到BEVFormer目录
cp bev_former_config.patch BEVFormer/
# 进入BEVFormer目录
cd BEVFormer
# 切换到指定commit
git checkout 66b65f3a1f58caf0507cb2a971b9c0e7f842376c
# 应用patch
git apply --reject --whitespace=fix bev_former_config.patch
# 创建数据和权重目录
mkdir -p data ckpts
# 设置数据集软链接
ln -sf <dataset_path>/nuscenes data/nuscenes
ln -sf <dataset_path>/can_bus data/can_bus
# 设置预训练权重软链接
ln -sf <weight_path>/r101_dcn_fcos3d_pretrain.pth ckpts/
# 返回上级目录执行训练
cd ..
bash test/train_performance_8p_base_fp32.sh --batch-size=1 --num-npu=8
Network Strategy
| Situation | Strategy |
|---|---|
| Server can access GitHub | Direct git clone on server |
| Server network timeout | Configure proxy or clone locally → scp to server |
| Proxy available | Configure proxy: export http_proxy=http://proxy:port |
重要:所有GitHub仓库克隆都应使用GitHub官方链接,不使用镜像站点。如果网络超时,优先配置代理。
Local Clone + SCP Transfer
If server cannot access GitHub:
# On local machine
git clone https://github.com/fundamentalvision/BEVFormer.git
cd BEVFormer
git checkout 66b65f3a1f58caf0507cb2a971b9c0e7f842376c
# Transfer to server
scp -r BEVFormer <user>@<server>:<working_directory>/
Verification
After migration, verify setup:
# Check directory structure
ls -la <model_directory>/
# Check patch applied
cd <model_directory> && git status
# Check data links
ls -la data/
ls -la ckpts/
Troubleshooting
Patch Application Fails
- Check if correct commit is checked out
- Check for
.rejfiles for manual merge - Verify patch file is for correct model version
Dataset Not Found
- Verify dataset path exists
- Check symbolic link is correct
- Ask user for correct dataset path
Weights Not Found
- Verify weight file exists
- Check weight file name matches config
- Ask user for correct weight path
Reference
- DrivingSDK model examples:
DrivingSDK/model_examples/ - Model-specific README:
DrivingSDK/model_examples/<model>/README.md
Current listing version
0.0.1
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 为昇腾NPU用户提供专业的模型代码迁移解决方案
- 解决开源模型适配NPU硬件的核心痛点
- 支持BEVFormer等主流模型的完整迁移流程
Highlights
- 触发场景描述清晰完整
- When to Invoke章节覆盖多种用户意图
- description准确描述核心功能
Areas to improve
-
缺少错误处理门控说明 Reported severity: Minor
Workflow中未明确说明各步骤失败时的处理门控
Recommendation: 在各步骤中添加前置条件检查和失败处理说明
Highlights
- Phase划分清晰,Step 1-6流程完整
- 包含端到端BEVFormer示例
- frontmatter信息完整
Areas to improve
-
缺少DrivingSDK路径存在性检查 Reported severity: Minor
未在第一步验证DrivingSDK路径是否存在
Recommendation: 在Step 1前添加路径存在性验证和错误提示
Highlights
- 工具来源明确,使用标准git命令
- 参数具体准确,包含commit hash和patch文件
- Troubleshooting章节覆盖主要异常场景
- git apply使用--reject参数处理冲突
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Invoke commands or scripts
Read the script and arguments first. Use ordinary privileges and a scoped directory; confirm installation or execution in your host tool.
Mentioned in main document · lines 92, 144
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- gitcode.com
- github.com
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
```bash
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.