Skip to content

Commit 2ed7d1a

Browse files
authored
Create new BEST_CONFIGS when loading wasn't possible (#73)
1 parent 0b599aa commit 2ed7d1a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

segment_anything_fast/flash_4.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ def _attention_rel_h_rel_w_kernel_aligned(q, k, v, rel_h_w, sm_scale):
292292
global BEST_CONFIGS
293293
if BEST_CONFIGS is None:
294294
BEST_CONFIGS = _load_best_configs()
295+
# Loading must have not been successful. Let's create a new dictionary.
296+
if BEST_CONFIGS is None:
297+
BEST_CONFIGS = {}
295298
key = _create_best_configs_key(q, k, v, rel_h_w, o)
296299
if key not in BEST_CONFIGS:
297300
print("key ", key, " not found. Running autotune. This might take a while.")

0 commit comments

Comments
 (0)