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

_C_ops 断言检查功能 #248

Open
SigureMo opened this issue Jul 6, 2023 · 0 comments
Open

_C_ops 断言检查功能 #248

SigureMo opened this issue Jul 6, 2023 · 0 comments
Assignees
Labels
🐾 meow 快乐喵喵开源活动专属认证

Comments

@SigureMo
Copy link
Member

SigureMo commented Jul 6, 2023

背景

我们在模拟执行的时候,会判断一个函数是否是 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 逻辑,提前暴露问题

@SigureMo SigureMo added the good first issue Good for newcomers label Jul 6, 2023
@zrr1999 zrr1999 self-assigned this Jul 7, 2023
@SigureMo SigureMo added 🐾 meow 快乐喵喵开源活动专属认证 and removed good first issue Good for newcomers labels Jul 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐾 meow 快乐喵喵开源活动专属认证
Projects
None yet
Development

No branches or pull requests

2 participants