Agent skill

Paddle Phi Kernel

by PaddlePaddle in PaddlePaddle/Paddle

A skill your agent uses when working with Paddle's PHI kernel system: registering new kernels, debugging kernel selection/dispatch, understanding code auto-generation from YAML, or implementing…

Apache-2.0Auto-check passedDevelopment

Install Paddle Phi Kernel

skills CLI
$ npx skills add PaddlePaddle/Paddle --skill paddle-phi-kernel -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install PaddlePaddle/Paddle paddle-phi-kernel --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/PaddlePaddle/Paddle.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/paddle-design-phi-kernel .claude/skills/paddle-phi-kernel && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
paddle-phi-kernel
GitHub stars
24k
Token cost
~656 tokens
SKILL.md length
144 words
Files
5 (incl. references)
Skills in repo
11
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses when working with Paddle's PHI kernel system: registering new kernels, debugging kernel selection/dispatch, understanding code auto-generation from YAML, or implementing…

  • Working with Paddles PHI kernel system: registering new kernels
  • SKILL.md covers Kernel 两级 map 结构, KernelKey 哈希结构, 代码生成管线概览 and 组合算子机制, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Debugging kernel selection/dispatch

What it does

Paddle Phi Kernel is an agent skill from PaddlePaddle/Paddle. Use when working with Paddle's PHI kernel system: registering new kernels, debugging kernel selection/dispatch, understanding code auto-generation from YAML, or implementing operator decomposition via the combination mechanism.

Its SKILL.md is about 660 tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `references/codegen-pipeline.md`, `references/combination-mechanism.md` and `references/kernel-registration.md`).

It sits in Development, covering Deep learning. It works with Python. The repository describes itself as: PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署). The licence is Apache-2.0.

When your agent uses it

  • Working with Paddles PHI kernel system: registering new kernels
  • Debugging kernel selection/dispatch
  • Understanding code auto-generation from YAML
  • Implementing operator decomposition via the combination mechanism

Example prompts

  • “/paddle-phi-kernel”

What it can do on your machine

Read from SKILL.md and the folder at commit 4793e33. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Paddle Phi Kernel loads about 656 tokens when it runs, and up to ~7.7k if it reads all its reference files. Until then it costs about 61 tokens; SKILL.md has 144 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~61
When it runs · the whole SKILL.md, loaded when a task matches
~656
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from PaddlePaddle/Paddle at commit 4793e33, republished under its Apache-2.0 licence (© PaddlePaddle). 144 words, ~656 tokens.

Download SKILL.mdSave it as .claude/skills/paddle-phi-kernel/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
paddle-phi-kernel
description
Use when working with Paddle's PHI kernel system: registering new kernels, debugging kernel selection/dispatch, understanding code auto-generation from YAML, or implementing operator decomposition via the combination mechanism.

PHI Kernel 体系总览

Kernel 两级 map 结构

PHI kernel 在 KernelFactory 单例中以两级 flat_hash_map 存储:

api_name (string)  →  KernelKeyMap
                        ├── KernelKey_1  →  Kernel_1
                        ├── KernelKey_2  →  Kernel_2
                        └── ...
  • 第一级:算子名称(如 "add", "matmul")→ KernelKeyMap
  • 第二级:KernelKey → Kernel 对象(包含函数指针、参数元信息)

KernelKey 哈希结构

KernelKey 由 Backend、DataLayout、DataType 三要素组成,哈希编码为 32-bit 整数:

bit:  31 ─────── 20 | 19 ─── 12 | 11 ── 8 | 7 ── 0
      Extended       DataType    Layout    Backend
  • Backend(bit 0-7): CPU / GPU / GPUDNN / XPU / OneDNN 等
  • DataLayout(bit 8-11): NCHW / NHWC / ANY 等
  • DataType(bit 12-19): FLOAT32 / FLOAT16 / BFLOAT16 / INT64 等
  • Extended(bit 20-31): 保留位,用于未来扩展

代码生成管线概览

PHI 体系通过 YAML 驱动代码生成,覆盖三个子系统:

子系统生成器产出物
C++ API 层api_gen.pypaddle/phi/api/lib/api.cc
动态图函数层eager_gen.pydygraph_functions.cc, nodes.cc
Python-C 映射层python_c_gen.pyeager_op_function.cc

输入 YAML:ops.yaml, backward.yaml, fused_ops.yaml, sparse_ops.yaml, op_compat.yaml

组合算子机制

