mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-24 05:10:18 +08:00
Fix torch.compiler.is_compiling missing on torch 2.3 and earlier
This commit is contained in:
parent
6810282be4
commit
6954e3e247
@ -29,10 +29,13 @@ from .float import stochastic_rounding
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
_RUN_EVERY_OP_ENABLED = model_management.torch_version_numeric >= (2, 5)
|
||||||
|
|
||||||
|
|
||||||
def run_every_op():
|
def run_every_op():
|
||||||
# this is available on torch 2.3
|
global _RUN_EVERY_OP_ENABLED
|
||||||
if torch.compiler.is_compiling(): # pylint: disable=no-member
|
# this is not available on torch 2.3 by testing
|
||||||
|
if not _RUN_EVERY_OP_ENABLED or torch.compiler.is_compiling(): # pylint: disable=no-member
|
||||||
return
|
return
|
||||||
|
|
||||||
throw_exception_if_processing_interrupted()
|
throw_exception_if_processing_interrupted()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user