Atb Testframework Build logo

Atb Testframework Build

Organization
Ascend
atb-testframework-build

编译 ATB (Ascend Transformer Boost) 测试框架。当用户需要编译 ATB 测试框架、 运行 CSV 测试、或构建 atb_test_framework 时调用。支持全量编译(含第三方依赖克隆与源替换) 和增量编译两种模式。需在 Docker 容器内配合 CANN 环境执行。

Overview

PublisherAscend
Repositoryagent-skills
Skill nameatb-testframework-build
Stars
54
Forks
4
Bundled files
Instructions only
LicenseMulanPSL-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by Ascend on GitHub. Read the source before you install it.

Installation

Install the Atb Testframework Build AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Ascend/agent-skills/tree/master/skills/ascend-transformer-boost/skills/atb-testframework-build
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Ascend/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/skills/ascend-transformer-boost/skills/atb-testframework-build .claude/skills/atb-testframework-build
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Atb Testframework Build in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Atb Testframework Build on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Atb Testframework Build is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

ATB 测试框架编译

功能概述

此技能提供 ATB (Ascend Transformer Boost) 测试框架的编译指导,包括全量编译(含第三方依赖克隆与源替换)和增量编译两种模式。

调用时机

在以下情况下调用此技能:

  • 用户需要编译 ATB 测试框架
  • 用户需要运行 CSV 测试但测试框架未编译
  • 用户需要从零开始构建 ATB 项目
  • 用户遇到第三方依赖克隆失败的问题

前置条件

  • Docker 容器已启动
  • CANN 环境已安装
  • ATB 源码仓库已克隆

关键路径变量

在执行编译前,需确认以下路径变量(从用户处获取):

变量说明示例
<CANN_PATH>CANN 安装根目录,包含 set_env.sh/path/to/cann
<ATB_REPO_PATH>ATB 源码仓库根目录/path/to/ascend-transformer-boost
<DOCKER_NAME>Docker 容器名称<YOUR_DOCKER_NAME>

编译模式选择

增量编译

当 3rdparty/ 目录已存在且第三方依赖完整时,直接执行增量编译:

bash
docker exec <DOCKER_NAME> bash -c "
source <CANN_PATH>/set_env.sh && \
cd <ATB_REPO_PATH> && \
bash scripts/build.sh testframework
"

适用场景:第三方依赖已就绪,仅需重新编译 ATB 源码。

全量编译

当 3rdparty/ 目录为空或不存在时,需要全量编译,包括第三方依赖的克隆。由于 Docker 容器内可能无法访问 GitHub,需要先进行源替换。

第1步:替换 GitHub 源为 gitcode 镜像

ATB 的 scripts/build.sh 中包含多个 GitHub 依赖,在国内网络环境下需要替换为 gitcode.com 镜像。

需要替换的源映射表:

原始 GitHub URLgitcode 替换 URLbuild.sh 中的函数
https://github.com/nlohmann/json.githttps://gitcode.com/nlohmann/json.gitfn_build_nlohmann_json
https://github.com/google/googletest.githttps://gitcode.com/google/googletest.gitfn_build_googletest
https://github.com/coolxv/cpp-stub.githttps://gitcode.com/coolxv/cpp-stub.gitfn_build_stub
https://github.com/pybind/pybind11.githttps://gitcode.com/pybind/pybind11.gitfn_build_pybind11
https://github.com/doxygen/doxygen/releases/download/Release_1_9_6/doxygen-1.9.6.src.tar.gz使用 git clone --branch Release_1_9_6 --depth 1 https://gitcode.com/doxygen/doxygen.git 替代 wgetfn_build_doxygen

替换命令:

bash
cd <ATB_REPO_PATH>
sed -i 's|https://github.com/nlohmann/json.git|https://gitcode.com/nlohmann/json.git|g' scripts/build.sh
sed -i 's|https://github.com/google/googletest.git|https://gitcode.com/google/googletest.git|g' scripts/build.sh
sed -i 's|https://github.com/coolxv/cpp-stub.git|https://gitcode.com/coolxv/cpp-stub.git|g' scripts/build.sh
sed -i 's|https://github.com/pybind/pybind11.git|https://gitcode.com/pybind/pybind11.git|g' scripts/build.sh

doxygen 替换说明:doxygen 的 wget 下载需要改为 git clone 方式,修改 fn_build_doxygen 函数:

bash
# 将 wget + tar 方式替换为 git clone
# 原始代码:
#   [[ ! -f "doxygen-1.9.6.src.tar.gz" ]] && wget --no-check-certificate https://github.com/doxygen/doxygen/releases/download/Release_1_9_6/doxygen-1.9.6.src.tar.gz
#   tar -xzvf doxygen-1.9.6.src.tar.gz
#   mv doxygen-1.9.6 doxygen
# 替换为:
#   [[ ! -d "doxygen" ]] && git clone --branch Release_1_9_6 --depth 1 https://gitcode.com/doxygen/doxygen.git
第2步:清理旧构建产物(可选)
bash
cd <ATB_REPO_PATH>
rm -rf build output 3rdparty
第3步:执行全量编译
bash
docker exec <DOCKER_NAME> bash -c "
source <CANN_PATH>/set_env.sh && \
cd <ATB_REPO_PATH> && \
bash scripts/build.sh testframework
"

编译产物验证

编译成功后,检查关键产物:

bash
# 检查测试框架库
ls -lh <ATB_REPO_PATH>/output/atb/cxx_abi_0/lib/libatb_test_framework.so

# 检查 ATB 主库
ls -lh <ATB_REPO_PATH>/output/atb/cxx_abi_0/lib/libatb.so

预期产物:

  • libatb_test_framework.so — 测试框架核心库
  • libatb.so — ATB 主库
  • atb_testframework_<arch>_<timestamp>.tar.gz — 打包文件

编译后环境设置

编译完成后,设置环境变量以运行 CSV 测试:

bash
source <ATB_REPO_PATH>/output/atb/set_env.sh

或手动设置:

bash
export ATB_HOME_PATH=<ATB_REPO_PATH>/output/atb/cxx_abi_0
export LD_LIBRARY_PATH=<ATB_REPO_PATH>/output/atb/cxx_abi_0/lib:$LD_LIBRARY_PATH

运行 CSV 测试

bash
cd <ATB_REPO_PATH>/tests/framework/python/CsvOpsTestTool
python3 atb_csv_ops_test.py -i <csv_file_path> -n <start>:<end>

testframework 构建所需的第三方依赖:

依赖源用途
nlohmannJsongitcode.com/nlohmann/json (v3.11.3)JSON 解析库
Mind-KernelInfra (mki)gitcode.com/cann/ascend-boost-comm内核基础设施
catlassgitcode.com/cann/catlass矩阵运算库
compilerCANN 路径符号链接编译器工具链

注意:testframework 不需要 googletest、cpp-stub、pybind11、doxygen(这些是 unittest/fuzztest/doc 构建模式所需)。但如果使用其他构建模式(如 alltest、unittest),也需要替换对应的 GitHub 源。

CXX ABI 版本

编译时 USE_CXX11_ABI 由 fn_init_env 函数自动检测:

  • 检查系统安装的 torch 是否使用 CXX11 ABI
  • 输出目录为 output/atb/cxx_abi_0/ 或 output/atb/cxx_abi_1/
问题原因解决方案
git clone 失败 (curl 16)GitHub 网络不通替换为 gitcode 镜像源
ASCEND_HOME_PATH is null未 source CANN 环境先执行 source <CANN_PATH>/set_env.sh
libatb_test_framework.so 不存在编译未完成或失败检查编译日志,确保 BUILD_TEST_FRAMEWORK=ON
第三方依赖克隆 403gitcode 仓库路径错误确认 gitcode 上的仓库路径和标签