将 1061 个原生算子分解为约 200 个基础算子(primitive operators),降低分布式 / 编译器 / 新硬件适配成本。

  • 前向分解:DecompInterface → call_decomp_rule() → composite.h 实现
  • 反向分解(VJP):VjpInterface / DecompVjpInterface → call_decomp_vjp() → details.h 实现
  • CustomVJP:为 sigmoid、log_softmax 等数值敏感算子提供手写反向

什么场景看什么文件

场景参考文档
注册新 kernel / 理解宏展开references/kernel-registration.md
调试 kernel 选择 / 分派失败references/kernel-selection.md
理解 YAML → 代码生成流程references/codegen-pipeline.md
开发组合算子 / VJPreferences/combination-mechanism.md

社区源码链接(L3)

  • PHI kernels 根目录: paddle/phi/kernels/
  • Kernel 注册宏: paddle/phi/core/kernel_registry.h
  • KernelFactory: paddle/phi/core/kernel_factory.h, kernel_factory.cc
  • YAML 定义: paddle/phi/ops/yaml/ops.yaml, backward.yaml
  • 代码生成脚本: paddle/phi/api/generator/ — api_gen.py, backward_api_gen.py, tensor_operants_gen.py
  • 组合算子前向: paddle/fluid/primitive/decomp_rule/decomp_rule/composite.h
  • 组合算子反向: paddle/fluid/primitive/decomp_rule/decomp_vjp/details.h

© PaddlePaddle, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in .agents/skills/paddle-design-phi-kernel of PaddlePaddle/Paddle.

  • SKILL.md
  • references/codegen-pipeline.md
  • references/combination-mechanism.md
  • references/kernel-registration.md
  • references/kernel-selection.md

Open the folder on GitHubat commit 4793e33

Compare with similar skills

Paddle Phi Kernel next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Paddle Phi Kernel compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Paddle Phi Kernel this skillPaddlePaddle/Paddle24k—~656Automated safety check: PassApache-2.0
The Art of Debuggingstas00/the-art-of-debugging1.7k—~6.1kAutomated safety check: NotesCC-BY-SA-4.0
ExecuTorch Build Guidepytorch/executorch5.1k—~2.3kAutomated safety check: NotesCustom licence
Code Reviewnstarman/quax143—~3.2kAutomated safety check: PassApache-2.0
Onnxtxtonnx/onnx22k—~1.3kAutomated safety check: PassApache-2.0
ExecuTorch Cortex-M Backendpytorch/executorch5.1k—~872Automated safety check: PassCustom licence

Similar skills

  • The Art of Debugging

    stas00/the-art-of-debugging

    Condensed debugging method and tool recipes for Unix, Python and PyTorch programs: crashes, hangs, segfaults, wrong output, CUDA OOM, NaN values and slowness.

    1.7k GitHub stars~6.1k tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • ExecuTorch Build Guide

    pytorch/executorch

    Builds ExecuTorch from source: the Python package, C++ runtime, model runners, Android and iOS cross-compilation and backend-specific builds, with environment checks.

    5.1k GitHub stars~2.3k tokensUpdated today
    DevelopmentAuto-check: notes
  • Code Review

    nstarman/quax

    A skill your agent uses when reviewing a pull request or diff in the quax repository.

    143 GitHub stars~3.2k tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Onnxtxt

    onnx/onnx

    Read or write ONNX text format ("onnxtxt"). An agent skill from onnx/onnx.

    22k GitHub stars~1.3k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • ExecuTorch Cortex-M Backend

    pytorch/executorch

    Developer guide for the Cortex-M (CMSIS-NN) backend in ExecuTorch: quantization pipeline, pass manager, tests and adding new ops.

    5.1k GitHub stars~872 tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Formatting

    brendanhasz/probflow

    Ensure consistent code formatting using the uv package manager and pre-commit.

    175 GitHub stars~381 tokensUpdated 11 days ago
    AI & LLM EngineeringAuto-check passed

More from PaddlePaddle/Paddle

