[Bugfix][KVConnector][NIXL] Return NumPy descriptors from mixed-memory local registration (#60108)
Signed-off-by: Lucas Wilkinson <lwilkinson@neuralmagic.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: Matthew Bonanni <mbonanni@redhat.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
Matthew Bonanni
parent
4e198cef83
commit
0e8f8ecba8
@@ -2100,7 +2100,9 @@ def test_mixed_memory_local_descriptors_split_by_memory_type():
|
||||
|
||||
assert handle == 22
|
||||
assert worker._dram_src_handles_by_block_size[worker.block_size] == 11
|
||||
assert [block[2] for block in blocks] == [0, 0, 3, 3]
|
||||
# Must stay an array: P_TP > D_TP splits call .tolist() on it.
|
||||
assert isinstance(blocks, np.ndarray)
|
||||
assert blocks[:, 2].tolist() == [0, 0, 3, 3]
|
||||
memory_types = [
|
||||
call.args[1] for call in worker.nixl_wrapper.get_xfer_descs.call_args_list
|
||||
]
|
||||
|
||||
@@ -2174,14 +2174,9 @@ class NixlBaseConnectorWorker:
|
||||
self._desc_pos_by_block_size[block_size] = desc_pos
|
||||
|
||||
# DRAM descriptors are registered under CPU device 0.
|
||||
blocks_data = [
|
||||
(addr, length, 0) if is_dram else (addr, length, dev)
|
||||
for (addr, length, dev), is_dram in zip(
|
||||
blocks_data, desc_is_dram, strict=True
|
||||
)
|
||||
]
|
||||
dram_blocks = [blocks_data[i] for i in dram_idx]
|
||||
vram_blocks = [blocks_data[i] for i in vram_idx]
|
||||
blocks_data[desc_is_dram, 2] = 0
|
||||
dram_blocks = blocks_data[dram_idx]
|
||||
vram_blocks = blocks_data[vram_idx]
|
||||
dram_descs = self.nixl_wrapper.get_xfer_descs(dram_blocks, "DRAM")
|
||||
self._dram_src_handles_by_block_size[block_size] = (
|
||||
self.nixl_wrapper.prep_xfer_dlist("NIXL_INIT_AGENT", dram_descs)
|
||||
|
||||
Reference in New Issue
Block a user