news 2026/5/9 15:28:04

CANN工具脚本使用指南

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
CANN工具脚本使用指南

Tools Summary

【免费下载链接】cannbot-skillsCANNBot 是面向 CANN 开发的用于提升开发效率的系列智能体,本仓库为其提供可复用的 Skills 模块。项目地址: https://gitcode.com/cann/cannbot-skills

Scope

  • agent/scripts/estimate_matmul_datamove.pyis a lightweight estimator for matmul data movement and tile-space feasibility.
  • agent/scripts/build_agent_index.pybuilds machine-readable agent indexes from the human-readable example catalogs underagent/references/examples/.
  • agent/scripts/select_kernel_example.pyranks existing kernel examples from the generated kernel index so authoring can start from the right study target faster.
  • agent/scripts/check_kernel_catalog.pychecks thatkernel-catalog.md, the generated kernel index, and the realagent/example/kernels/*.pyfiles still agree.
  • agent/scripts/gen_kernel_skeleton.pygenerates repository-style kernel scaffolds for cube-only, cube->vec, vec->cube, vec->cube->vec, cube->vec->cube->vec, and vec->cube->vec->cube topologies, with topology-specific profile variants.
  • These tools do not launch kernels. They evaluate metadata, formulas, search candidates, or strategy estimates in Python.

Core APIs

  • estimate_percore_datamove(m, n, k, TILEM, TILEN, TILEK, mode, dbuf_left=True, dbuf_right=True, dbuf_l0c=True)
    • Estimates single-core data movement for one fixed loop mode.
    • Validmodevalues areleft_first,right_first, andbalanced.
    • Both operand-tile capacity andL0Coutput-tile capacity are checked before returning a result.
  • estimate_multi_core(m, n, k, m_split, n_split, TILEM, TILEN, TILEK, nonempty_only=False, dbuf_left=True, dbuf_right=True, dbuf_l0c=True)
    • Converts the full problem into a per-core subproblem, tries all three loop modes, and returns the minimum total data movement.
    • nonempty_only=Truecounts only non-empty split blocks;Falsemultiplies by the full split grid.
  • estimate_strategy(m, n, k, num_core, split_mode, min_tile_m=None, min_tile_n=None, dbuf_l0c=True)
    • Brute-force searches split, tile, mode, and legal DBUF combinations.
    • Returns a dictionary withbaseline_datamove,best_datamove,best_results, and a PrettyTable object intable.

Capacity Model

  • Tile-space feasibility usesMAX_TOTAL_TILE_ELEMENTS = 128 * 1024.
  • dbuf_left=Falsehalves only the left-matrix space term.
  • dbuf_right=Falsehalves only the right-matrix space term.
  • L0Coutput-tile feasibility is checked separately with:
    • dbuf_l0c=True:TILEM * TILEN <= 32 * 1024
    • dbuf_l0c=False:TILEM * TILEN <= 64 * 1024
  • DBUF flags affect capacity only; they do not change the contenteditable="false">【免费下载链接】cannbot-skillsCANNBot 是面向 CANN 开发的用于提升开发效率的系列智能体,本仓库为其提供可复用的 Skills 模块。项目地址: https://gitcode.com/cann/cannbot-skills

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

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

ngx_close_accepted_connection

1 定义 ngx_close_accepted_connection 函数 定义在 ./nginx-1.24.0/src/event/ngx_event_accept.cstatic void ngx_close_accepted_connection(ngx_connection_t *c) {ngx_socket_t fd;ngx_free_connection(c);fd c->fd;c->fd (ngx_socket_t) -1;if (ngx_close_socke…

作者头像 李华
网站建设 2026/5/9 15:22:35

星露谷物语2026最新破解版绿色免费下载(steam启动

pc版链接 switch版 速度转存 随时失效 像素间的田园梦&#xff1a;解析《星露谷物语》的开发与核心魅力 在电子游戏日益追求拟真画质与宏大叙事的今天&#xff0c;《星露谷物语》&#xff08;Stardew Valley&#xff09;凭借像素风格与纯粹的模拟经营体验&#xff0c;成为…

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

在视频剪辑工作流中集成AI配音与文案生成的实践

&#x1f680; 告别海外账号与网络限制&#xff01;稳定直连全球优质大模型&#xff0c;限时半价接入中。 &#x1f449; 点击领取海量免费额度 在视频剪辑工作流中集成AI配音与文案生成的实践 对于视频创作者和剪辑师而言&#xff0c;为视频片段撰写解说文案并录制配音是一项…

作者头像 李华
网站建设 2026/5/9 15:21:33

LinkSwift:八大网盘直链解析工具,告别下载限速烦恼

LinkSwift&#xff1a;八大网盘直链解析工具&#xff0c;告别下载限速烦恼 【免费下载链接】Online-disk-direct-link-download-assistant 一个基于 JavaScript 的网盘文件下载地址获取工具。基于【网盘直链下载助手】修改 &#xff0c;支持 百度网盘 / 阿里云盘 / 中国移动云盘…

作者头像 李华