CANN/HCOMM通信器初始化示例
Communicator Management - One NPU Device per Process (Initialize Communicator Based on Rank Table)【免费下载链接】hcommHCOMMHuawei Communication是HCCL的通信基础库提供通信域以及通信资源的管理能力。项目地址: https://gitcode.com/cann/hcommSample OverviewThis sample demonstrates how to use theHcclCommInitClusterInfoConfig()API to initialize a communicator based on therank_table.jsonconfiguration file. It covers the following features:Launch multiple processes through MPI. Each process reads therank_table.jsonfile and initializes the communicator using theHcclCommInitClusterInfoConfig()API.Call theHcclAllReduce()operator and print the results.Directory Structure├── main.cc # Sample source file ├── Makefile # Build or configuration file ├── rank_table.json # Cluster information configuration file └── one_device_per_process_rank_table # Compiled executableEnvironment PreparationRequirementsThis sample supports the following products with a single-node 2-card cluster topology:Ascend 950PR / Ascend 950DTThis sample supports the following products with a single-node 8-card cluster topology:Atlas A3 training series products / Atlas A3 inference series productsAtlas A2 training series productsAtlas training series products / Atlas inference series productsSoftware DependenciesRunning this sample requires the CANN ops operator package to be installed. For detailed installation steps, see the Install the CANN Software Package section in Source Code Build.Installing MPIThis sample depends on MPI to launch processes on each Device. Before running this sample, install MPI. For detailed installation steps, see the MPI Installation and Configuration section in the corresponding version of the HCCL Performance Test Tool User Guide.Disabling Signature VerificationThecann-hcomm_version_linux-arch.runsoftware package generated from this source repository contains the following tar.gz subpackages:cann-hcomm-compat.tar.gz: HCOMM compatibility upgrade package.cann-hccd-compat.tar.gz: DataFlow compatibility upgrade package.aicpu_hcomm.tar.gz: AI CPU communication base package.These tar.gz packages are loaded to the Device when the service starts. During the loading process, the driver performs security signature verification by default to ensure the package is trusted. Because the tar.gz packages compiled from this source repository do not contain a signature header, the driver security signature verification mechanism needs to be disabled. For the method to disable signature verification, refer to the Disable Signature Verification section in Source Code Build.Configuring Environment Variables# Set CANN environment variables, using the root user default installation path as an example source /usr/local/Ascend/cann/set_env.sh # Set the MPI installation directory. Adjust it based on the actual situation. export MPI_HOME/usr/local/mpichCompiling and Running the SampleExecute the following commands in the sample code directory:make make test N${RANK_SIZE}RANK_SIZEis the number of cluster devices. For the Ascend 950PR and Ascend 950DT product series,RANK_SIZEis 2. For other product series, it is 8.Note: You can set theHCCL_OP_EXPANSION_MODEenvironment variable to configure the expansion mode of communication operators. For the range supported by different product models, refer to the usage of this environment variable in the Environment Variable List.# Set the expansion mode of communication operators to AI CPU communication engine export HCCL_OP_EXPANSION_MODEAI_CPUSample OutputThe data for each rank is initialized to 0 to 7. After the AllReduce operation, the result for each rank is the sum of the data at the corresponding positions across all ranks (the data from 8 ranks is summed).Found 8 NPU device(s) available rankId: 0, output: [ 0 8 16 24 32 40 48 56 ] rankId: 1, output: [ 0 8 16 24 32 40 48 56 ] rankId: 2, output: [ 0 8 16 24 32 40 48 56 ] rankId: 3, output: [ 0 8 16 24 32 40 48 56 ] rankId: 4, output: [ 0 8 16 24 32 40 48 56 ] rankId: 5, output: [ 0 8 16 24 32 40 48 56 ] rankId: 6, output: [ 0 8 16 24 32 40 48 56 ] rankId: 7, output: [ 0 8 16 24 32 40 48 56 ]【免费下载链接】hcommHCOMMHuawei Communication是HCCL的通信基础库提供通信域以及通信资源的管理能力。项目地址: https://gitcode.com/cann/hcomm创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

相关新闻

如何快速上手dhara-250m-OptiQ-8bit:从安装到基础使用的完整教程

如何快速上手dhara-250m-OptiQ-8bit:从安装到基础使用的完整教程

