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

[opcode][3.11] support CALL_FUNCTION_EX in py311 #362

Merged
merged 3 commits into from
Aug 31, 2023

Conversation

gouzil
Copy link
Member

@gouzil gouzil commented Aug 31, 2023

相关任务:任务 1

单测状态变化:

  • test_10_build_unpack.py ❌ -> ✅

@paddle-bot
Copy link

paddle-bot bot commented Aug 31, 2023

Thanks for your contribution!

@paddle-bot paddle-bot bot added the contributor External developers label Aug 31, 2023
…ort_RETURN_VALUE_py311

# Conflicts:
#	tests/run_all.sh
Comment on lines 2200 to 2201
if len(self.stack) == 1 and isinstance(self.stack.peek(), NullVariable):
self.stack.pop()
Copy link
Member

Choose a reason for hiding this comment

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

这里是不是可以备注一下什么情况下会出现多出来一个Null

Copy link
Member Author

Choose a reason for hiding this comment

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

目前这个测试来看的话是只有LOAD_GLOBAL

Copy link
Member

Choose a reason for hiding this comment

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

但是理论上所有LOAD_GLOBAL出来的null在CALL的时候就应该已经被移除了,RETURN这里应该就没有了,如果还有的话感觉应该是哪里还有些问题

Copy link
Member Author

Choose a reason for hiding this comment

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

从这个单测来看的话没调用CALL, 应该是这其中的某个也需要pop

[transform] OriginCode: build_tuple_unpack_with_call
 31           0 RESUME                   0

 34           2 LOAD_GLOBAL              1 (NULL + build_tuple_unpack_with_call_inner)
             14 BUILD_LIST               0
             16 LOAD_FAST                0 (x)
             18 LIST_EXTEND              1
             20 LOAD_FAST                1 (y)
             22 LIST_EXTEND              1
             24 LIST_TO_TUPLE
             26 CALL_FUNCTION_EX         0
             28 STORE_FAST               2 (z)

 35          30 LOAD_FAST                2 (z)
             32 LOAD_CONST               1 (0)
             34 BINARY_SUBSCR
             44 LOAD_CONST               2 (1)
             46 BINARY_OP                0 (+)
             50 RETURN_VALUE

Copy link
Member Author

Choose a reason for hiding this comment

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

应该要在CALL_FUNCTION_EX下做pop的,写错了

@gouzil gouzil marked this pull request as draft August 31, 2023 11:59
@gouzil gouzil marked this pull request as ready for review August 31, 2023 12:33
@gouzil gouzil requested review from zrr1999 and SigureMo August 31, 2023 12:33
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 🐾

现在的实现和我之前调研的应该是一致的

@gouzil gouzil changed the title [opcode][3.11] support RETURN_VALUE in py311 [opcode][3.11] support CALL_FUNCTION_EX in py311 Aug 31, 2023
@zrr1999 zrr1999 merged commit e156155 into PaddlePaddle:develop Aug 31, 2023
@SigureMo SigureMo deleted the support_RETURN_VALUE_py311 branch August 31, 2023 16:18
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants