Skip to content

Commit 3c4ab53

Browse files
committed
merge pre-loaded cache when saving the config
1 parent dcc2455 commit 3c4ab53

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gemlite/core.py

+5
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ def forward_auto_with_warmup(self, x: Tensor) -> Tensor:
410410

411411
@staticmethod
412412
def cache_config(filename: str):
413+
global GEMLITE_TRITON_CONFIG_CACHE
413414
#Load existing cache if available
414415
try:
415416
with FILE_LOCK, open(filename, 'r') as json_file:
@@ -437,6 +438,10 @@ def cache_config(filename: str):
437438
for name in _GEMLITE_TRITON_MAPPING:
438439
if(name not in config):
439440
config[name] = {}
441+
442+
if(name in GEMLITE_TRITON_CONFIG_CACHE):
443+
config[name].update(GEMLITE_TRITON_CONFIG_CACHE[name])
444+
440445
config[name].update(cache_kernel_config(_GEMLITE_TRITON_MAPPING[name].kernel, 5)) #5: len(prune_keys)
441446

442447
#Save combined cache

0 commit comments

Comments
 (0)