fix torch 2.2 missing is_compiling member

This commit is contained in:
doctorpangloss 2025-12-17 09:38:21 -08:00
parent 1fd1c2c7fc
commit 2c7f8788f8

View File

@ -1202,7 +1202,7 @@ def get_offload_stream(device):
if NUM_STREAMS == 0: if NUM_STREAMS == 0:
return None return None
if torch.compiler.is_compiling(): if hasattr(torch.compiler, "is_compiling") and torch.compiler.is_compiling(): # pylint: disable=no-member
return None return None
if device in STREAMS: if device in STREAMS: