skills/drivingsdk-ascend-model-migration/model-migration/SKILL.md
Model code migration for Ascend NPU. Invoke when user needs to clone open-source repo and apply NPU adaptation patches.
npx skillsauth add Ascend/agent-skills model-migrationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Clone open-source model repositories and apply NPU adaptation patches for Ascend NPU training.
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文件和训练脚本。
重要:必须在 DrivingSDK/model_examples/<model_name>/ 目录下克隆模型仓库,而不是在外部创建新目录。
# 进入DrivingSDK的model_examples目录
cd <DrivingSDK_path>/model_examples/BEVFormer
# 克隆模型仓库(会在当前目录下创建BEVFormer子目录)
git clone https://github.com/fundamentalvision/BEVFormer.git
# 将patch文件复制到克隆的模型目录中
cp bev_former_config.patch BEVFormer/
cd BEVFormer
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/
# 返回到model_examples/BEVFormer目录
cd ..
# 执行训练脚本
bash test/train_performance_8p_base_fp32.sh --batch-size=1 --num-npu=8
Repository: https://github.com/fundamentalvision/BEVFormer.git
Commit: 66b65f3a1f58caf0507cb2a971b9c0e7f842376c
Patch: bev_former_config.patch
Dataset Required:
Weights Required:
r101_dcn_fcos3d_pretrain.pthCommands:
# 进入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
| 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官方链接,不使用镜像站点。如果网络超时,优先配置代理。
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>/
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/
.rej files for manual mergeDrivingSDK/model_examples/DrivingSDK/model_examples/<model>/README.mdtesting
Kubernetes 集群健康检查与安全修复 — 诊断问题,用户确认后执行修复
tools
昇腾NPU CANN Toolkit+Kernels+NNAL安装部署技能。支持从官网下载run包安装和从Docker镜像提取两种方式,覆盖驱动检查、包下载、安装、环境变量配置与验证全流程。当用户需要安装CANN全套组件或指定版本CANN到自定义路径时调用。
development
编译 ATB (Ascend Transformer Boost) 测试框架。当用户需要编译 ATB 测试框架、 运行 CSV 测试、或构建 atb_test_framework 时调用。支持全量编译(含第三方依赖克隆与源替换) 和增量编译两种模式。需在 Docker 容器内配合 CANN 环境执行。
databases
ATB OPS→ACLNN 迁移标准化工作流主模板。整合前置学习、设计文档生成、CSV用例设计、 实际迁移、编译验证、测试验证全流程,提供明确的阶段 Gates 和用户确认机制。