deepep-to-cam-converter

Migrate DeepEP MoE dispatch and combine operators to CAM operators on Ascend NPU.

Updated Aug 31, 2026
One-click install
npx skills add https://github.com/DreamMacer/jiuwenswarm --skill deepep-to-cam-converter-dreammacer
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: deepep-to-cam-converter
Source: https://github.com/DreamMacer/jiuwenswarm/tree/main/resources/agent/workspace/skills/deepep-to-cam-converter
Command: npx skills add https://github.com/DreamMacer/jiuwenswarm --skill deepep-to-cam-converter-dreammacer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires torch, torch_npu, umdk_cam_op_lib, and includes references (resource) components.

What problem does it solve? Migrating Mixture of Experts (MoE) code built on DeepEP from CUDA/NCCL environments to Ascend NPU platforms requires manual operator replacement, communication backend conversion, and strict constraint validation, which is error-prone and time-consuming. ## Core Features & Use Cases - DeepEP Operator Detection: Scans code for import deep_ep and dispatch/combine calls, analyzes local dependencies and communication domain setup. - Runtime Constraint Validation: Traces actual runtime parameter values (hidden_size, top_k, num_experts) instead of relying on argparse defaults, and validates them against CAM operator constraints for A2, A3, Shmem, and fused deep moe modes. - Automated Migration: Converts NCCL to HCCL, CUDA to NPU device calls, and replaces DeepEP dispatch/combine interfaces with the corresponding umdk_cam_op_lib CAM operators, including Shmem memory management. - Use Case: Given a PyTorch MoE test script using deep_ep.Buffer for expert parallelism, the skill verifies the runtime configuration fits CAM constraints, asks the user to choose between A3 normal, Shmem, or fused deep moe modes, and rewrites the file in place for Ascend NPU execution. ## Quick Start Migrate my DeepEP-based MoE dispatch and combine code in this file to CAM operators running on Ascend NPU.

Frequently Asked Questions about deepep-to-cam-converter

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

FAQPage Schema
How do I migrate DeepEP MoE code to Ascend NPU?▼

Replace deep_ep dispatch and combine calls with CAM operators from umdk_cam_op_lib, convert the NCCL backend to HCCL, and change CUDA device calls to NPU equivalents. The skill validates runtime parameters against CAM constraints before performing in-place replacement.

What is the difference between CAM A2, A3, and Shmem operators?▼

A2 operators run only on Ascend A2 with num_ranks fixed at 16 and no shared experts. A3 operators support 2-384 ranks on A3 hardware. Shmem operators use shared memory communication on A3 with specific rank counts like 8, 16, 32, up to 288, offering better performance but requiring Shmem initialization.

Does CAM support DeepEP low latency mode and async events?▼

No, CAM does not support low latency mode, fine-grained tuning configs like num_sms or buffer_size, or Event-based async control flow. The skill flags these as unsupported and asks whether to retain, delete, or stop replacing the affected code.

What constraints must my MoE configuration satisfy for CAM operators?▼

Constraints vary by mode: top_k within (0, 16], num_experts up to 512 and divisible by num_ranks, hidden_size up to 7168 and divisible by 32. The skill traces actual runtime values rather than argparse defaults to validate these constraints.

When should I use the fused deep moe operator instead of dispatch and combine?▼

Use fused deep moe on A3 for MoE decode when your code matches the Dispatch plus FFN (GMM1, Swiglu, GMM2) plus Combine pattern. It fuses communication and computation into one operator but requires strict constraints like batch size up to 256 and top_k up to 12.