MCPcopy
hub / github.com/ModelTC/LightLLM / _try_load_cache

Method _try_load_cache

lightllm/common/triton_utils/autotuner.py:186–195  ·  view source on GitHub ↗
(self, static_key)

Source from the content-addressed store, hash-verified

184 return self.fn(*args, **kwargs)
185
186 def _try_load_cache(self, static_key):
187 if static_key in self.cached_configs:
188 return
189
190 cache_file = os.path.join(self.cache_dir, KernelConfigs.get_config_file_name(static_key))
191 if os.path.exists(cache_file):
192 logger.info(f"Loading cached configs for {self.kernel_name} - {static_key}")
193 with open(cache_file, "rb") as f:
194 self.cached_configs[static_key] = orjson.loads(f.read())
195 return
196
197 def _bench(self, *args, n_repeat=3, n_retries=3, **kwargs):
198 from triton.compiler.errors import CompileTimeAssertionFailure

Callers 1

__call__Method · 0.95

Calls 3

get_config_file_nameMethod · 0.80
existsMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected