shmem-ops-dev

Orchestrates end-to-end development of SHMEM communication and fused compute-communication operators on Ascend NPU.

Updated Sep 15, 2026
One-click install
npx skills add https://github.com/WangWindow/CANN-BatchMatMulMaxsum --skill shmem-ops-dev-wangwindow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shmem-ops-dev
Source: https://github.com/WangWindow/CANN-BatchMatMulMaxsum/tree/main/.agents/skills/shmem-ops-dev
Command: npx skills add https://github.com/WangWindow/CANN-BatchMatMulMaxsum --skill shmem-ops-dev-wangwindow

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Developing SHMEM-based communication operators and fused compute-communication operators for Ascend NPU involves many error-prone stages: requirement intake, design documentation, test case generation, kernel coding, compilation debugging, correctness verification, PyTorch binding, and performance benchmarking. This Skill orchestrates that entire pipeline as a gated Phase 0-7 workflow so no stage is skipped or delivered incomplete. ## Core Features & Use Cases - Phase-Gated Orchestration: Drives nine specialized sub-skills (design, testcase-gen, code-gen, compile-debug, correctness-eval, code-review, torch-bind, performance-eval, performance-optim) through strict serial phases with hard gates between each stage. - Environment & Intake Contract: Probes CANN, Docker, SHMEM_REPO, and idle NPU devices before asking users only for missing business options (Torch, performance, auto-optimization). - Fused Compute-Communication Support: Enforces dedicated gates for fused operators (CATLASS BlockMmad + SHMEM CoC), baseline selection priority (aclnn fused > stitched > metric_only), and mandatory 5-round performance optimization loops. - Use Case: A user needs a custom AllToAllV SHMEM operator with PyTorch binding and HCCL baseline comparison. The Skill confirms the environment, generates design.md and case matrix, produces and compiles the kernel, runs full correctness and 8-PE Torch tests, collects S/L-scale bandwidth and latency tables, and iterates optimization rounds until delivery. ## Quick Start Ask the agent to use the shmem-ops-dev skill to develop a new SHMEM communication operator end to end, providing the operator name, target SoC, dtype, and whether Torch binding and performance benchmarking are required.

Frequently Asked Questions about shmem-ops-dev

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

FAQPage Schema
How do I develop a SHMEM communication operator end to end on Ascend NPU?

Invoke the shmem-ops-dev skill with the operator name, SoC type, dtype, and whether Torch binding and performance benchmarking are needed. It runs a Phase 0-7 workflow covering design, test cases, code generation, compilation, correctness, Torch binding, and performance delivery.

What sub-skills does the SHMEM operator workflow orchestrate?

It coordinates nine sub-skills: shmem-ops-design, testcase-gen, code-gen, compile-debug, correctness-eval, code-review, torch-bind, performance-eval, and performance-optim. Each phase must call its designated sub-skill rather than implementing logic directly.

Does the workflow support fused compute-communication operators with MatMul?

Yes, operators with op_kind fused_compute_comm follow additional gates in fused-compute-phase-gates.md. The default compute path is CATLASS BlockMmad on AIC with a SHMEM communication epilogue on AIV in CoC mode; device-side triple-loop MatMul is forbidden as a deliverable.

Can I run the build and tests inside a Docker container?

Yes. When a container name is specified in Phase 0 intake, all compile, run, performance, and cleanup commands must execute via docker exec inside that container. Mixing host-shell and container commands in one task is prohibited.

How is performance validated against HCCL or aclnn baselines?

Phase 6 collects S and L scale cases in three separated stages: baseline first, then SHMEM, then offline comparison. The chat output must include both bandwidth and latency tables, and the default pass threshold is at least 80 percent of the baseline.

When does automatic performance optimization trigger and how many rounds run?

Phase 6.5 triggers only when performance_required and performance_auto_optim are true and Phase 6 missed its target. Once entered, it must complete max_opt_rounds rounds (default 5); reaching the target early is not a valid reason to stop.