paddle-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.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "paddle-eager-graph" with this command: npx skills add pfcclab/paddle-skills/pfcclab-paddle-skills-paddle-eager-graph

Paddle 动态图(Eager Mode)导航索引

Paddle 动态图边执行边建图:前向执行时构建反向图,调用 backward() 时按拓扑序执行反向图。

前向调用链路

Python paddle.add(x, y)
  │
  ▼
① ops_api.cc          ─ Python-C 映射,GetTensorFromArgs 提取 Tensor
  ▼
② eager_op_function.cc ─ 参数解析 / Dist Tensor / 释放 GIL / backend 选择
  ▼
③ dygraph_functions.cc ─ AMP / Type Promotion / 创建 GradNode / 构建反向图
  ▼
④ api.cc              ─ KernelKey 构造 / Kernel 选择 / PrepareData / InferMeta
  ▼
⑤ PHI Kernel 执行

关键文件表

层级代码路径代码生成器
① Python-C 映射paddle/fluid/pybind/ops_api.ccops_api_gen.py
② 动态图 C++ 接口paddle/fluid/pybind/eager_op_function.ccpython_c_gen.py
③ 自动微分函数paddle/fluid/eager/api/generated/.../dygraph_functions.cceager_gen.py
④ PHI 算子库接口paddle/phi/api/lib/api.cctensor_operants_gen.py

反向关键数据结构

数据结构一句话描述
AutogradMetaTensor 持有的反向元信息:梯度、来源 GradNode、slot/rank 位置
GradNodeBase反向节点基类,纯虚 operator() 执行反向计算
GradSlotMeta描述 GradNode 某个 slot 的 meta 信息与出边 Edge
Edge指向后继 GradNode 的边,含 in_slot_id_in_rank_
TensorWrapperGradNode 中保存前向 Tensor 的包装器,含 inplace 版本快照
GradTensorHolder反向执行期间临时存放与聚合梯度的二维 buffer

调试场景速查

调试场景阅读哪个参考文档
前向调用链路 / Kernel 选择问题forward-call-chain.md
反向梯度不正确 / 拓扑排序问题backward-execution.md
数据结构成员 / 内存泄漏排查autograd-data-structs.md
自定义反向 PyLayerpylayer.md
复数梯度 / Wirtinger 导数complex-autograd.md
Inplace 操作 / 版本追踪inplace.md

社区资料(L3 层)

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

paddle-pull-request

No summary provided by upstream source.

Repository SourceNeeds Review
General

paddle-debug

No summary provided by upstream source.

Repository SourceNeeds Review
General

fastdeploy-pull-request

No summary provided by upstream source.

Repository SourceNeeds Review
General

paddle-pir-cinn

No summary provided by upstream source.

Repository SourceNeeds Review