From 6001d3d71deec2ea1e9ee77aec51b383750ab3b0 Mon Sep 17 00:00:00 2001 From: Wubbbi Date: Wed, 8 Nov 2023 17:04:02 +0100 Subject: [PATCH] Change pad_to_multiple_of to be 8 for all cases. Add comment about it's temporary status --- invokeai/backend/model_management/lora.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/invokeai/backend/model_management/lora.py b/invokeai/backend/model_management/lora.py index 277f6d7e14..e4caf60aac 100644 --- a/invokeai/backend/model_management/lora.py +++ b/invokeai/backend/model_management/lora.py @@ -166,14 +166,14 @@ class ModelPatcher: init_tokens_count = None new_tokens_added = None - # This is required since Transformers 4.32 - # see https://github.com/huggingface/transformers/pull/25088 - # More information: https://docs.nvidia.com/deeplearning/performance/dl-performance- - # matrix-multiplication/index.html#requirements-tc - if "A100" in torch.cuda.get_device_name(): - pad_to_multiple_of = 64 - else: - pad_to_multiple_of = 8 + # TODO: This is required since Transformers 4.32 see + # https://github.com/huggingface/transformers/pull/25088 + # More information by NVIDIA: + # https://docs.nvidia.com/deeplearning/performance/dl-performance-matrix-multiplication/index.html#requirements-tc + # This value might need to be changed in the future and take the GPUs model into account as there seem + # to be ideal values for different GPUS. This value is temporary! + # For references to the current discussion please see https://github.com/invoke-ai/InvokeAI/pull/4817 + pad_to_multiple_of = 8 try: # HACK: The CLIPTokenizer API does not include a way to remove tokens after calling add_tokens(...). As a