-
Notifications
You must be signed in to change notification settings - Fork 112
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
Add OneDiffCheckpointLoader #457
Conversation
Co-authored-by: Yao Chi <later@usopp.net>
Co-authored-by: Yao Chi <later@usopp.net>
*, | ||
use_graph=True, | ||
options={}, | ||
graph_path=None, |
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.
这些放到 options 里面吧,oneflow_compile 要谨慎扩展参数
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.
好的就是传入 options = { "graph_config": (graph_path, graph_device)} 这种吗 还是 options = { "graph_path":graph_path, "graph_device":graph_device}
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.
graph_file, graph_file_device
return | ||
graph_device = torch2oflow(self._graph_config[1]) | ||
self.load_graph(graph_path, graph_device) | ||
self._graph_config = None |
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.
_graph_config 这个命名改准确一点吧,太宽泛了
def handle_deployable_exception(func): | ||
@wraps(func) | ||
def wrapper(self, *args, **kwargs): | ||
def _run_func(): | ||
load_graph_from_config(self) |
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.
这个功能单独写个 decorator ? 放到 handle_deployable_exception 感觉不合适
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.
已修改: #460
使用 OneDiffCheckpointLoader 避免用户 手动指定使用保存的 graph。
如下图避免用户使用 画红框的节点 ,引发不必要的麻烦。