Skip to content

Commit 9da397e

Browse files
Disable torch compiler for cast_bias_weight function (#10384)
* Disable torch compiler for cast_bias_weight function * Fix torch compile.
1 parent 92d9738 commit 9da397e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

comfy/ops.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
import contextlib
2626

2727
def run_every_op():
28+
if torch.compiler.is_compiling():
29+
return
30+
2831
comfy.model_management.throw_exception_if_processing_interrupted()
2932

3033
def scaled_dot_product_attention(q, k, v, *args, **kwargs):
@@ -70,6 +73,7 @@ def scaled_dot_product_attention(q, k, v, *args, **kwargs):
7073
def cast_to_input(weight, input, non_blocking=False, copy=True):
7174
return comfy.model_management.cast_to(weight, input.dtype, input.device, non_blocking=non_blocking, copy=copy)
7275

76+
@torch.compiler.disable()
7377
def cast_bias_weight(s, input=None, dtype=None, device=None, bias_dtype=None):
7478
if input is not None:
7579
if dtype is None:

0 commit comments

Comments
 (0)