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

CANN/VGGT昇腾推理适配

VGGT inference on Ascend Atlas A2【免费下载链接】cann-recipes-spatial-intelligence本项目针对空间智能业务中的典型模型、加速算法提供基于CANN平台的优化样例项目地址: https://gitcode.com/cann/cann-recipes-spatial-intelligenceCANN Environment PreparatonThe inference of VGGT depends on the CANN development kit package (cann-toolkit) and the CANN binaray operator package(cann-kernels). The supported CANN software version is CANN 8.5.0.Download theAscend-cann-toolkit_${version}_linux-${arch}.runandAscend-cann-${chip_type}-ops_linux-${arch}.runpackages from the CANN Software Package Download Page and install them by referring to the CANN Installation Guide.The required versions of torch and torch_npu are 2.7.1 and 2.7.1.post2.Download the binary package from Ascend Extension for PyTorch and install torch and torch_npu.conda create -n vggt python3.11.13 conda activate vggt pip3 install torch2.7.1 pip3 install torch-npu2.7.1.post2VGGT Model PreparationDownload the open-source VGGT network code from the github repo.git clone https://github.com/facebookresearch/vggt.gitDownload the code of this repository:git clone https://gitcode.com/chenhongyang/cann-recipes-spatial-intelligence.gitCopy the code from the VGGT repository to this project directory in non-overwrite mode:cp -r vggt/examples cann-recipes-spatial-intelligence/models/vggt/ cp -rn vggt/vggt/dependency cann-recipes-spatial-intelligence/models/vggt/vggt/dependency cp -rn vggt/vggt/heads cann-recipes-spatial-intelligence/models/vggt/vggt/ cp -rn vggt/vggt/layers cann-recipes-spatial-intelligence/models/vggt/vggt/ cp -rn vggt/vggt/utils cann-recipes-spatial-intelligence/models/vggt/vggt/Install Python dependencies:pip3 install -r requirements.txtDownload VGGT model weights and copy it to the local pathckpt.VGGT --- examples --- demo_infer.py --- eval --- ckpt --- model.pt --- quant --- vggt --- dependency --- heads --- layers --- models --- utils --- spPerformance MeasurementThis repo provides script to test the functionality and the performance of VGGT model on NPU.Before executing the test scripts, refer to the Ascend Community CANN installation tutorial to set environment variables:source /usr/local/Ascend/ascend-toolkit/set_env.shRun the inference script and the output presents the average inference time of vggt bf16 model.python demo_infer.py --ckpt ckpt/model.ptRun the inference script and the output presents the average inference time of vggt bf16_sp model.bash infer_test.shParameter description for multi NPU inference:torchrun --nproc_per_node1 demo_infer.py \ --ckpt ${model_base} \ --images_path examples/kitchen/images \ --enable_sp \ --ulysses_degree 1 \ --ring_degree 1 # nproc_per_nodeThe torchrun parameter, the number of processes started by each node, needs to be equal to the number of NPU cards used # ckptModel checkpoint file path # images_pathEnter the directory where the image sequence is located # enable_spWhether to enable sequence parallelism, default value: False, with the prerequisite that nproc_per_node1 # ulysses_degreeUlysses parallelism, constraint Ulysses_degree × ring_degreenproc_per_node; Num_ attention heads must be divisible by Ulysses_degree # ring_degreeRing parallelism, constraint Ulysses_degree × ring_degreenproc_per_nodeTo perform vggt int8 model inference, you first need to build the vggt int8 model:python demo_infer.py --ckpt ckpt/model.pt --buildW8A8The vggt int8 model will be built in the current path, and then used for inference:python demo_infer.py --ckpt VGGT_model_W8A8.pt --enableW8A8Accurancy BenchmarkThis repo provides accurancy benchmark to evaluate the VGGT model on NPU. The full benchmark include three programs to test the accurancy of VGGT on Pose Evaluation, Point Map Evaluation and Depth Evaluation.Since the full dataste of benchmark is large, we can initially test the accurancy of VGGT model in Pose Evaluation with the subset of the full Co3DV2 dataset.Dataset Preparation:Download dataCO3D_apple.zipand dataCO3D_backpack.zipfrom CO3D website and unzip them todatasets/co3d/co3d_data/.VGGT --- datasets --- co3d --- co3d_data --- apple --- backpack ...Prepare metadata of the dataset:export VGGT_DIR$(pwd) cd eval/pose_evaluation/dataset_prepare python preprocess_co3d.py --category all --co3d_v2_dir $VGGT_DIR/datasets/co3d/co3d_data/ --output_dir $VGGT_DIR/datasets/co3d/co3d_anno/Accurancy MeasurementExecute the benchmark program:Use vggt bf16 model:export VGGT_DIR$(pwd) cd eval/pose_evaluation python eval_co3d.py --co3d_dir $VGGT_DIR/datasets/co3d/co3d_data/ --co3d_anno_dir $VGGT_DIR/datasets/co3d/co3d_anno/ --ckpt $VGGT_DIR/ckpt/model.ptCurrently, the bf16 model measurement accurancy is about 0.911.Use vggt int8 model:export VGGT_DIR$(pwd) cd eval/pose_evaluation python eval_co3d.py --co3d_dir $VGGT_DIR/datasets/co3d/co3d_data/ --co3d_anno_dir $VGGT_DIR/datasets/co3d/co3d_anno/ --ckpt VGGT_model_W8A8.pt --enableW8A8Currently, the int8 model measurement accurancy is about 0.907.【免费下载链接】cann-recipes-spatial-intelligence本项目针对空间智能业务中的典型模型、加速算法提供基于CANN平台的优化样例项目地址: https://gitcode.com/cann/cann-recipes-spatial-intelligence创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

