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

CANN/asnumpy-docs 架构设计

Architecture【免费下载链接】asnumpy-docs项目地址: https://gitcode.com/cann/asnumpy-docsThis document describes the internal architecture of AsNumpy, including the three-layer design, the coreNPUArraydata structure, the API module layout, and the NPU extension strategy via OpenBOAT.Three-Layer ArchitectureAsNumpy is built on three layers that cleanly separate concerns:------------------------------------------ | Python Frontend (asnumpy/*.py) | | - __init__.py 122 exported symbols | | - array.py array creation (10 fn) | | - math.py math ops (80 fn) | | - linalg/ linear algebra | | - random/ random sampling | | - logic.py logic functions (16 fn) | | - nn.py neural network (softmax) | | - statistics.py statistics (mean) | ------------------------------------------ | pybind11 binding layer (python/*.cpp) PYBIND11_MODULE(asnumpy_core, ...) | ------------------------------------------ | C Core (src/, include/) | | - NPUArray core data structure | | - namespace asnumpy operator impls | | - Ascend ACL / ACLNN operator wrappers | | - CANN Runtime device management | ------------------------------------------ | Huawei CANN (ascendcl, runtime, nnopbase, opapi) | ------------------------------------------ | Ascend NPU Hardware (910B) | ------------------------------------------NPUArray DesignNPUArrayis the core data structure of AsNumpy. It is designed around three principles:CompatibilityNPUArrayexposes the same interface asnumpy.ndarrayat the Python level. Functions are named identically (add,multiply,matmul, …) so existing NumPy code can be migrated by changing the import and adding data transfer calls.EncapsulationInternally,NPUArrayholds:dtype— element type (aclDtype)shape— dimension sizesstrides— memory layouttensorPtr— pointer to the underlyingaclTensordevicePtr(private) — raw device memory address, exposed viadevice_address()Users never interact with these fields directly; the Python layer presents a clean ndarray-like interface.Resource ManagementNPUArrayfollows RAII: the destructor automatically callsaclDestroyTensorandaclrtFree, eliminating manual memory management. All four C value semantics are implemented (copy constructor, move constructor, copy assignment, move assignment).Data transfer:FromNumpy— usesACL_MEMCPY_HOST_TO_DEVICEToNumpy— usesACL_MEMCPY_DEVICE_TO_HOST;float16/BF16require specialuint16_tunpackingAPI ArchitectureAsNumpys API is divided intofunctional modulesandfoundation modules:Functional modulescover the primary scientific computing domains:ModulePythonC namespaceStatusMath (arithmetic, trig, exp, log)math.pyasnumpy::CompleteLinear algebralinalg/globalIn progressRandom samplingrandom/globalIn progressLogic functionslogic.pyasnumpy::CompleteArray creationarray.pyglobalCompleteSortingsorting.pyglobalCompleteNeural networknn.pyasnumpy::Complete (softmax)Statisticsstatistics.pyasnumpy::Complete (mean)I/Oio.pydelegated to NumPyCompleteFoundation modulessupport the functional layer:ModuleRoleNPUArray(src/utils/)Core data structureCANN driver(src/cann/)Device initialization and lifecycledtypes(src/dtypes/)Data type registrationpybind11 bindings(python/)Python-C interfaceNPU Extension ModuleCANNs built-in operators are primarily designed for deep learning (training and inference). AsNumpy targets general scientific computing — data analysis, numerical methods, signal processing — which requires a broader operator set than CANN alone provides.The gap:CANN built-in operators cannot cover all of NumPys API surface.The strategy:Wrap existing CANN built-in operators directlyDevelop missing operators manually (Ascend C)Supplement with the OpenBOAT open-source operator libraryThe value:This three-pronged approach progressively closes the compatibility gap toward the goal of covering the top 100 most-used NumPy APIs by v1.0.OpenBOATOpenBOATis an open-source Ascend C operator library built and maintained by theAISS Group, School of Computer Science, Harbin Institute of Technology(led by Prof. Su Tonghua).AttributeDetailProject URLhttps://link.gitcode.com/i/12691f46a888c7311bb4fce1e088b7f9TeamAISS Group, HIT — Prof. Su TonghuaTechnologyHuawei Ascend C programming languageRole in AsNumpyProvides operator implementations not covered by CANN built-ins, enabling broader NumPy API compatibilityAsNumpy and OpenBOAT are developed by the same research group, ensuring tight integration and coordinated roadmap planning.【免费下载链接】asnumpy-docs项目地址: https://gitcode.com/cann/asnumpy-docs创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

