Skip to content
Open
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
8 changes: 4 additions & 4 deletions src/diffusers/models/attention_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,12 @@ def set_use_xla_flash_attention(
Specify the partition specification if using SPMD. Otherwise None.
"""
if use_xla_flash_attention:
if not is_torch_xla_available:
raise "torch_xla is not available"
if not is_torch_xla_available():
raise ImportError("torch_xla is not available")
elif is_torch_xla_version("<", "2.3"):
raise "flash attention pallas kernel is supported from torch_xla version 2.3"
raise ImportError("flash attention pallas kernel is supported from torch_xla version 2.3")
elif is_spmd() and is_torch_xla_version("<", "2.4"):
raise "flash attention pallas kernel using SPMD is supported from torch_xla version 2.4"
raise ImportError("flash attention pallas kernel using SPMD is supported from torch_xla version 2.4")
else:
if is_flux:
processor = XLAFluxFlashAttnProcessor2_0(partition_spec)
Expand Down
Loading