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

[Compat][3.11] support call breakgraph #369

Merged
merged 16 commits into from
Sep 3, 2023
Merged

Conversation

zrr1999
Copy link
Member

@zrr1999 zrr1999 commented Sep 2, 2023

本PR改动如下:

  1. 实现 calc_stack_effect 函数,因为 dis.stack_effect 在 Python3.11 下对 CALL 字节码的计算不符合逻辑,结果恒为 -1,因此实现自定义的calc_stack_effect计算 stack_effect值,也可以为后续其他版本适配起到一定帮助。
  2. 实现 VariableStack的iter方法,简化代码。
  3. 实现 PyCodeGen 的 gen_shift_n 方法,用于简化字节码生成,目前可以简化 Python3.11 下的两次rot_n操作
  4. 为 gen_load_object 添加 push_null参数,使得当obj为NULL时可以保证push_null=False不会多传入NULL
  5. 开启部分测试
    • test_01_basic 🚧 -> ✅
    • test_04_list 🚧 -> ✅
    • test_05_dict 🚧 -> ✅
    • test_14_operators 🚧 -> ✅
    • test_18_tensor_method ❌ -> ✅
    • test_break_graph ❌ -> ✅
    • test_builtin_dispatch ❌ -> ✅
    • test_exception ❌ -> ✅
    • test_execution_base ❌ -> ✅
    • test_str_format ❌ -> ✅

@paddle-bot
Copy link

paddle-bot bot commented Sep 2, 2023

Thanks for your contribution!

@paddle-bot paddle-bot bot added the contributor External developers label Sep 2, 2023
@zrr1999 zrr1999 marked this pull request as draft September 2, 2023 09:30
improve stack

fix bug

fix

fix
@zrr1999 zrr1999 marked this pull request as ready for review September 2, 2023 12:16
@zrr1999 zrr1999 requested review from gouzil and SigureMo and removed request for gouzil September 2, 2023 12:16
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其余没什么问题了~

sot/opcode_translator/executor/opcode_executor.py Outdated Show resolved Hide resolved
sot/opcode_translator/executor/opcode_executor.py Outdated Show resolved Hide resolved
sot/opcode_translator/executor/pycode_generator.py Outdated Show resolved Hide resolved
@SigureMo
Copy link
Member

SigureMo commented Sep 2, 2023

喔喔 PR 描述里最好写详细一些,还是蛮有用的,比如之前和震哥讨论的时候也是翻 PR 回忆了下 NullVariable 相关的改动(#159),震哥 PR 描述一般写的都比较清晰的,包括整个 PR 的动机和具体改动,也能帮助新同学来熟悉整个项目(比如我在看到动转静代码里如果有某些奇怪的地方就会去翻当时的 PR)

SigureMo
SigureMo previously approved these changes Sep 2, 2023
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMeow 🐾

@zrr1999
Copy link
Member Author

zrr1999 commented Sep 2, 2023

喔喔 PR 描述里最好写详细一些,还是蛮有用的,比如之前和震哥讨论的时候也是翻 PR 回忆了下 NullVariable 相关的改动(#159),震哥 PR 描述一般写的都比较清晰的,包括整个 PR 的动机和具体改动,也能帮助新同学来熟悉整个项目(比如我在看到动转静代码里如果有某些奇怪的地方就会去翻当时的 PR)

改完啦

Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! LGTMeow 🐾

@zrr1999 zrr1999 merged commit 0eca0d8 into PaddlePaddle:develop Sep 3, 2023
9 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants