Skip to content
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

Merged
merged 7 commits into from
Dec 26, 2023
Merged

Add OneDiffCheckpointLoader #457

merged 7 commits into from
Dec 26, 2023

Conversation

ccssu
Copy link
Contributor

@ccssu ccssu commented Dec 26, 2023

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

onediff_comfy_nodes/_nodes.py Outdated Show resolved Hide resolved
onediff_comfy_nodes/_nodes.py Show resolved Hide resolved
src/onediff/infer_compiler/with_oneflow_compile.py Outdated Show resolved Hide resolved
onediff_comfy_nodes/_nodes.py Show resolved Hide resolved
onediff_comfy_nodes/_nodes.py Outdated Show resolved Hide resolved
onediff_comfy_nodes/__init__.py Outdated Show resolved Hide resolved
src/onediff/infer_compiler/with_oneflow_compile.py Outdated Show resolved Hide resolved
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>
onediff_comfy_nodes/_nodes.py Outdated Show resolved Hide resolved
@ccssu ccssu merged commit 5e6e909 into main Dec 26, 2023
0 of 4 checks passed
@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 这个命名改准确一点吧,太宽泛了

def handle_deployable_exception(func):
@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