当前位置: 首页 > news >正文

cann/hccl集合通信AlltoAllVC示例

Collective Communication - AlltoAllVC

【免费下载链接】hccl集合通信库(Huawei Collective Communication Library,简称HCCL)是基于昇腾AI处理器的高性能集合通信库,为计算集群提供高性能、高可靠的通信方案项目地址: https://gitcode.com/cann/hccl

Sample Description

This sample demonstrates how to use theHcclAlltoAllVC()API to perform the AlltoAllVC operation. It covers the following functions:

  • CallaclrtGetDeviceCount()to detect devices and query the number of available devices.

  • CallHcclGetRootInfo()and userank 0as the root rank to generate the rootinfo identifier.

    The rootinfo identifier contains the device IP address and device ID. This information must be broadcast to all ranks in the cluster to initialize the communicator.

  • In each thread, callHcclCommInitRootInfo()to initialize the communicator based on the rootinfo identifier.

  • CallHcclAlltoAllVC()to split the input data into a specific number of blocks along a given dimension, send the blocks sequentially to other ranks, receive data from other ranks, concatenate the received data along the specific dimension in order, and display the result.

Directory Structure

├── main.cc # Sample source file ├── Makefile # Compilation and build configuration file └── alltoallvc # Compiled executable file

Environment Preparation

Environment Requirements

This sample supports the following products in a single-server N-card configuration (N >= 2):

  • Ascend 950PR / Ascend 950DT
  • Atlas A3 Training Series Products / Atlas A3 Inference Series Products
  • Atlas A2 Training Series Products

Setting Environment Variables

# Set CANN environment variables. The following uses the root user default installation path as an example. source /usr/local/Ascend/cann/set_env.sh

Compiling and Running the Sample

Run the following commands in the sample code directory:

make make test

Note: You can set theHCCL_OP_EXPANSION_MODEenvironment variable to configure the expansion mode of communication operators. For the supported ranges for different product models, see the usage instructions for this environment variable in the Environment Variable List.

# Set the communication operator expansion mode to the AI CPU communication engine export HCCL_OP_EXPANSION_MODE=AI_CPU

Sample Output

The data of each rank is initialized to the corresponding rank ID. After the AlltoAllVC operation, the content of each node is the concatenation of the input data of all nodes.

Found 8 NPU device(s) available rankId: 0, output: [ 0 1 2 3 4 5 6 7 ] rankId: 1, output: [ 0 1 2 3 4 5 6 7 ] rankId: 2, output: [ 0 1 2 3 4 5 6 7 ] rankId: 3, output: [ 0 1 2 3 4 5 6 7 ] rankId: 4, output: [ 0 1 2 3 4 5 6 7 ] rankId: 5, output: [ 0 1 2 3 4 5 6 7 ] rankId: 6, output: [ 0 1 2 3 4 5 6 7 ] rankId: 7, output: [ 0 1 2 3 4 5 6 7 ]

【免费下载链接】hccl集合通信库(Huawei Collective Communication Library,简称HCCL)是基于昇腾AI处理器的高性能集合通信库,为计算集群提供高性能、高可靠的通信方案项目地址: https://gitcode.com/cann/hccl

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

http://www.jsqmd.com/news/1119726/

相关文章:

  • CSS Subgrid 实践:对齐不是每个组件自己算一遍
  • Python 使用OpenAI调用Qwen3.6-27B-ms模型|完整参数详解
  • Runbook最佳实践:10个高效自动化运维场景案例
  • BiliScope开发者指南:深入解析插件架构与API调用
  • E-Hentai漫画下载神器:告别手动保存的终极指南
  • Authentication to host ‘127.0.0.1‘ for user ‘root‘ using method ‘caching_sha2_password‘ failed with
  • JavaScript断言库:从概念到实战,提升代码测试效率
  • 豆包不是零食,是数字生活的万能副驾驶
  • 跨平台漫画神器:JHenTai的5大颠覆体验与专家级使用指南
  • E-Hentai Viewer:重新定义iOS漫画阅读体验的移动神器
  • SolStatus 性能优化:提升大规模监控系统响应速度的 10 个技巧
  • 终极E-Hentai漫画下载器:快速免费打包完整漫画
  • 基于Databricks的企业级AI Agent生产部署实战指南
  • E-Hentai批量图片下载工具:2025年最全配置与使用手册
  • 分层赋智 一杆焕新
  • E-Hentai Viewer:让你的iPhone变身专业漫画阅读神器!
  • OSX-KVM音频延迟问题深度解析:三种高效解决方案对比
  • 启点智慧景区票务管理系统,智慧景区云平台,旅游景区智慧化运营管理系统
  • 无刷电机无感方波控制方案解析与优化
  • 机械爪控制系统:从基础架构到智能化的进化历程
  • SSH密钥生成与完整性保护:从Ed25519算法到Git签名实战
  • gearmand完全指南:从安装到部署,打造高效分布式任务队列系统
  • gearmand快速入门:10分钟搭建你的第一个分布式任务处理平台
  • 【免费开源】基于深度学习的病虫害专家系统(YOLOv8+streamlit界面+Python代码+权重模型)
  • 西工大软院大一高等数学竞赛终极指南:nwpu-cram题型解析与备考攻略 [特殊字符]
  • PCB设计中的贾凡尼效应解析与工程解决方案
  • 3步完成跨平台文献管理:WPS-Zotero插件让你的科研写作效率倍增
  • Vibe Coding从零到上线:7天掌握情绪驱动开发核心方法论(含GitHub可运行模板库)
  • 《大模型实战指南》—— 面向软件开发者的系统性入门1
  • 含图解与实例)乐观锁、悲观锁和分布式锁,做项目时到底该怎么选?