Torchtalk Traceのロゴ

Torchtalk Trace

組織
opendatahub-io
torchtalk-trace

PyTorch関数の複数言語にまたがるバインディングチェーンを追跡します(Python -> C++ -> CUDA)。

概要

公開者opendatahub-io
リポジトリai-helpers
スキル名torchtalk-trace
スター
39
フォーク
76
同梱ファイル
指示のみ
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    opendatahub-ioがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Torchtalk Trace」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

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-trace
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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-trace .claude/skills/torchtalk-trace
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでTorchtalk Traceを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にTorchtalk Traceを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Torchtalk Traceは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Name

odh-ai-helpers:torchtalk-trace

Synopsis

/torchtalk:trace <function-name>
/torchtalk:trace <function-name> full
/torchtalk:trace <function-name> dispatch
/torchtalk:trace <function-name> yaml

Description

The torchtalk:trace command traces a PyTorch function's complete binding chain from Python through C++ to CUDA implementations. It uses the TorchTalk MCP server to look up operator definitions in native_functions.yaml, find pybind11 and TORCH_LIBRARY bindings, and map dispatch keys to backend implementations.

After gathering the raw binding data, the command analyzes the results to explain:

  • How the Python API connects to the native implementation
  • Which dispatch keys route to which backends (CPU, CUDA, MPS, etc.)
  • Where each layer is implemented with exact file:line references
  • The autograd integration and backward pass formula (if applicable)
  • Architectural context about why the dispatch is structured this way

This command requires the TorchTalk MCP server to be running. Run mcp__torchtalk__get_status to verify availability.

Prerequisites

  • TorchTalk MCP server must be running and registered with Claude Code
  • Run /torchtalk:setup if not yet installed

Implementation

  1. Verify MCP server: Call mcp__torchtalk__get_status to confirm the TorchTalk server is running and has indexed data available
  2. Trace binding chain: Call mcp__torchtalk__trace with the function name and optional focus parameter to retrieve the full binding chain
  3. Get internal dependencies: Call mcp__torchtalk__calls with the function name to understand what the function invokes internally
  4. Analyze dispatch architecture: Examine the dispatch keys, backend routing, and structured binding patterns returned by the trace
  5. Synthesize explanation: Combine the trace data, call graph, and dispatch information into a coherent explanation that covers:
    • The Python entry point and how it connects to native code
    • The native_functions.yaml definition and its dispatch configuration
    • Each backend implementation with file:line references
    • The autograd formula (from derivatives.yaml) if applicable
    • Architectural observations about the operator's design
  6. Provide file references: Format all implementation locations as file:line references so the developer can navigate directly to the source

Return Value

  • Claude agent text: A structured analysis of the function's binding chain, organized by layer (Python -> YAML definition -> C++ dispatch -> backend implementations), with file:line references and architectural commentary

Examples

  1. Trace a common operator:

    /torchtalk:trace matmul

    Output: Full binding chain from torch.matmul through at::native::matmul to LinearAlgebra.cpp, including CPU and CUDA dispatch paths.

  2. Focus on dispatch mapping only:

    /torchtalk:trace conv2d dispatch

    Output: Which backends handle conv2d and where each kernel is registered.

  3. Focus on YAML definition:

    /torchtalk:trace softmax yaml

    Output: The native_functions.yaml entry for softmax, including its function schema, dispatch keys, and derivative formula.

  4. Full deep trace:

    /torchtalk:trace add full

    Output: Complete trace from Python API through every layer including structured kernel registrations, autograd formula, and all backend implementations.

Arguments

  • <function-name>: The PyTorch function name to trace (e.g., matmul, conv2d, softmax, add). Can be a short name or fully qualified (e.g., at::native::matmul).
  • [focus]: Optional focus parameter. One of:
    • full (default): Complete binding chain across all layers
    • dispatch: Only dispatch key to backend mapping
    • yaml: Only the native_functions.yaml definition

See Also

  • /torchtalk:setup - Install and configure TorchTalk
  • TorchTalk Analyzer skill - Full MCP tools reference including impact analysis, call graph, and test infrastructure

よくある質問

AIスキル「Torchtalk Trace」では何ができますか?

PyTorch関数の複数言語にまたがるバインディングチェーンを追跡します(Python -> C++ -> CUDA)。

TypingMindでTorchtalk Traceを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Torchtalk Traceはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにTorchtalk Traceをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-pytorch/skills/torchtalk-traceを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Torchtalk Traceを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Torchtalk Traceで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもTorchtalk Traceを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Torchtalk Trace」は無料ですか?

はい。opendatahub-ioがApache-2.0ライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