相关文章:

CANN/asnumpy-docs 架构设计

Architecture 【免费下载链接】asnumpy-docs 项目地址: https://gitcode.com/cann/asnumpy-docs This document describes the internal architecture of AsNumpy, including the three-layer design, the core NPUArray data structure, the API module layout, and t…...

ArcGIS Pro 3.x 批量处理遥感栅格:用Python脚本实现自动化转点、计算与导出(附完整代码)

ArcGIS Pro 3.x 遥感栅格自动化处理实战:从数据清洗到生产级流水线构建 遥感数据分析师常常需要处理TB级的时序栅格数据,比如月度NDVI指数、地表温度或降水分布。传统手动操作不仅效率低下,还容易因人为失误导致数据不一致。本文将分享如何基…...

Onyx Core API完全手册:RESTful接口详解与实战案例

Onyx Core API完全手册:RESTful接口详解与实战案例 【免费下载链接】Onyx Onyx 项目地址: https://gitcode.com/gh_mirrors/ony/Onyx Onyx Core是一个强大的企业级区块链平台,提供完整的RESTful API接口,让开发者能够轻松构建和管理区…...

昇腾C解交织API文档

DeInterleave 【免费下载链接】asc-devkit 本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言,原生支持C和C标准规范,主要由类库和语言扩展层构成,提供多层级API,满足多维场景算子开发诉求。 项目地址: https://gitcode.c…...

Windows缩略图加载太慢?这款智能预加载工具让文件浏览快如闪电

Windows缩略图加载太慢?这款智能预加载工具让文件浏览快如闪电 【免费下载链接】WinThumbsPreloader-V2 WinThumbsPreloader is a powerful open source tool for quickly preloading thumbnails in Windows Explorer. 项目地址: https://gitcode.com/gh_mirrors/…...

ncmdump终极指南:5分钟解锁网易云音乐NCM加密文件

ncmdump终极指南:5分钟解锁网易云音乐NCM加密文件 【免费下载链接】ncmdump 项目地址: https://gitcode.com/gh_mirrors/ncmd/ncmdump 你是否曾在网易云音乐下载了心爱的歌曲,却发现只能在特定客户端播放?当你想在车载音响、智能音箱…...

靠谱的远程手机控制软件 远程控制手机推荐用无界趣连2.0

靠谱的远程手机控制软件,能帮我们打破设备空间限制,日常办公、远程协助或游戏串流都能高效搞定。在众多远程手机控制软件里,无界趣连2.0凭借扎实的性能与无套路的体验,成为不少用户的首选,不管是新手还是老手&#xff…...

电力系统时序一致性保障:elec-ops-prediction的长时序稳定性约束实现

电力系统时序一致性保障:elec-ops-prediction的长时序稳定性约束实现 【免费下载链接】elec-ops-prediction elec-ops-prediction 是 CANN 社区 Electrical Engineering SIG(电力行业兴趣小组)旗下的电力负荷预测算子库, 聚焦于电…...

3分钟彻底解决Cursor试用限制:设备标识重置技术深度解析

3分钟彻底解决Cursor试用限制:设备标识重置技术深度解析 【免费下载链接】go-cursor-help 解决Cursor在免费订阅期间出现以下提示的问题: Your request has been blocked as our system has detected suspicious activity / Youve reached your trial request limit…...

wlnmp一键安装包260520更新:多软件版本升级,支持多系统架构快速部署

wlnmp一键安装包更新:多软件版本升级wlnmp一键安装包在260520迎来更新,此次更新涉及多个重要软件的版本升级,包括nginx1.30.1、php8.2.31、php8.3.31等多个php版本,以及MySQL8.0.46、MySQL8.4.9。这些软件版本的更新,为…...

