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

Python3.11 支持任务汇总 #360

Closed
zrr1999 opened this issue Aug 30, 2023 · 1 comment
Closed

Python3.11 支持任务汇总 #360

zrr1999 opened this issue Aug 30, 2023 · 1 comment
Labels
PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc

Comments

@zrr1999
Copy link
Member

zrr1999 commented Aug 30, 2023

Python 3.11 支持总体规划见 #357
针对特定的单测可能需要实现新的字节码或修改已有字节码以支持Python3.11,因此每认领一个A任务需要搭配若干个BC任务。

单测任务

序号 单测名称 报错信息 错误初步分析 参考难度 认领人 PR 链接
A.1 test_10_build_unpack.py AssertionError: Stack must have one element, but get 2 elements. Python 3.11 在 LOAD 时候多 PUSH 了一个 NULL,因此在最后需要 POP 掉,可参考 Python 3.10 和 3.11 CALL_FUNCTION_EX 实现差异 @gouzil #362
A.2 test_11_jumps.py sot.utils.exceptions.NotImplementException: opcode: POP_JUMP_FORWARD_IF_FALSE is not supported. Python 3.11 增加了很多新的 JUMP 相关字节码,需要对相关字节码进行实现,也要对现有的字节码进行适配,新增字节码应该增加新的单测 ⭐⭐ @zrr1999 #361
A.3 test_11_jumps.py sot.utils.exceptions.NotImplementException: [Fallback] An exception occurred when processing break graph, fallback to dygraph, error message is: <class 'KeyError'> : 'JUMP_ABSOLUTE' Python 3.11 移除了 JUMP_ABSOLUTE 原有的子图打断逻辑中使用的 JUMP_ABSOLUTE 已经不再适用了,需要对子图打断逻辑进行适配 ⭐⭐⭐ @zrr1999 #368
A.4 test_12_for_loop.py KeyError: 'JUMP_ABSOLUTE' For 循环逻辑需要适配 ⭐⭐⭐⭐🐾 @zrr1999 #371
A.5 test_13_make_function.py IndexError: pop from empty list 可以查看下 MAKE_FUNCTION 的差异 @gouzil #356
A.6 test_14_operators.py AttributeError: 'OpcodeExecutor' object has no attribute 'BINARY_REMAINDER' 修改BINARY_OP 中 opname 处理方式,将 REMAINDER 替换为 Python 字节码中的 MUDULO 即可 @gouzil #358
A.7 test_15_slice.py KeyError: 'JUMP_ABSOLUTE' 同样依赖于子图打断 @zrr1999 #371
A.8 test_17_paddle_layer.py [BreakGraph] call function Break graph: <function Layer.__call__ at 0x1307ec9a0> is raise a inline call error. opcode: POP_JUMP_FORWARD_IF_TRUE is not supported. 应该只是新的 JUMP 字节码没支持,但不知道还有没有其他问题 ⭐⭐🐾 @gouzil #365
A.9 test_str_format.py KeyError: 'JUMP_ABSOLUTE' 同样是发生了子图打断,可以从两方面入手,一是考虑是否能够避免子图打断,另一方面就是等待子图打断功能完成 ⭐⭐ @zrr1999 #369
A.10 test_side_effects.py KeyError: 'CALL_METHOD' SideEffect 场景生成的 CALL_METHOD 在 Python 3.11 已经删除了,需要适配生成的代码 @SigureMo #355
A.11 test_19_closure.py opcode: MAKE_CELL is not supported. Closure 实现需要适配,需要实现新增的字节码 ⭐⭐⭐ @gouzil #372
A.12 test_21_global.py KeyError: 'JUMP_ABSOLUTE' 需要对 For 循环进行适配 @zrr1999 #371
A.13 test_constant_graph.py 段错误 待查明 🐾 @SigureMo #375
A.14 test_enumerate.py KeyError: 'JUMP_ABSOLUTE' 需要对 For 循环进行适配 @zrr1999 #371
A.15 test_guard_user_defined_fn.py sot.utils.exceptions.NotImplementException: Currently don't support predicate a non-const / non-tensor obj, but got PaddleApiVariable(relu, fn, object_0) 看样子像是模拟执行跑错了 ⭐⭐⭐ @SigureMo #377
A.16 test_inplace_api.py KeyError: 'JUMP_ABSOLUTE' 需要对 For 循环进行适配 @zrr1999 #371
A.17 test_range.py KeyError: 'JUMP_ABSOLUTE' 需要对 For 循环进行适配 @zrr1999 #371
A.18 test_tensor_dtype_in_guard.py 段错误 疑似 with 引发的段错误 ⭐⭐⭐⭐⭐⭐⭐⭐ @SigureMo PaddlePaddle/Paddle#57490

