training-migration

Migrate PyTorch training code to Ascend NPU with AMP and HCCL.

7|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/FeRhodium/ascend-migration --skill training-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: training-migration
Source: https://github.com/FeRhodium/ascend-migration/tree/main/skills/training-migration
Command: npx skills add https://github.com/FeRhodium/ascend-migration --skill training-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides the migration of CUDA-based PyTorch training code to Ascend NPU, enabling optimized training with AMP, distributed execution, and robust checkpointing.

Core Features & Use Cases

  • Training loop migration for NPU-accelerated training
  • Mixed-precision training with torch_npu AMP
  • Data loading and preprocessing optimizations for NPU
  • Distributed training setup using HCCL
  • Gradient accumulation and clipping for large batches
  • Checkpointing and resume across runs
  • Performance monitoring and profiling for Ascend

Quick Start

Begin by scanning your PyTorch project for training scripts, configure the migration workflow, and execute the migration. After migration, run the produced training code with AMP enabled, verify results with a lightweight test run, and use profiling hooks to validate performance improvements.

Frequently Asked Questions about training-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate PyTorch training code to Ascend NPU?

To migrate PyTorch training code to Ascend NPU, scan your project scripts, configure the migration workflow, and execute it to adapt training loops, data loading, and gradient management for NPU execution.

Does mixed-precision training with AMP work on Ascend NPU?

Mixed-precision training with AMP works on Ascend NPU by utilizing torch_npu autocast and GradScaler, enabling optimized memory usage and faster computation while maintaining training stability.

How do I set up distributed training using HCCL on Ascend NPU?

Distributed training using HCCL on Ascend NPU is configured by adapting existing PyTorch distributed training setups, enabling multi-device execution and gradient synchronization across the hardware cluster.

Can I use gradient accumulation and checkpointing when migrating to Ascend NPU?

Gradient accumulation, clipping, and checkpointing are explicitly supported during Ascend NPU migration, allowing you to manage large batches and resume training across runs without losing state.

What is the best way to profile PyTorch performance on Ascend NPU?

Profiling PyTorch performance on Ascend NPU is best handled by using integrated profiling hooks to run lightweight test executions, validate performance improvements, and monitor training metrics after migration.

What do I need to run PyTorch training on Ascend NPU?

To run PyTorch training on Ascend NPU, you need existing CUDA-based PyTorch training scripts and the torch_npu library to enable AMP, distributed execution via HCCL, and hardware-accelerated data loading.