深度解密Il2CppDumper:Unity逆向工程的高效实战指南

深度解密Il2CppDumper:Unity逆向工程的高效实战指南 【免费下载链接】Il2CppDumper Unity il2cpp reverse engineer 项目地址: https://gitcode.com/gh_mirrors/il/Il2CppDumper Il2CppDumper是一款专为Unity游戏逆向工程设计的强大工具,能够帮助…...

ESP32任务阻塞导致看门狗报错?手把手教你用menuconfig调整超时时间

ESP32任务看门狗超时问题全解析:从原理到menuconfig实战配置 在ESP32开发过程中,许多开发者都遇到过那个令人头疼的报错:"Task watchdog got triggered"。这个看似简单的错误背后,其实隐藏着实时操作系统任务调度的核心…...

Intel 14代酷睿接口更迭:技术推演与用户决策指南

1. 项目概述:一次关于“接口更迭”的深度技术推演最近,关于下一代酷睿处理器的传闻又开始在圈内流传,一个核心的焦点再次被推上风口浪尖:Intel 14代酷睿(Raptor Lake Refresh)可能又要更换CPU插槽接口了。这…...

3大AI创作效率瓶颈的模块化解法:ComfyUI企业级工作流自动化实践

3大AI创作效率瓶颈的模块化解法:ComfyUI企业级工作流自动化实践 【免费下载链接】ComfyUI The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. 项目地址: https://gitcode.com/GitHub_Trending/co/ComfyUI …...

G-Helper完整指南:3分钟掌握华硕笔记本性能优化神器

G-Helper完整指南:3分钟掌握华硕笔记本性能优化神器 【免费下载链接】g-helper Lightweight Armoury Crate alternative for Asus laptops with nearly the same functionality. Works with ROG Zephyrus, Flow, TUF, Strix, Scar, ProArt, Vivobook, Zenbook, Expe…...

华硕笔记本终极控制工具G-Helper:如何用轻量级软件替代臃肿的Armoury Crate

华硕笔记本终极控制工具G-Helper:如何用轻量级软件替代臃肿的Armoury Crate 【免费下载链接】g-helper Lightweight Armoury Crate alternative for Asus laptops with nearly the same functionality. Works with ROG Zephyrus, Flow, TUF, Strix, Scar, ProArt, V…...

终极TFTP服务器解决方案:Tftpd64网络服务一体化配置完全指南 [特殊字符]

终极TFTP服务器解决方案:Tftpd64网络服务一体化配置完全指南 🚀 【免费下载链接】tftpd64 The working repository of the famous TFTP server. 项目地址: https://gitcode.com/gh_mirrors/tf/tftpd64 Tftpd64是一款轻量级、多线程的网络服务套件…...

BBDown实用指南:高效下载B站视频的完整解决方案

BBDown实用指南:高效下载B站视频的完整解决方案 【免费下载链接】BBDown Bilibili Downloader. 一个命令行式哔哩哔哩下载器. 项目地址: https://gitcode.com/gh_mirrors/bb/BBDown BBDown是一个功能强大的命令行式哔哩哔哩视频下载器,专为技术爱…...

联想拯救者工具箱终极指南:完全替代Vantage的轻量级硬件管理方案

联想拯救者工具箱终极指南:完全替代Vantage的轻量级硬件管理方案 【免费下载链接】LenovoLegionToolkit Lightweight Lenovo Vantage and Hotkeys replacement for Lenovo Legion laptops. 项目地址: https://gitcode.com/gh_mirrors/le/LenovoLegionToolkit …...

OpCore-Simplify:如何30分钟完成专业级黑苹果配置

OpCore-Simplify:如何30分钟完成专业级黑苹果配置 【免费下载链接】OpCore-Simplify A tool designed to simplify the creation of OpenCore EFI 项目地址: https://gitcode.com/GitHub_Trending/op/OpCore-Simplify 还在为复杂的黑苹果配置而烦恼吗&#x…...

通过 curl 命令快速测试 Taotoken 大模型接口连通性

