news 2026/5/9 18:45:06

CANN/PTO-ISA AI代理指南

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
CANN/PTO-ISA AI代理指南

Repo Context for AI Agents (PTO Tile Lib)

【免费下载链接】pto-isaParallel 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 Ascend platforms.项目地址: https://gitcode.com/cann/pto-isa

This document is a fast, practical orientation for agents working in this repo: what it is, where the key entrypoints live, and the shortest paths to build/run inCPU,NPU simulator (sim), andon-board NPU (npu)modes.

What This Repo Is

  • PTO Tile Library: C++ headers + implementations for the PTO (Parallel Tile Operation) virtual ISA defined by Ascend CANN.
  • Supports multiple backends:
    • CPU simulation(cross-platform, no Ascend driver/CANN required).
    • Ascend NPUbackends split by SoC generation:
      • A2/A3 family:include/pto/npu/a2a3/(selected via-v a3in test scripts).
      • A5:include/pto/npu/a5/.
  • Primary include for upper-layer code:#include <pto/pto-inst.hpp>(unified entry header).

Repo Map (Where To Look First)

  • Project overview + common commands:README.md
  • Detailed setup (CPU first, then NPU):docs/getting-started.md
  • ISA docs and navigation:
    • docs/README.md(ISA guide entry)
    • docs/isa/(per-instruction reference)
  • Public API headers and backend status table:include/README.md
  • Core public headers / backend split:include/pto/README.md
  • Build/package entrypoint:build.sh, top-levelCMakeLists.txt,cmake/
  • Tests entrypoints:
    • CPU simulator tests:tests/run_cpu.py,tests/run_cpu_tests.sh
    • NPU ST build/run:tests/script/run_st.py,tests/run_st.sh
    • Test layout overview:tests/README.md
  • Demos:demos/(CPU demos used bytests/run_cpu.py --demo ...)

Run: CPU Simulator (Recommended First)

CPU simulation is meant to be the “works everywhere” correctness path.

From repo root:

python3 tests/run_cpu.py --clean --verbose

Useful variants:

python3 tests/run_cpu.py --testcase tadd python3 tests/run_cpu.py --testcase tadd --gtest_filter 'TADDTest.*' python3 tests/run_cpu.py --demo gemm --verbose python3 tests/run_cpu.py --demo flash_attn --verbose

Notes:

  • CPU ST uses CMake and GoogleTest; it may download GTest if not installed system-wide.
  • Compiler requirement is at leastC++20(seetests/cpu/st/CMakeLists.txt).
  • For enabling bfloat16 support in CPU-SIM, GCC>=14 is required

Run: NPU ST (Ascend) —simandnpu

NPU ST is built/run viatests/script/run_st.py:

python3 tests/script/run_st.py -r [sim|npu] -v [a3|a5] [-a] -t <testcase> -g <gtest_filter>

Key points:

  • -acompiles the test case in auto mode instead of manual mode.
  • -v a3selects theA2/A3implementation underinclude/pto/npu/a2a3/(the test script maps it to a SoC string likeAscend910B1).
  • -r simuses the Ascend simulator libraries under$ASCEND_HOME_PATH/tools/simulator/<SOC>/libandruntime/lib64/stub.
  • -r npuruns on real hardware.

Examples (single case):

python3 tests/script/run_st.py -r sim -v a3 -t tadd -g TADDTest.case_float_64x64_64x64 python3 tests/script/run_st.py -r npu -v a3 -t tadd -g TADDTest.case_float_64x64_64x64

Recommended suites (wrapper script):

chmod +x ./tests/run_st.sh ./tests/run_st.sh a3 sim simple ./tests/run_st.sh a3 npu simple

Environment: Ascend CANN / Toolkit

NPU ST requires a working Ascend environment. Typical setup (choose the correct install path):

source /usr/local/Ascend/cann/bin/setenv.bash # or source $HOME/Ascend/ascend-toolkit/latest/bin/setenv.bash

tests/script/run_st.pyexpectsASCEND_HOME_PATHto be set (usually done bysetenv.bash).

Common Pitfalls (And How This Repo Handles Them)

  • GTest ABI mismatch on Linux: some systems havelibgtest*.abuilt with_GLIBCXX_USE_CXX11_ABI=0.
    • CPU and NPU ST CMake projects supportPTO_GLIBCXX_USE_CXX11_ABI=auto|0|1and auto-detect when possible.
  • simopen-files limit: simulator runs may require a higherulimit -n(seedocs/getting-started.mdandbuild.sh).

【免费下载链接】pto-isaParallel 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 Ascend platforms.项目地址: https://gitcode.com/cann/pto-isa

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

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/5/9 18:43:24

上下文向量在NLP中的三大实战应用

1. 上下文向量&#xff1a;从理论到实践的全方位应用指南在自然语言处理领域&#xff0c;上下文向量已经成为理解文本语义的核心工具。作为一名长期使用Transformer模型的从业者&#xff0c;我见证了这些向量表示如何彻底改变了我们处理文本的方式。与传统的词向量不同&#xf…

作者头像 李华
网站建设 2026/5/9 18:31:37

CANN运行时Stream管理

Stream管理 【免费下载链接】runtime 本项目提供CANN运行时组件和维测功能组件。 项目地址: https://gitcode.com/cann/runtime Stream概念 Stream描述了一个在Host下发并在Device上执行的任务队列。 在同一个Stream中&#xff0c;任务按照进入队列的顺序依次执行。当…

作者头像 李华
网站建设 2026/5/9 18:30:34

如何彻底告别手动刷课:Autovisor智慧树自动化学习终极指南

如何彻底告别手动刷课&#xff1a;Autovisor智慧树自动化学习终极指南 【免费下载链接】Autovisor 2025智慧树刷课脚本 基于Python Playwright的自动化程序 [有免安装版] 项目地址: https://gitcode.com/gh_mirrors/au/Autovisor 还在为智慧树网课而烦恼吗&#xff1f;每…

作者头像 李华
网站建设 2026/5/9 18:25:32

基于Electron构建开发者专属浏览器:集成调试、终端与源码映射

1. 项目概述&#xff1a;一个为开发者量身定制的浏览器如果你和我一样&#xff0c;每天的工作流被十几个浏览器标签页、五花八门的开发者工具、以及各种调试插件塞得满满当当&#xff0c;那你一定懂那种“浏览器太重”的痛。我们需要的不是一个面向大众的通用浏览器&#xff0c…

作者头像 李华
网站建设 2026/5/9 18:23:30

CANN/pypto concat操作

pypto.concat 【免费下载链接】pypto PyPTO&#xff08;发音: pai p-t-o&#xff09;&#xff1a;Parallel Tensor/Tile Operation编程范式。 项目地址: https://gitcode.com/cann/pypto 产品支持情况 产品是否支持Ascend 950PR/Ascend 950DT√Atlas A3 训练系列产品/A…

作者头像 李华
网站建设 2026/5/9 18:20:46

Gemma-4-26B-A4B-it-GGUF部署疑难解答:处理C盘空间不足等系统问题

Gemma-4-26B-A4B-it-GGUF部署疑难解答&#xff1a;处理C盘空间不足等系统问题 1. 问题背景与常见错误 当你在Windows系统上部署Gemma-4-26B-A4B-it-GGUF这类大模型时&#xff0c;最常遇到的拦路虎就是C盘空间不足。这个26B参数量的模型&#xff0c;光是GGUF格式的模型文件就可…

作者头像 李华