[SOT][3.12] Support BINARY_SLICE and STORE_SLICE opcode in Python 3.12 - #62028
Merged
SigureMo merged 2 commits intoFeb 26, 2024
Merged
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
SigureMo
reviewed
Feb 24, 2024
| graph=self._graph, | ||
| tracker=DummyTracker([start, end]), | ||
| ) | ||
| self.binary_subscr_operation(key, container, instr.opname) |
Member
There was a problem hiding this comment.
BINARY_SLICE 看起来是 BUILD_SLICE 和 BINARY_SUBSCR 的结合,那么是否需要考虑 BUILD_SLICE 里的 step 的情况呢?还是说有 step 的情况不会编译成 BINARY_SLICE 呢?
Contributor
Author
There was a problem hiding this comment.
def foo(x):
return x[1:3]
return x[1:3:2]
我测了一下有step的话(比如 x[1:3:2]),不会编译成BINARY_SLICE
diadestiny
commented
Feb 24, 2024
| 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}" |
Contributor
Author
There was a problem hiding this comment.
CI覆盖率好像跑不到这里子图打断的情况(这里改了下打断报错输出的op名)
Member
There was a problem hiding this comment.
仅 3.12 适配相关的可以豁免,非 3.12 的需要考虑覆盖率
This was referenced Feb 26, 2024
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR types
Others
PR changes
Others
Description
python 3.12 支持
BINARY_SLICEandSTORE_SLICE