torch-npu-comm-test

Benchmark and validate collective communication operations on Ascend NPUs with PyTorch.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/dongg622/china-ai-chip-skill --skill torch-npu-comm-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: torch-npu-comm-test
Source: https://github.com/dongg622/china-ai-chip-skill/tree/main/Ascend/torch-npu-comm-test
Command: npx skills add https://github.com/dongg622/china-ai-chip-skill --skill torch-npu-comm-test

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

It enables users to evaluate the performance and correctness of collective communication operators on Ascend NPUs using PyTorch's distributed API.

Core Features & Use Cases

  • Performance Benchmarking: Measure latency and bandwidth for operations like AllReduce, AllGather, ReduceScatter, and others.
  • Functional Validation: Ensure correctness of communication results via built-in validation routines.
  • Use Case: A researcher benchmarks the communication efficiency of a new cluster setup under various tensor shapes and data types, optimizing training throughput.

Quick Start

Use the tool to perform an AllReduce operation with shape 4096x12288 and dtype fp16 on 8 NPUs.

Frequently Asked Questions about torch-npu-comm-test

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

FAQPage Schema
How do I benchmark Ascend NPU communication performance using PyTorch?

To benchmark Ascend NPU communication performance, you can use this Skill to measure latency and bandwidth for collective operations like AllReduce and AllGather via PyTorch's distributed API. It requires torch, torch_npu, and a configured CANN environment.

Can I validate the correctness of collective communication operations on Ascend NPUs?

Yes, you can validate the correctness of collective communication operations on Ascend NPUs using the built-in functional validation routines provided by this Skill. It ensures communication results are accurate before proceeding with distributed training workflows.

Do I need a CANN environment setup to test distributed PyTorch operations on Ascend?

Yes, a CANN environment setup is required to test distributed PyTorch operations on Ascend hardware. The Skill depends on both torch and torch_npu to facilitate accurate benchmarking and functional testing of communication operators.

What is the best way to measure latency and bandwidth for AllReduce on multiple NPUs?

The best way to measure latency and bandwidth for AllReduce on multiple NPUs is using this Skill's benchmarking scripts to execute operations with specific tensor shapes and data types, such as an AllReduce with a 4096x12288 fp16 tensor across 8 NPUs.

How does testing NPU communication operators help optimize distributed training workflows?

Testing NPU communication operators helps optimize distributed training workflows by identifying performance bottlenecks and validating correctness. Researchers can benchmark cluster communication efficiency under various tensor shapes and data types to maximize training throughput.

Why does my NPU communication benchmark show unexpected results during cluster tuning?

Unexpected NPU communication benchmark results during cluster tuning often stem from improper CANN environment setup or incorrect tensor configurations. This Skill helps isolate issues by validating correctness and measuring performance across varying tensor shapes and data types.