修改文件后重新编译

当修改了 *_aclnn_runner.cpp、*_operation.cpp 等源码后,需要重新编译:

bash
# 在 Docker 容器内执行(已在容器中)
source $ASCEND_TOOLKIT_HOME/set_env.sh
cd $ATB_REPO_PATH
bash scripts/build.sh testframework 2>&1 | tail -50

注意:确保环境变量已设置:

  • ASCEND_TOOLKIT_HOME(CANN 安装路径,如 /usr/local/Ascend/ascend-toolkit/latest)
  • ATB_REPO_PATH(ATB 仓库路径,如 {your working path}ascend-transformer-boost)

编译失败处理流程:

失败次数操作说明
第1次失败分析日志,定位问题,修复后重新编译正向分析错误原因
第2次失败rm -rf build/ output/ 清理后重新编译清理 cmake 缓存
第3次失败bash scripts/build.sh testframework --clean-first从头编译,完整清理

编译约束规则:

  • 最多验证 3 次:3次均失败时,记录完整错误信息,询问用户
  • Step by Step:每次只修复一个问题,重新编译验证
  • 无法解决时:记录问题并询问用户

编译错误记录模板:

### 编译失败记录 (#N)

**错误信息**:

<编译器输出>


**问题分析**:
<分析原因>

**修改计划**:
1. <修改步骤1>
2. <修改步骤2>

**状态**:待用户确认

执行结果

⚠️ 执行后填写:技能执行完成后,参照下方格式填写实际执行结果。

检查点检查表

步骤检查点描述状态
-CANN 环境 sourced (ASCEND_TOOLKIT_HOME 已设置)✅ PASS / ❌ FAIL / ⏭️ SKIP
-Docker 容器运行中✅ PASS / ❌ FAIL / ⏭️ SKIP
-ATB 源码目录存在✅ PASS / ❌ FAIL / ⏭️ SKIP
1GitHub→gitcode 源替换已应用✅ PASS / ❌ FAIL / ⏭️ SKIP
2libatb.so 编译产物存在✅ PASS / ❌ FAIL / ⏭️ SKIP
2libatb_test_framework.so 编译产物存在✅ PASS / ❌ FAIL / ⏭️ SKIP
2CXX ABI 目录命名正确✅ PASS / ❌ FAIL / ⏭️ SKIP
3ATB_HOME_PATH 指向输出目录✅ PASS / ❌ FAIL / ⏭️ SKIP
3LD_LIBRARY_PATH 包含 ATB lib✅ PASS / ❌ FAIL / ⏭️ SKIP
4CSV 测试可正常启动✅ PASS / ❌ FAIL / ⏭️ SKIP

VERDICT: ✅ SUCCESS / ⚠️ PARTIAL / ❌ FAILED / ⏭️ SKIPPED

问题列表(若有)

等级检查点问题描述建议
🔴 CRITICAL---
🟡 WARNING---

执行摘要

  • 执行时间:
  • 执行环境:
  • ATB_REPO_PATH:
  • 持续时间:
  • 通过率:

Frequently asked questions

What does the Atb Testframework Build AI skill do?

编译 ATB (Ascend Transformer Boost) 测试框架。当用户需要编译 ATB 测试框架、 运行 CSV 测试、或构建 atb_test_framework 时调用。支持全量编译(含第三方依赖克隆与源替换) 和增量编译两种模式。需在 Docker 容器内配合 CANN 环境执行。

Why use Atb Testframework Build on TypingMind?

Because you install it once and use it with any model. Atb Testframework Build is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Atb Testframework Build in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Ascend/agent-skills/tree/master/skills/ascend-transformer-boost/skills/atb-testframework-build. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Atb Testframework Build?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Atb Testframework Build?

As many as you like. As long as a model supports skills, you can use Atb Testframework Build with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Atb Testframework Build AI skill free?

Yes. It is published on GitHub by Ascend under the MulanPSL-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