Torchtalk Analyzer 标志

Torchtalk Analyzer

组织
opendatahub-io
torchtalk-analyzer

使用 TorchTalk MCP server,分析 PyTorch 在 Python、C++ 和 CUDA 各层的内部实现。适用于询问 PyTorch 运算符的内部工作原理、函数的实现位置、修改代码会导致哪些功能失效,或查找 PyTorch 运算符测试的情况。

概览

发布者opendatahub-io
代码仓库ai-helpers
技能名称torchtalk-analyzer
星标数
39
复刻数
76
附带文件
仅含指令
许可协议Apache-2.0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 opendatahub-io 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Torchtalk Analyzer AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-pytorch/skills/torchtalk-analyzer
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/opendatahub-io/ai-helpers.git /tmp/ai-helpers
mkdir -p .claude/skills
cp -r /tmp/ai-helpers/plugins/odh-pytorch/skills/torchtalk-analyzer .claude/skills/torchtalk-analyzer
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Torchtalk Analyzer,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Torchtalk Analyzer。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Torchtalk Analyzer 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

TorchTalk Analyzer

This skill enables cross-language analysis of PyTorch internals by leveraging the TorchTalk MCP server. It traces binding chains from Python through C++ to CUDA, analyzes dispatch mechanisms, maps call graphs, and locates test infrastructure.

When to Use

  • When asked how a PyTorch operator works internally (e.g., "How does torch.add dispatch to CUDA?")
  • When investigating where a function is implemented across CPU/CUDA/MPS backends
  • When assessing what would break if a C++ function is modified (impact analysis)
  • When tracing how torch.nn modules connect to native ATen operators
  • When finding existing tests for a PyTorch operator or function
  • When exploring PyTorch's dispatch architecture or autograd integration

Prerequisites

  • TorchTalk MCP server must be running and registered with Claude Code
  • PyTorch source code must be available locally
  • Run /torchtalk:setup if TorchTalk is not yet installed

Verify availability:

text
mcp__torchtalk__get_status

If the status tool returns data, all tools below are ready.

Instructions

Step 1 - Verify MCP Server

Before using any tools, confirm the TorchTalk server is running:

text
mcp__torchtalk__get_status

Check that:

  • Bindings are loaded (should show thousands of bindings)
  • Native functions are parsed
  • C++ call graph status is "Ready" (required for impact/calls/called_by)
  • Python modules are loaded (required for trace_module/list_modules)

If the server is not available, direct the user to run /torchtalk:setup.


Step 2 - Identify the Analysis Type

Match the user's question to the appropriate tool:

Question PatternToolExample
"How does X work?" / "Trace X"mcp__torchtalk__tracetrace("softmax", "full")
"Find functions matching X"mcp__torchtalk__searchsearch("conv", "CUDA")
"Where are the CUDA kernels for X?"mcp__torchtalk__cuda_kernelscuda_kernels("softmax")
"What does X call?"mcp__torchtalk__callscalls("at::native::add")
"What calls X?"mcp__torchtalk__called_bycalled_by("at::native::add")
"What breaks if I change X?"mcp__torchtalk__impactimpact("at::native::add", 3)
"How does nn.Linear work?"mcp__torchtalk__trace_moduletrace_module("Linear")
"List all nn modules"mcp__torchtalk__list_moduleslist_modules("nn")
"Find tests for X"mcp__torchtalk__find_similar_testsfind_similar_tests("softmax")
"What test utilities exist?"mcp__torchtalk__list_test_utilslist_test_utils("all")
"What tests are in file X?"mcp__torchtalk__test_file_infotest_file_info("test_torch")

Step 3 - Execute and Synthesize

For simple lookups, a single tool call suffices. For deeper questions, combine multiple tools:

"How does torch.softmax work end-to-end?"

  1. mcp__torchtalk__trace("softmax", "full") - Get the binding chain
  2. mcp__torchtalk__cuda_kernels("softmax") - Find GPU kernels
  3. mcp__torchtalk__calls("at::native::softmax") - See internal dependencies

"What breaks if I modify at::native::add?"

  1. mcp__torchtalk__impact("at::native::add", 3) - Transitive callers
  2. mcp__torchtalk__find_similar_tests("add") - Affected tests

"How does nn.Linear connect to native code?"

  1. mcp__torchtalk__trace_module("Linear") - Module definition
  2. mcp__torchtalk__trace("linear", "full") - Native operator chain

Step 4 - Present Results

Format results with:

  • Clear layer separation (Python -> YAML -> C++ -> CUDA)
  • file:line references for every implementation location
  • Architectural context explaining why the dispatch is structured this way
  • Suggestions for further exploration if the user wants to go deeper

MCP Tools Reference

ATen Operators

ToolParametersDescription
mcp__torchtalk__tracefunction_name, focus?Trace Python to C++ binding chain. Focus: "full", "yaml", "dispatch"
mcp__torchtalk__searchquery, backend?, limit?Find bindings by name with optional backend filter
mcp__torchtalk__cuda_kernelsfunction_name?Find GPU kernel launches with file:line

C++ Call Graph

ToolParametersDescription
mcp__torchtalk__impactfunction_name, depth?Transitive callers + Python entry points (depth 1-5)
mcp__torchtalk__callsfunction_nameFunctions this function invokes (outbound)
mcp__torchtalk__called_byfunction_nameFunctions that invoke this (inbound)

Python Modules

ToolParametersDescription
mcp__torchtalk__trace_modulemodule_nameTrace torch.nn.Linear, torch.optim.Adam, etc.
mcp__torchtalk__list_modulescategory?List modules: "nn" (default), "optim", "all", or search query

Test Infrastructure

ToolParametersDescription
mcp__torchtalk__find_similar_testsquery, limit?Find tests for an operator or concept
mcp__torchtalk__list_test_utilscategory?List test utilities: "all" (default), "fixtures", "assertions", "decorators"
mcp__torchtalk__test_file_infofile_pathDetails about a specific test file

Error Handling

  • MCP server not running: Direct user to /torchtalk:setup
  • "C++ call graph not available": PyTorch needs to be built once (python setup.py develop) to generate compile_commands.json
  • "Function not found": Use mcp__torchtalk__search with partial names, or check spelling
  • "Test infrastructure not loaded": Verify PyTorch source path is correct with torchtalk status

常见问题

Torchtalk Analyzer AI 技能有什么作用?

使用 TorchTalk MCP server,分析 PyTorch 在 Python、C++ 和 CUDA 各层的内部实现。适用于询问 PyTorch 运算符的内部工作原理、函数的实现位置、修改代码会导致哪些功能失效,或查找 PyTorch 运算符测试的情况。

为什么在 TypingMind 中使用 Torchtalk Analyzer?

因为您只需安装一次,就能搭配任何模型使用。Torchtalk Analyzer 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Torchtalk Analyzer?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-pytorch/skills/torchtalk-analyzer。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Torchtalk Analyzer?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Torchtalk Analyzer 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Torchtalk Analyzer 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Torchtalk Analyzer AI 技能免费吗?

是的。opendatahub-io 已在 GitHub 上根据 Apache-2.0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