All 11 skills in this repo
  • Paddle Build

    PaddlePaddle/Paddle

    A skill your agent uses when needing to compile, rebuild, or install Paddle from source after code changes.

    24k GitHub stars~1k tokensUpdated 8 days ago
    Auto-check passed
  • Paddle Design Compiler

    PaddlePaddle/Paddle

    A skill your agent uses when working with Paddle 3.0 compiler full pipeline: SOT (Symbolic Opcode Translator) for bytecode-level dy2st graph capture, PIR (Paddle IR) for SSA-based intermediate…

    24k GitHub stars~3.6k tokensUpdated 8 days ago
    Auto-check passed
  • Paddle Design Distributed

    PaddlePaddle/Paddle

    A skill your agent uses when working with Paddle's distributed training system: understanding parallelism strategies (DP, ZeRO, TP, PP, SP), semi-automatic parallel with ProcessMesh + shardtensor…

    24k GitHub stars~660 tokensUpdated 8 days ago
    Auto-check passed
  • Paddle Eager Graph

    PaddlePaddle/Paddle

    A skill your agent uses when navigating Paddle eager-mode (dynamic graph) source code, tracing forward/backward execution, debugging autograd issues, understanding PyLayer, or investigating…

    24k GitHub stars~562 tokensUpdated 8 days ago
    Auto-check passed
  • Paddle Debug

    PaddlePaddle/Paddle

    在 Paddle 代码库中定位问题并输出高质量调试报告的专用技能。当遇到以下场景时优先使用:(1) Paddle 框架 bug 调试,(2) 算子实现问题排查,(3) 训练脚本异常诊断,(4) 分布式训练故障定位,(5) CUDA/GPU 相关错误处理,(6) 需要生成结构化调试报告。

    24k GitHub stars~1.4k tokensUpdated 8 days ago
    Auto-check passed
  • Paddle Op Dev

    PaddlePaddle/Paddle

    PaddlePaddle (飞桨) C++ 算子开发指南。提供从 YAML 配置、InferMeta 函数、Kernel 实现、Python API 封装、单元测试到编译验证的完整算子开发流程指导。在以下场景使用此 skill:(1) 为 Paddle 框架新增 C++ 算子 (2) 修改或调试已有 Paddle 算子 (3) 编写算子的 YAML…

    24k GitHub stars~1.3k tokensUpdated 8 days ago
    Auto-check passed

Works with

Questions about Paddle Phi Kernel

What does Paddle Phi Kernel do?

A skill your agent uses when working with Paddle's PHI kernel system: registering new kernels, debugging kernel selection/dispatch, understanding code auto-generation from YAML, or implementing…. Paddle Phi Kernel is an agent skill from PaddlePaddle/Paddle. Use when working with Paddle's PHI kernel system: registering new kernels, debugging kernel selection/dispatch, understanding code auto-generation from YAML, or implementing operator decomposition via the combination mechanism.

When should I use Paddle Phi Kernel?

Paddle Phi Kernel fits situations like: working with Paddles PHI kernel system: registering new kernels; debugging kernel selection/dispatch; understanding code auto-generation from YAML; implementing operator decomposition via the combination mechanism.

How do I install Paddle Phi Kernel in Claude Code?

Run `npx skills add PaddlePaddle/Paddle --skill paddle-phi-kernel -a claude-code`. Or copy the skill folder (.agents/skills/paddle-design-phi-kernel in PaddlePaddle/Paddle) into .claude/skills/paddle-phi-kernel in your project. Claude Code loads it when a task matches its description.

How do I install Paddle Phi Kernel in Codex?

Run `npx skills add PaddlePaddle/Paddle --skill paddle-phi-kernel -a codex`. Or copy the skill folder (.agents/skills/paddle-design-phi-kernel in PaddlePaddle/Paddle) into .agents/skills/paddle-phi-kernel in your project. Codex loads it when a task matches its description.

Can I use Paddle Phi Kernel in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add PaddlePaddle/Paddle --skill paddle-phi-kernel -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/paddle-phi-kernel, .gemini/skills/paddle-phi-kernel, .github/skills/paddle-phi-kernel and .opencode/skills/paddle-phi-kernel in your project.

What does Paddle Phi Kernel need to run?

SKILL.md names no scripts, command-line tools or credentials: Paddle Phi Kernel is instructions for the agent only.

Does Paddle Phi Kernel access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Paddle Phi Kernel safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Paddle Phi Kernel use?

Paddle Phi Kernel is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Paddle Phi Kernel use?

About 656 tokens (SKILL.md is roughly 2.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 7k tokens, read only when the agent opens those files.

What are the alternatives to Paddle Phi Kernel?

Skills that share tags, products or a category with Paddle Phi Kernel: The Art of Debugging (stas00/the-art-of-debugging, 1.7k stars), ExecuTorch Build Guide (pytorch/executorch, 5.1k stars), Code Review (nstarman/quax, 143 stars) and Onnxtxt (onnx/onnx, 22k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Paddle Phi Kernel?

PaddlePaddle (a GitHub organization) maintains it in PaddlePaddle/Paddle, which has 24,120 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on September 30, 2026.

Source: PaddlePaddle/Paddle on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.