相关文章:

CANN/VGGT昇腾推理适配

VGGT inference on Ascend Atlas A2 【免费下载链接】cann-recipes-spatial-intelligence 本项目针对空间智能业务中的典型模型、加速算法,提供基于CANN平台的优化样例 项目地址: https://gitcode.com/cann/cann-recipes-spatial-intelligence CANN Environm…...

为内容生成平台集成Taotoken,实现按需切换不同风格的大模型

🚀 告别海外账号与网络限制!稳定直连全球优质大模型,限时半价接入中。 👉 点击领取海量免费额度 为内容生成平台集成Taotoken,实现按需切换不同风格的大模型 在构建内容生成平台时,一个常见的需求是希望输…...

自定义鼠标光标引擎:从原理到实现,打造个性化交互体验

1. 项目概述:一个鼠标光标背后的交互革命最近在GitHub上看到一个挺有意思的项目,叫“Mouse-Cursor”。初看标题,你可能觉得这有什么好研究的?不就是操作系统里那个跟着你手移动的小箭头或者小手图标吗?但点进去深入了解…...

基于SocialDAO的性勒索防御系统:技术架构与工程实践

1. 项目概述:一个面向未来的性勒索综合防御体系在数字生活的阴影面,性勒索(Sxtortion)正成为一种日益猖獗且极具破坏性的网络犯罪。它利用受害者的私密信息或影像进行威胁、敲诈,造成的心理创伤和社会伤害往往难以估量…...

可解释AI(xAI)如何破解医疗AI黑盒?以OCT辅助诊断多发性硬化为例

1. 项目概述:当AI诊断遇上“黑盒”困境,我们如何让医生信服? 在神经眼科和神经退行性疾病的研究前沿,光学相干断层扫描(OCT)已经成为一种革命性的无创成像工具。它能以微米级的精度,清晰地呈现视…...

算法审查委员会(ARB)建设指南:从设计到落地的负责任AI治理实践

1. 项目概述:为什么我们需要算法审查委员会?在过去的几年里,我亲眼见证了AI项目从实验室原型到大规模生产部署的惊人速度。随之而来的,是越来越多的深夜电话和紧急会议,议题往往围绕着某个已上线的模型出现了意想不到的…...

AI伦理框架实战:IEEE与WEF双轨制如何指导负责任的AI系统开发

1. 项目概述:为什么我们需要在AI项目中嵌入伦理框架?最近几年,AI项目从实验室走向了千家万户和各行各业。作为一名从业者,我亲眼见证了从“能用就行”到“必须好用且安全”的观念转变。早期我们更关注模型的准确率、响应速度&…...