如何快速上手dhara-250m-OptiQ-8bit:从安装到基础使用的完整教程 【免费下载链接】dhara-250m-OptiQ-8bit 项目地址: https://ai.gitcode.com/hf_mirrors/mlx-community/dhara-250m-OptiQ-8bit dhara-250m-OptiQ-8bit是一款基于Apple Silicon优化的8位量化语…

2026/7/15 9:07:17阅读更多 →
用ADB解锁电视盒子:从默认桌面到极简启动器的进阶改造

用ADB解锁电视盒子:从默认桌面到极简启动器的进阶改造

1. 为什么需要改造电视盒子桌面? 每次打开电视盒子,满屏的广告和杂乱推荐内容是不是让你头疼?默认桌面不仅操作繁琐(比如打开一个第三方APP需要点击十多次遥控器),还会占用大量系统资源导致卡顿。我实测发…

2026/7/15 9:02:17阅读更多 →
AM572x引脚复用设计:从原理到实战的硬件开发指南

AM572x引脚复用设计:从原理到实战的硬件开发指南

1. 项目概述与核心价值 在嵌入式硬件设计领域,尤其是面对像德州仪器(TI)AM572x这类集成了强大视频处理、多核计算和丰富外设的异构处理器时,硬件工程师面临的最大挑战之一,往往不是核心算法的实现,而是如何…

2026/7/15 9:02:17阅读更多 →
英飞凌安全NFC标签芯片技术解析与应用实践

英飞凌安全NFC标签芯片技术解析与应用实践

1. 英飞凌安全NFC标签芯片的技术定位英飞凌OPTIGA™系列安全NFC标签芯片代表了当前非接触式安全认证技术的最高水平。这类芯片本质上是一种集成了加密引擎的智能射频标签,采用ISO/IEC 14443 Type A通信协议,符合NFC Forum Type 4 Tag技术规范。与普通NFC…

2026/7/15 10:22:29阅读更多 →
批量下载ERA5数据

批量下载ERA5数据

批量下载ERA5数据 文章目录 系列文章目录前言一、pandas是什么?二、使用步骤 1.引入库2.读入数据 总结 前言 提示:这里可以添加本文要记录的大概内容: 例如:随着人工智能的不断发展,机器学习这门技术也越来越重要&am…

2026/7/15 10:22:29阅读更多 →
ADALM1000验证电路比例与叠加定理实验指南

ADALM1000验证电路比例与叠加定理实验指南

1. ADALM1000 SMU设备与电路定理验证概述ADALM1000是一款由Analog Devices推出的便携式源测量单元(SMU),它集成了双通道可编程电源、示波器、函数发生器和数字万用表功能于一体。这款设备特别适合用于电子工程教学实验,尤其是基础…

2026/7/15 10:22:29阅读更多 →
NHSE存档编辑器深度解析:动物森友会游戏数据优化实战指南

NHSE存档编辑器深度解析:动物森友会游戏数据优化实战指南

NHSE存档编辑器深度解析:动物森友会游戏数据优化实战指南 【免费下载链接】NHSE Animal Crossing: New Horizons save editor 项目地址: https://gitcode.com/gh_mirrors/nh/NHSE NHSE(New Horizons Save Editor)是一款专为《集合啦&a…

2026/7/15 10:22:29阅读更多 →
Python标准库实战指南:12个高频模块精讲与工程避坑

Python标准库实战指南:12个高频模块精讲与工程避坑

1. 项目概述:为什么我坚持带新人“重走标准库这条路” Python 标准库不是一本需要从头啃到尾的《辞海》,它是一张你每天都在用、却常常视而不见的交通地图。我带过三十多期 Python 实操训练营,几乎每期都有学员在学完 Pandas、Requests、Flas…

2026/7/15 10:22:29阅读更多 →
如何用5分钟快速上手UI-TARS Desktop:终极智能自动化工具指南

如何用5分钟快速上手UI-TARS Desktop:终极智能自动化工具指南

如何用5分钟快速上手UI-TARS Desktop:终极智能自动化工具指南 【免费下载链接】UI-TARS-desktop The Open-Source Multimodal AI Agent Stack: Connecting Cutting-Edge AI Models and Agent Infra 项目地址: https://gitcode.com/GitHub_Trending/ui/UI-TARS-des…

2026/7/15 10:17:29阅读更多 →
VSCode TypeScript 环境配置对比:全局安装 vs 项目本地安装的4个关键差异

