-
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
Cache scope in While Op during Inference. #49083
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
✅ This PR's description meets the template requirements! |
} | ||
} | ||
|
||
private: | ||
mutable std::shared_ptr<framework::Executor> executor_{nullptr}; | ||
mutable std::unique_ptr<framework::ExecutorPrepareContext> ctx_{nullptr}; | ||
mutable std::shared_ptr<framework::InterpreterCore> core_{nullptr}; | ||
mutable framework::Scope *inference_cache_scope_ = nullptr; |
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.
- while op是训练推理共用的,这里叫inference_xxx不太合理
- 当前的修改逻辑对训练有没有影响 @zhhsplendid 看下?
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.
- while op是训练推理共用的,这里叫inference_xxx不太合理
- 当前的修改逻辑对训练有没有影响 @zhhsplendid 看下?
- 当前暂时只针对旧执行器上的推理阶段做了scope复用,这样影响面可以限制在推理侧,因为担心对训练侧产生没发现的问题。
- 如果训练侧也可以复用scope 这里可以修改的更通用一些,暂时只针对推理做了scope缓存~
PR types
Performance optimization
PR changes
Others
Describe
Cache scope in While Op during Inference.
解决方法:a. While Op不再每次运行完后就释放掉scope。 b. 使While Op中的Op不进行复用(同之前的做法)。