CANN/opbase AllocScalar API文档

AllocScalar 【免费下载链接】opbase 本项目是CANN算子库的基础框架库,为算子提供公共依赖文件和基础调度能力。 项目地址: https://gitcode.com/cann/opbase 功能说明 申请一个aclScalar对象,并对其赋值。通过多个重载函数,用于支持…...

CANN/metadef AppendStride函数

AppendStride 【免费下载链接】metadef Ascend Metadata Definition 项目地址: https://gitcode.com/cann/metadef 函数功能 向后扩展一个步长值,如果扩展的步长数量超出Stride的最大限制,那么本函数不做任何事情。 函数原型 Stride& Appe…...

3秒获取百度网盘提取码:baidupankey智能工具的终极解决方案

3秒获取百度网盘提取码:baidupankey智能工具的终极解决方案 【免费下载链接】baidupankey 项目地址: https://gitcode.com/gh_mirrors/ba/baidupankey 在数字资源共享日益频繁的今天,百度网盘提取码成为获取资料的关键屏障。据统计,超…...

AI算力治理五大核心原则:平衡风险管控与技术创新

1. 项目概述:为什么我们需要关注AI算力治理?最近几年,AI的发展速度让人眼花缭乱,从能写代码的Copilot到能生成逼真图像的Stable Diffusion,背后都离不开一个核心驱动力:算力。简单来说,没有海量…...

Segment Anything生态全景:从基础模型到垂直应用实战指南

1. 项目概述:Segment Anything 生态全景图如果你在2023年之后关注过计算机视觉领域,那么“Segment Anything Model”这个名字你一定不会陌生。它就像一颗投入平静湖面的巨石,激起的涟漪迅速扩散到了图像分割、医学影像、机器人、遥感乃至生物…...

BLDC无刷直流电机作为发电机的波形图

这是张价值上千块的图片,因为花了上千块买了个示波器才发现的这个图片...

CANN/pto-isa异步通信Demo

Allgather Async Demo 【免费下载链接】pto-isa Parallel Tile Operation (PTO) is a virtual instruction set architecture designed by Ascend CANN, focusing on tile-level operations. This repository offers high-performance, cross-platform tile operations across …...

Cap开源视频消息工具:自托管部署、技术架构与Loom替代方案

1. 项目概述:一个开源的视频消息工具 如果你正在寻找一个可以替代 Loom 的、功能强大且能完全掌控在自己手中的视频录制与分享工具,那么 Cap 绝对值得你花时间深入了解。简单来说,Cap 是一个开源的视频消息工具,它允许你快速录制、…...

开源AI录音助理ClawHark:用Wear OS手表打造隐私优先的语音采集方案

1. 项目概述:将你的智能手表变成全天候AI录音助理 如果你和我一样,对Omi、Limitless这类AI录音硬件感兴趣,但又不想额外花钱买设备,也不想把个人对话数据交给第三方云服务,那么ClawHark这个项目可能就是你要找的答案。…...

企业级AI应用开发,利用Taotoken实现API访问控制与审计日志

🚀 告别海外账号与网络限制!稳定直连全球优质大模型,限时半价接入中。 👉 点击领取海量免费额度 企业级AI应用开发,利用Taotoken实现API访问控制与审计日志 在将大模型能力集成到企业应用的过程中,开发团队…...

基于Docker的AI Agent安全部署实践:Carapace项目深度解析

1. 项目概述:为AI Agent打造一个安全的“家”如果你正在运行一个像OpenClaw这样的AI Agent网关,那么你手里握着的是一把双刃剑。它强大、灵活,能帮你处理各种任务,但同时也意味着你赋予了一个AI程序访问你的Shell、文件系统乃至外…...

多模态AI重塑教育:从评估到个性化支持的实践与伦理挑战

1. 项目概述:当多模态AI走进课堂,我们面临什么?作为一名长期关注教育技术前沿的从业者,我亲眼见证了AI从实验室概念到课堂助手的演变。最初,AI在教育中的应用多是单点突破,比如用算法批改选择题&#xff0c…...

医疗AI可解释性实战:SHAP与EBM模型在眼科诊断中的对比解析

