Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.
This repository was archived by the owner on Jan 24, 2024. It is now read-only.

优化 eval_frame 对 Paddle 函数的 skip 机制 #93

@SigureMo

Description

@SigureMo

目前我们会在 eval frame 的 callback 入口处检查是否是 Paddle 的函数,如果是则直接跳过,相关逻辑如下:

https://github.com/2742195759/paddle-symbolic-trace/blob/6b77ad2326d74a91e80009699b30aa27137f774d/symbolic_trace/opcode_translator/transform.py#L9

https://github.com/2742195759/paddle-symbolic-trace/blob/6b77ad2326d74a91e80009699b30aa27137f774d/symbolic_trace/opcode_translator/skip_files.py#L93

paddle.nn.Layer.__call__ 这个函数也会被这个规则跳过,而所有继承自 Layer 的网络都会去找到这个 paddle.nn.Layer.__call__ 来作为函数入口,所以我们现在还不支持使用 symbolic_trace 函数直接装饰,需要一些 trick,用函数包装一下,如:

https://github.com/2742195759/paddle-symbolic-trace/blob/6b77ad2326d74a91e80009699b30aa27137f774d/tests/test_17_paddle_layer.py#L18-L19

我们希望优化 Paddle 相关函数的 skip 机制,以支持直接装饰 paddle.nn.Layer

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions