Fix KVCache constructor call — device as keyword arg, not positional

KVCache signature has max_comp before device, so positional pass of dev
was hitting max_comp parameter instead of device.
This commit is contained in:
2026-06-01 21:11:01 +00:00
parent c9b92cd840
commit 230d28e562

View File

@@ -861,7 +861,7 @@ def main():
n_ih = cfg.get("index_n_heads", 64); ihd = cfg.get("index_head_dim", 128); itk = cfg.get("index_topk", 1024)
for li in range(n_layers):
dev = f"cuda:{li % NUM_GPUS}"; ratio = cr[li] if li < len(cr) else 128
kv_caches[li] = KVCache(hd, cfg.get("sliding_window", 128), dev)
kv_caches[li] = KVCache(hd, cfg.get("sliding_window", 128), device=dev)
if ratio > 0: compressors[li] = Compressor(ratio, hd, H, dev)
if ratio == 4: indexers[li] = Indexer(n_ih, ihd, itk, dev)