Fix the scope of io_backend in NSATokenToKVPoolHost (#20327)
This commit is contained in:
@@ -1209,7 +1209,7 @@ class NSATokenToKVPoolHost(MLATokenToKVPoolHost):
|
||||
)
|
||||
else:
|
||||
raise ValueError(f"Unsupported layout: {self.layout}")
|
||||
else:
|
||||
elif io_backend == "direct":
|
||||
if self.layout == "layer_first":
|
||||
transfer_kv_direct(
|
||||
src_layers=[self.index_k_with_scale_buffer[layer_id]],
|
||||
@@ -1229,6 +1229,8 @@ class NSATokenToKVPoolHost(MLATokenToKVPoolHost):
|
||||
)
|
||||
else:
|
||||
raise ValueError(f"Unsupported layout: {self.layout}")
|
||||
else:
|
||||
raise ValueError(f"Unsupported IO backend: {io_backend}")
|
||||
|
||||
def _backup_indexer_from_device_all_layer(
|
||||
self, device_pool, host_indices, device_indices, io_backend
|
||||
@@ -1259,7 +1261,7 @@ class NSATokenToKVPoolHost(MLATokenToKVPoolHost):
|
||||
)
|
||||
else:
|
||||
raise ValueError(f"Unsupported layout: {self.layout}")
|
||||
else:
|
||||
elif io_backend == "direct":
|
||||
if self.layout == "layer_first":
|
||||
transfer_kv_direct(
|
||||
src_layers=device_pool.index_k_with_scale_buffer,
|
||||
@@ -1278,6 +1280,8 @@ class NSATokenToKVPoolHost(MLATokenToKVPoolHost):
|
||||
)
|
||||
else:
|
||||
raise ValueError(f"Unsupported layout: {self.layout}")
|
||||
else:
|
||||
raise ValueError(f"Unsupported IO backend: {io_backend}")
|
||||
|
||||
def load_to_device_per_layer(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user