Skip to content

Add OneDiffCheckpointLoader#457

Merged
ccssu merged 7 commits intomainfrom
add_onediffcheckpointloadersimple
Dec 26, 2023
Merged

Add OneDiffCheckpointLoader#457
ccssu merged 7 commits intomainfrom
add_onediffcheckpointloadersimple

Conversation

@ccssu
Copy link
Contributor

@ccssu ccssu commented Dec 26, 2023

使用 OneDiffCheckpointLoader 避免用户 手动指定使用保存的 graph。
如下图避免用户使用 画红框的节点 ,引发不必要的麻烦。
image

ccssu and others added 4 commits December 26, 2023 13:41
Co-authored-by: Yao Chi <later@usopp.net>
Co-authored-by: Yao Chi <later@usopp.net>
@ccssu ccssu merged commit 5e6e909 into main Dec 26, 2023
@ccssu ccssu deleted the add_onediffcheckpointloadersimple branch December 26, 2023 07:41
*,
use_graph=True,
options={},
graph_path=None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

这些放到 options 里面吧,oneflow_compile 要谨慎扩展参数

Copy link
Contributor Author

@ccssu ccssu Dec 26, 2023

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}

Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

_graph_config 这个命名改准确一点吧,太宽泛了

@wraps(func)
def wrapper(self, *args, **kwargs):
def _run_func():
load_graph_from_config(self)
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个功能单独写个 decorator ? 放到 handle_deployable_exception 感觉不合适

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改: #460

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.

3 participants