Skip to content

Commit 0b50d4c

Browse files
Add argument to explicitly enable fp8 compute support. (Comfy-Org#8257)
This can be used to test if your current GPU/pytorch version supports fp8 matrix mult in combination with --fast or the fp8_e4m3fn_fast dtype.
1 parent 30b2eb8 commit 0b50d4c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

comfy/cli_args.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def __call__(self, parser, namespace, values, option_string=None):
8888

8989
parser.add_argument("--oneapi-device-selector", type=str, default=None, metavar="SELECTOR_STRING", help="Sets the oneAPI device(s) this instance will use.")
9090
parser.add_argument("--disable-ipex-optimize", action="store_true", help="Disables ipex.optimize default when loading models with Intel's Extension for Pytorch.")
91+
parser.add_argument("--supports-fp8-compute", action="store_true", help="ComfyUI will act like if the device supports fp8 compute.")
9192

9293
class LatentPreviewMethod(enum.Enum):
9394
NoPreviews = "none"

comfy/model_management.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,6 +1257,9 @@ def should_use_bf16(device=None, model_params=0, prioritize_performance=True, ma
12571257
return False
12581258

12591259
def supports_fp8_compute(device=None):
1260+
if args.supports_fp8_compute:
1261+
return True
1262+
12601263
if not is_nvidia():
12611264
return False
12621265

0 commit comments

Comments
 (0)