-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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] Compile with graph size check #58538
[SOT] Compile with graph size check #58538
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
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.
LGTM
|
||
backup_iter_idx = iterator.idx | ||
|
||
self._inline_call_for_loop(iterator, instr) | ||
self._lasti = self.indexof(instr.jump_to) | ||
except BreakGraphError as e: | ||
log(3, f"{e}") | ||
log(3, f"[FOR_ITER] sim for loop failed for: {e}\n") |
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.
simulate
* update * update * update * update * update * update * add test * update * update
* update * update * update * update * update * update * add test * update * update
PR types
Others
PR changes
Others
Description
the old start_compile api can not consider, fix it and speed up
说明:
使用原 opcode 的前半段替换 resume_fn 中的 compile_fn,在这种情况下会将原 opcode 的后半段放在构造好的 resume_fn 的末尾 (这是为了防止出现意外跳转的保险措施,尽管这种跳转应该不可能出现)
处理 NullVariable。必须要保证 origin code (resume_fn 本身也应该是 origin code)load NullVariable,而 new code load 真正的 null。原本只有 fallback 才会执行 origin code,现在 break 也有可能了,所以需要对返回的 new_code 进行一次处理(但是构造 resume fn还是需要 NullVariable)
break 之后被 skip
假如有 func 触发了 break,构造了 new_func_code 其中 call resume_0 ,且 resume_0 没有子图。如果触发了 resume_0 的eval_frame,就会导致错误(执行 resume_0 的origin code时,其中有一个 load NullVariable)。
但是 new_func_code 既然走了本 PR 的分支,那么 resume_0 没有子图等价于 new_func_code 没有子图,它也不会执行 new_func_code,而是执行func 的 origin code,也就不会 call resume_0,最终这里的 NullVariable 也不会导致错误
PCard-66972