Skip to content

[SOT][3.12] Support BINARY_SLICE and STORE_SLICE opcode in Python 3.12 - #62028

Merged
SigureMo merged 2 commits into
PaddlePaddle:developfrom
diadestiny:sot_support_BINARY_SLICE_and_STORE_SLICE
Feb 26, 2024
Merged

[SOT][3.12] Support BINARY_SLICE and STORE_SLICE opcode in Python 3.12#62028
SigureMo merged 2 commits into
PaddlePaddle:developfrom
diadestiny:sot_support_BINARY_SLICE_and_STORE_SLICE

Conversation

@diadestiny

Copy link
Copy Markdown
Contributor

PR types

Others

PR changes

Others

Description

python 3.12 支持 BINARY_SLICE and STORE_SLICE

@paddle-bot

paddle-bot Bot commented Feb 23, 2024

Copy link
Copy Markdown

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot Bot added the contributor External developers label Feb 23, 2024
graph=self._graph,
tracker=DummyTracker([start, end]),
)
self.binary_subscr_operation(key, container, instr.opname)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

BINARY_SLICE 看起来是 BUILD_SLICEBINARY_SUBSCR 的结合,那么是否需要考虑 BUILD_SLICE 里的 step 的情况呢?还是说有 step 的情况不会编译成 BINARY_SLICE 呢?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

def foo(x):
    return x[1:3]
    return x[1:3:2]

我测了一下有step的话(比如 x[1:3:2]),不会编译成BINARY_SLICE

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

好的那我觉得没问题

@SigureMo SigureMo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTMeow

if isinstance(key, TensorVariable):
raise BreakGraphError(
f"Key is a TensorVariable in STORE_SUBSCR, {container}[{key}] = {value}"
f"Key is a TensorVariable in {opname}, {container}[{key}] = {value}"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

CI覆盖率好像跑不到这里子图打断的情况(这里改了下打断报错输出的op名)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

仅 3.12 适配相关的可以豁免,非 3.12 的需要考虑覆盖率

@SigureMo
SigureMo merged commit 1c5bbe4 into PaddlePaddle:develop Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants