-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[SOT] rewrite resume function generation #62012
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SOT] rewrite resume function generation #62012
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
5deeb2d to
6b33ad4
Compare
| return dis.stack_effect(instr.opcode, instr.arg, jump=jump) | ||
|
|
||
|
|
||
| class Space(Enum): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
移出那个文件之后 Space 就有点迷惑了,要不要改名 NameSpace 或者 Scope 啥的
| self.gen_disable_eval_frame() | ||
| self.fn_name = ResumeFnNameFactory().next() | ||
|
|
||
| def set_function_inputs(self, inputs: list[str], stack_size: int): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里已经 codegen 了,要不也用 gen_ 前缀?
| def _create_resume_fn(self, index: int, stack_size: int = 0): | ||
| """ | ||
| Helper method to create a resume function for the executor. | ||
| Args: | ||
| index (int): The index of the instruction to resume execution from. | ||
| stack_size (int, optional): The size of the stack. Defaults to 0. | ||
| """ | ||
| raise BreakGraphError("_create_resume_fn.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有这里的等效逻辑嘛?还是说不可能跑到这里?
| # 1. load iter | ||
| pycode_gen.gen_load_fast(iterator.id) | ||
| # 2. create inline call loop fn | ||
| def create_inline_call_fn(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个函数可以放到外面么?
PR types
Others
PR changes
Others
Description
fix "can not find var: xxx" err when break at if tensor
and rewrite resume function generation
PCard-66972