VSCode TypeScript 环境配置对比:全局安装 vs 项目本地安装的4个关键差异

VSCode TypeScript 环境配置对比:全局安装 vs 项目本地安装的4个关键差异当你在VSCode中启动一个新的TypeScript项目时,第一个技术决策往往从安装方式开始。这个看似简单的选择——全局安装还是项目本地安装——实际上会深刻影响你的开发流程、团队协作和…

2026/7/15 6:42:19阅读更多 →
智慧树刷课插件:5分钟实现自动化学习的智能助手

智慧树刷课插件:5分钟实现自动化学习的智能助手

智慧树刷课插件:5分钟实现自动化学习的智能助手 【免费下载链接】zhihuishu 智慧树刷课插件,自动播放下一集、1.5倍速度、无声 项目地址: https://gitcode.com/gh_mirrors/zh/zhihuishu 智慧树刷课插件是一款专为智慧树在线教育平台设计的Chrome浏…

2026/7/15 6:12:45阅读更多 →
Steam创意工坊下载器WorkshopDL:跨平台游戏模组获取的终极解决方案

Steam创意工坊下载器WorkshopDL:跨平台游戏模组获取的终极解决方案

Steam创意工坊下载器WorkshopDL:跨平台游戏模组获取的终极解决方案 【免费下载链接】WorkshopDL WorkshopDL - The Best Steam Workshop Downloader 项目地址: https://gitcode.com/gh_mirrors/wo/WorkshopDL 你是否在GOG或Epic Games Store购买了心仪的游戏…

2026/7/14 6:17:41阅读更多 →
AI框架决定企业AI能走多远

AI框架决定企业AI能走多远

企业AI建设的第一性原理 企业搞AI,最关键的决定是什么?不是选哪家大模型,不是先做哪个场景,不是招多少AI人才——而是选哪个AI开发框架。 为什么?因为框架决定了企业AI能力的"天花板"。选对了框架&#xff0…

2026/7/15 0:01:30阅读更多 →
Java企业为什么需要AI框架

Java企业为什么需要AI框架

Java企业在AI时代的尴尬处境 Java是全球企业级应用开发的主流语言——全球超过一半的企业系统跑在Java上。但在AI浪潮面前,很多Java企业感到尴尬:大模型的接口是各种语言的,AI开发社区以其他语言为主流,似乎Java在AI时代"掉队…

2026/7/15 0:01:30阅读更多 →
CC3230x嵌入式开发实战:SD主机、定时器与低功耗模式深度解析

CC3230x嵌入式开发实战:SD主机、定时器与低功耗模式深度解析

1. 项目概述:为什么需要关注CC3230x的SD主机、定时器与低功耗?在物联网和嵌入式设备开发领域,我们常常面临一个核心矛盾:设备需要具备强大的连接能力、可靠的数据存储和实时控制功能,同时又必须严格控制功耗以延长电池…

2026/7/15 0:01:30阅读更多 →
YOLOv8推理性能优化:从1.2FPS到35FPS的全链路加速实践

YOLOv8推理性能优化:从1.2FPS到35FPS的全链路加速实践

如果你在部署 YOLOv8 时,发现推理速度只有可怜的 1-2 FPS,而别人的演示视频却能跑到 30 FPS 以上,那么问题很可能不在模型本身,而在于你的整个处理链路。很多开发者拿到一个训练好的 YOLOv8 模型后,会直接使用官方示例…

2026/7/14 15:07:30阅读更多 →
Coze与Dify对比指南:低代码AI应用开发从入门到实战

Coze与Dify对比指南:低代码AI应用开发从入门到实战

1. 从零到一:为什么你需要了解 Coze 和 Dify?如果你对 AI 应用开发感兴趣,但一看到“大模型”、“智能体”、“工作流”这些词就头疼,觉得门槛太高,那这篇文章就是为你准备的。很多开发者,包括我自己&#…

2026/7/15 8:52:38阅读更多 →
AI生图工具怎么选?2026年6月版实测对比

AI生图工具怎么选?2026年6月版实测对比

做自媒体的朋友应该都有体会:配图一直是个让人头疼的问题。2026年,AI生图工具已经非常成熟了,但工具太多反而不知道怎么选。以下是截至2026年6月我对主流AI生图工具的实测对比。Midjourney V8.1:速度之王2026年6月11日&#xff0c…

2026/7/14 2:42:17阅读更多 →