字节码优化任务

序号 字节码名称 认领人 PR
B.1 GET_AWAITABLE
B.2 POP_EXCEPT
B.3 ✅ JUMP_IF_TRUE_OR_POP @zrr1999 #361
B.4 ✅ JUMP_IF_FALSE_OR_POP @zrr1999 #361
B.5 ✅ LOAD_GLOBAL @SigureMo #303
B.6 DELETE_DEREF
B.7 ✅ STORE_DEREF @gouzil #372
B.8 LOAD_CLASSDEREF
B.9 ✅ LOAD_DEREF @gouzil #372
B.10 ✅ LOAD_CLOSURE @gouzil #372
B.11 RERAISE
B.12 END_ASYNC_FOR
B.13 MATCH_CLASS
B.14 MATCH_KEYS

字节码实现任务

序号 字节码名称 认领人 PR
C.1 ✅ COPY @SigureMo #339
C.2 ✅ SWAP @SigureMo #339
C.3 CACHE 辅助数据,非指令
C.4 ✅ BINARY_OP @SigureMo #303
C.5 PUSH_EXC_INFO
C.6 CHECK_EXC_MATCH
C.7 CHECK_EG_MATCH
C.8 PREP_RERAISE_STAR
C.9 BEFORE_WITH
C.11 ✅ JUMP_BACKWARD @zrr1999 #361
C.12 ✅ JUMP_BACKWARD_NO_INTERRUPT @zrr1999 #361
C.13 ✅ POP_JUMP_FORWARD_IF_TRUE @zrr1999 #361
C.14 ✅ POP_JUMP_BACKWARD_IF_TRUE @zrr1999 #361
C.15 ✅ POP_JUMP_FORWARD_IF_FALSE @zrr1999 #361
C.16 ✅ POP_JUMP_BACKWARD_IF_FALSE @zrr1999 #361
C.17 ✅ POP_JUMP_FORWARD_IF_NOT_NONE @zrr1999 #361
C.18 ✅ POP_JUMP_BACKWARD_IF_NOT_NONE @zrr1999 #361
C.19 ✅ POP_JUMP_FORWARD_IF_NONE @zrr1999 #361
C.20 ✅ POP_JUMP_BACKWARD_IF_NONE @zrr1999 #361
C.21 ✅ MAKE_CELL @gouzil #372
C.22 ✅ COPY_FREE_VARS @gouzil #372
C.23 ✅ CALL @SigureMo #339
C.24 ✅ PRECALL @SigureMo #339
C.25 ✅ PUSH_NULL @SigureMo #339
C.26 ✅ KW_NAMES @SigureMo #339
C.27 ✅ RESUME @SigureMo #303
C.28 RETURN_GENERATOR
C.29 SEND
C.30 ASYNC_GEN_WRAP
@paddle-bot paddle-bot bot added the PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc label Aug 30, 2023
@SigureMo SigureMo pinned this issue Aug 31, 2023
@SigureMo
Copy link
Member

目前 Python 3.11 单测验证已经全量通过,SOT 也顺利合入 Paddle,Python 3.11 社区支持部分正式结项,感谢 @zrr1999 @gouzil 的辛勤付出~

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc
Projects
None yet
Development

No branches or pull requests

2 participants