🚀 告别海外账号与网络限制!稳定直连全球优质大模型,限时半价接入中。 👉 点击领取海量免费额度 通过 curl 命令快速测试 Taotoken 大模型接口连通性 在接入大模型服务时,直接使用 curl 命令进行接口测试是一种高效且…...

PyTorch矩阵乘法进阶:用torch.matmul高效实现一个简易的Transformer注意力头

PyTorch矩阵乘法进阶:用torch.matmul高效实现一个简易的Transformer注意力头 在深度学习领域,矩阵乘法是构建复杂模型的基石操作。PyTorch作为当前最流行的深度学习框架之一,其torch.matmul函数在实现高效矩阵运算方面发挥着关键作用。本文将…...

告别实车折腾!手把手教你用Vector VT平台搭建OBC/DCDC的HIL测试台架(附避坑清单)

从零搭建OBC/DCDC HIL测试台架:Vector VT平台实战指南与避坑手册 当你第一次面对堆满桌面的Vector VT板卡、缠绕如蛛网的线缆和数十个软件模块时,HIL测试的复杂性可能令人望而生畏。本文将以工程师视角,带你一步步完成从设备上电到首个充电协…...

别再只当Atlas是元数据仓库了!手把手教你用它的UI搞定数据分类与血缘追溯

别再只当Atlas是元数据仓库了!手把手教你用它的UI搞定数据分类与血缘追溯 数据治理工具常被视为"高大上"的架构师专属玩具,但Apache Atlas的UI界面却藏着连一线工程师都能立刻上手的实用功能。上周排查一个报表异常时,我发现团队里…...

如何通过智能菜单栏管理让Mac界面焕然一新:Hidden Bar深度使用指南

如何通过智能菜单栏管理让Mac界面焕然一新:Hidden Bar深度使用指南 【免费下载链接】hidden An ultra-light MacOS utility that helps hide menu bar icons 项目地址: https://gitcode.com/gh_mirrors/hi/hidden 在macOS系统中,菜单栏图标堆积是…...

手把手教你用wget和迅雷搞定nuScenes数据集下载(附完整性校验命令)

高效获取nuScenes数据集的两种技术方案与完整性验证指南 在自动驾驶与计算机视觉研究领域,nuScenes数据集因其丰富的传感器数据和精细的标注体系已成为行业基准测试的重要资源。但对于大多数研究者而言,获取这个总容量超过550GB的数据集却面临着网络不稳…...

人工智能术语库:2442个专业AI词汇一站式查询指南

人工智能术语库:2442个专业AI词汇一站式查询指南 【免费下载链接】Artificial-Intelligence-Terminology-Database A comprehensive mapping database of English to Chinese technical vocabulary in the artificial intelligence domain 项目地址: https://gitc…...

联想RD450X服务器风扇策略深度解析:IPMI raw命令详解与安全调校指南

联想RD450X服务器IPMI风扇调校实战:从底层指令到安全优化 在数据中心密集部署的服务器集群中,散热管理往往成为平衡性能与可靠性的关键支点。联想RD450X作为主流2U机架式服务器,其智能风扇控制系统通过IPMI接口提供了丰富的底层调节能力&…...

从Pikachu靶场看CSRF Token防护:为什么你的Token机制可能被绕过?聊聊设计缺陷与加固思路

从Pikachu靶场看CSRF Token防护:为什么你的Token机制可能被绕过?聊聊设计缺陷与加固思路 在Web安全领域,CSRF(跨站请求伪造)攻击一直是开发者需要重点防范的威胁之一。而CSRF Token作为最常用的防护手段,其…...

【广东工业大学主办,阿布扎比大学支持举办 | JPCS 出版|EI,Scopus稳定双检索 | 连续多年EI稳定见刊检索】 第十届能源、环境与材料科学国际学术会议(EEMS 2026)

第十届能源、环境与材料科学国际学术会议(EEMS 2026) 2026 10th International Conference on Energy, Environment and Materials Science 大会时间:2026年7月10-12日 大会地点:广东广州 会议官网:​​​​​​www.ic-eems…...