xFormers¶
Warning
⚠️ MindONE currently only support AttnProcessor
, Please check if only AttnProcessor
is used in the pipeline before using enable_xformers_memory_efficient_attention()
.
We recommend xFormers for both inference and training. In our tests, the optimizations performed in the attention blocks allow for both faster speed and reduced memory consumption.
You can use enable_xformers_memory_efficient_attention()
for faster inference and reduced memory consumption as shown in this section.