paddle-pir-cinn
PIR & CINN 编译器
PIR (Paddle Intermediate Representation) 是 Paddle 的新一代中间表示,采用 MLIR 风格的 SSA 设计;CINN 是基于 PIR 的算子编译器,将高层算子编译为高性能 CUDA Kernel。
PIR 核心概念速查
| 概念 | 关键类 | 说明 |
|---|---|---|
| Type | TypeID / AbstractType / TypeStorage / Type |
类型系统:TypeID 用 static 变量地址做唯一标识,Type 本质是指向 TypeStorage 的指针,相等性通过指针比较 |
| Value | ValueImpl / OpResultImpl / OpOperandImpl |
SSA 值系统:OpResult 是算子输出(inline 0-5 / out-of-line),OpOperand 通过侵入式双向链表管理 use-chain |
| Operation | Operation (连续内存布局) |
核心执行单元:`[OutOfLineResults |
| Block/Region | Block / Region |
Block 持有 Operation 列表 + BlockArgument + terminator;Region 是 Block 的容器,约束 Value 作用域 |
| Dialect | BuiltinDialect / PaddleDialect / CinnDialect |
模块化容器:聚合一组 Type、Attribute、Op 定义,支持独立注册与扩展 |
CINN 4 阶段编译流水线
PIR Program (pd_op.*)
│
More from pfcclab/paddle-skills
paddle-pull-request
|
30paddle-debug
专注于在 Paddle 代码库中定位问题并输出高质量调试报告的调试流程与技巧;代码修复是在结论充分后的后续步骤。遇到 Paddle 框架、算子、训练脚本或分布式训练相关问题时,优先使用本 skill 规划调试与报告输出。
24fastdeploy-pull-request
|
20paddle-phi-kernel
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.
5paddle-eager-graph
Use when navigating Paddle eager-mode (dynamic graph) source code, tracing forward/backward execution, debugging autograd issues, understanding PyLayer, or investigating complex-valued gradient computation. Covers Python API to C++ kernel call chain, backward graph topology sort, and inplace version tracking.
5paddle-static-graph
Use when working with Paddle's static graph mode: understanding Program/Block/Op/Var data structures, tracing the executor lifecycle from graph construction to scheduling, debugging InterpreterCore issues, or analyzing operator dependency and variable lifetime management.
4