[Bugfix][ROCm] Use batch DMA for CPU KV cache loads (#49843)
Signed-off-by: Andreas Karatzas <akaratza@amd.com> Co-authored-by: OpenAI Codex <noreply@openai.com>
This commit is contained in:
co-authored by
OpenAI Codex
parent
7f599d7854
commit
394beb633b
@@ -41,10 +41,10 @@ def _select_swap_blocks_fn(
|
||||
if gpu_to_cpu:
|
||||
return ops.swap_blocks_batch
|
||||
# Fall back to the C++ DMA path on platforms where Triton isn't usable
|
||||
# (e.g. ROCm builds without Triton) or where GPU kernels cannot directly
|
||||
# (e.g. ROCm host mappings) or where GPU kernels cannot directly
|
||||
# dereference CPU pointers (XPU lacks CUDA's unified virtual address space,
|
||||
# so the Triton kernel's tl.load(cpu_ptr) is invalid on XPU).
|
||||
if not HAS_TRITON or current_platform.is_xpu():
|
||||
if not HAS_TRITON or current_platform.is_xpu() or current_platform.is_rocm():
|
||||
return ops.swap_blocks_batch
|
||||
page_sizes = [r.page_size_bytes for g in kv_cache_groups_data_refs for r in g]
|
||||
# Triton wins only on small, 8-byte-aligned payloads.
|
||||
|
||||
Reference in New Issue
Block a user