1. 项目概述:当AI遇见眼科,我们如何看清“决策黑箱”?在眼科神经领域,多发性硬化(MS)的诊断与病程监测,正经历一场从“经验依赖”到“数据驱动”的深刻变革。光学相干断层扫描(OCT&a…...

Nucleus Co-Op终极指南:如何让任何单机游戏变身为多人派对神器

Nucleus Co-Op终极指南:如何让任何单机游戏变身为多人派对神器 【免费下载链接】nucleuscoop Starts multiple instances of a game for split-screen multiplayer gaming! 项目地址: https://gitcode.com/gh_mirrors/nu/nucleuscoop 你是否曾经想过&#xf…...

AI平台竞争中的合谋与网络效应:市场博弈的底层逻辑分析

1. 项目概述:当AI平台开始“默契”时,市场会发生什么? 最近和几位做投资和产品战略的朋友聊天,话题总绕不开一个现象:几个头部的AI大模型平台,无论是定价策略、功能迭代节奏,还是对开发者的扶持…...

LLM推理服务调度优化:KV$缓存与负载均衡的乘法组合方法

1. LLM推理服务调度优化概述大型语言模型(LLM)推理服务面临的核心挑战之一是如何高效调度用户请求。当多个用户同时向部署在GPU集群上的LLM服务发送请求时,调度系统需要决定将每个请求分配给哪个计算实例。这个决策直接影响两个关键性能指标:首令牌延迟(…...

基于LLM智能体的多模态医疗AI系统:架构、实现与临床评估

1. 项目概述与核心思路在肿瘤诊疗的日常工作中,我们常常面临一个困境:信息是海量的,但时间是有限的。一位晚期结直肠癌患者,他的病历里可能包含长达数年的门诊记录、几次手术的病理报告、不同时期的CT/MRI影像、以及一份包含数百个…...

CANN/ops-blas Scopy算子实现

Scopy算子实现 【免费下载链接】ops-blas 本项目是CANN提供的高性能线性代数计算以及轻量化GEMM调用算子库。 项目地址: https://gitcode.com/cann/ops-blas 概述 BLAS Scopy算子实现,同时支持Ccopy复数向量复制。 支持的接口 aclblasScopy: 实数向量复制…...

快速提取视频中的PPT内容:一键将视频转PDF的终极解决方案

快速提取视频中的PPT内容:一键将视频转PDF的终极解决方案 【免费下载链接】extract-video-ppt extract the ppt in the video 项目地址: https://gitcode.com/gh_mirrors/ex/extract-video-ppt 在数字化学习时代,你是否经常需要从教学视频、会议录…...

报名截止前最后48小时,你必须确认的7项资格校验清单,漏1项直接失去参会编码!

更多请点击: https://intelliparadigm.com 第一章:2026年AI技术大会报名截止时间 2026年AI技术大会(AI Tech Summit 2026)官方报名通道将于北京时间2026年3月15日23:59正式关闭,逾期系统将自动终止注册与资料提交。所…...

[具身智能-617]:激光雷达传感器的工作原理、接口信号、数据格式

激光雷达(LiDAR)是一种主动式三维环境感知传感器,核心是通过发射激光并测量反射信号,获取周围物体的精确距离、角度与反射特性,最终生成点云(Point Cloud)。以下从工作原理、接口信号、数据格式…...

[具身智能-616]:IMU 四元数是什么?(大白话 + 原理 + 作用 + 为什么不用欧拉角)

一、一句话极简定义四元数是用来描述物体在 3D 空间姿态、旋转的数学工具,在 IMU 九轴里,就是用 4 个数字,唯一表示传感器当前的倾斜、旋转、朝向。格式:\(q [w,\ x,\ y,\ z]\)4 个浮点数,没有角度,纯数学…...

3分钟快速安装TrollStore的终极指南:TrollInstallerX完整教程

3分钟快速安装TrollStore的终极指南:TrollInstallerX完整教程 【免费下载链接】TrollInstallerX A TrollStore installer for iOS 14.0 - 16.6.1 项目地址: https://gitcode.com/gh_mirrors/tr/TrollInstallerX 你是一个文章写手,你负责为开源项目…...