Skip to content

Conversation

@feifei-111
Copy link
Contributor

@feifei-111 feifei-111 commented Feb 23, 2024

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

@paddle-bot
Copy link

paddle-bot bot commented Feb 23, 2024

你的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.

@feifei-111 feifei-111 force-pushed the fix_can_not_find_var_err branch from 5deeb2d to 6b33ad4 Compare February 24, 2024 14:23
return dis.stack_effect(instr.opcode, instr.arg, jump=jump)


class Space(Enum):
Copy link
Member

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):
Copy link
Member

Choose a reason for hiding this comment

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

这里已经 codegen 了,要不也用 gen_ 前缀?

Comment on lines -302 to -310
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.")
Copy link
Member

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():
Copy link
Member

Choose a reason for hiding this comment

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

这个函数可以放到外面么?

@feifei-111 feifei-111 merged commit e19e3c9 into PaddlePaddle:develop Feb 26, 2024
@feifei-111 feifei-111 deleted the fix_can_not_find_var_err branch March 11, 2024 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants