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.

_C_ops 断言检查功能 #248

@SigureMo

Description

@SigureMo

背景

我们在模拟执行的时候,会判断一个函数是否是 Paddle 组网 API,将组网 API 放入 SIR 中,而非组网 API 则会 inline call 模拟执行字节码

但由于我们现在用于判读一个 API 是否是组网 API 的逻辑仍然不够 robust,总有一些情况会导致部分组网 API 误走模拟执行逻辑

我们的组网 API 基本都是动静统一的,这些 API 长这个样子:

def foo():
    if in_dygraph_mode():
        _C_ops.xxx()
    else:
        append_op("xxx")

我们模拟执行的时候一定会走动态图分支,即运行到 _C_ops,而模拟执行到 _C_ops 我们也是可以跑的,但会导致一些难以定位的问题,因此希望能够检测这一问题

任务描述

当模拟执行遇到 _C_ops_legacy_C_ops 时候报错,即添加断言不允许模拟执行 _C_ops 逻辑,提前暴露问题

Metadata

Metadata

Assignees

Labels

🐾 meow快乐喵喵开源活动专属认证

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions