paddle-phi-kernel
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 整数:
More from pfcclab/paddle-skills
paddle-pull-request
|
30paddle-debug
专注于在 Paddle 代码库中定位问题并输出高质量调试报告的调试流程与技巧;代码修复是在结论充分后的后续步骤。遇到 Paddle 框架、算子、训练脚本或分布式训练相关问题时,优先使用本 skill 规划调试与报告输出。
24fastdeploy-pull-request
|
20paddle-pir-cinn
Use when working with Paddle's new IR system (PIR) or CINN compiler: understanding SSA-based Program structure, Dialect/Type/Attribute design, writing or debugging Passes, tracing the CINN compilation pipeline from GroupOp to CUDA kernel, or translating legacy ProgramDesc to PIR.
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