Skip to content

Commit 5942072

Browse files
committed
fix
1 parent 73c0b65 commit 5942072

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

lightllm/common/triton_utils/autotuner.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,14 @@ def __init__(
9191
if is_triton_autotune_enabled():
9292
os.makedirs(self.cache_dir, exist_ok=True)
9393

94-
self._loaded_static_keys = set()
95-
9694
@lru_cache(maxsize=None)
9795
def _ensure_cache_loaded(self, static_key):
98-
if static_key in self._loaded_static_keys:
96+
if static_key in self.cached_configs:
9997
return
10098
cache_file = os.path.join(self.cache_dir, KernelConfigs.get_config_file_name(static_key))
10199
if os.path.exists(cache_file):
102-
try:
103-
with open(cache_file, "rb") as f:
104-
self.cached_configs[static_key] = orjson.loads(f.read())
105-
except Exception:
106-
self.cached_configs[static_key] = {}
107-
self._loaded_static_keys.add(static_key)
100+
with open(cache_file, "rb") as f:
101+
self.cached_configs[static_key] = orjson.loads(f.read())
108102

109103
def _bench(self, *args, n_repeat=5, n_retries=1, **kwargs):
110104
from triton.compiler.errors import CompileTimeAssertionFailure

0 commit comments

Comments
 (0)