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 option for nexfort #1111

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion onediff_comfy_nodes/extras_nodes/nodes_nexfort_booster.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
"max-optimize:max-autotune:benchmark:low-precision:freezing:cudagraphs": "This is the most aggressive combination of compiler modes. It will deliver the best performance but might slow down the compilation significantly.",
}
)
options = collections.OrderedDict(
{
'{"inductor.optimize_linear_epilogue": false}': "",
'{"triton.fuse_attention_allow_fp16_reduction": false, "inductor.optimize_linear_epilogue": false}': "",
}
)


class OneDiffNexfortBooster:
Expand All @@ -28,6 +34,7 @@ def INPUT_TYPES(s):
"fullgraph": ([False, True],),
"dynamic": ([True, False],),
"mode": ([mode for mode in compiler_modes.keys()],),
"option": ([option for option in options.keys()],),
"docs_link": (
"STRING",
{
Expand All @@ -47,11 +54,12 @@ def apply(
fullgraph=False,
dynamic=None,
mode="max-autotune:cudagraphs",
option="",
docs_link=None,
):
return (
BasicNexFortBoosterExecutor(
fullgraph=fullgraph, mode=f"{mode}:cache-all", dynamic=dynamic
fullgraph=fullgraph, mode=f"{mode}:cache-all", option=option, dynamic=dynamic
),
)

Expand Down
5 changes: 5 additions & 0 deletions onediff_comfy_nodes/modules/nexfort/booster_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@ class BasicNexFortBoosterExecutor(BoosterExecutor):
def __init__(
self,
mode: str = "max-optimize:max-autotune:low-precision",
option: str ="",
fullgraph=False,
dynamic=True,
):
super().__init__()
if isinstance(option, str):
import json
option = json.loads(option)
options = {
"mode": mode,
"options": option,
"dynamic": dynamic,
"fullgraph": fullgraph,
}
Expand Down
Loading