[AMD] Enable mamba JIT transfer kernel on ROCm (fix transfer_kv_mamba NameError) (#31741)
This commit is contained in:
@@ -101,7 +101,7 @@ struct TransferMambaKernel {
|
|||||||
|
|
||||||
TensorMatcher({L}) //
|
TensorMatcher({L}) //
|
||||||
.with_dtype<int64_t>()
|
.with_dtype<int64_t>()
|
||||||
.with_device<kDLCUDA>(device_)
|
.with_device<kDLGPU>(device_)
|
||||||
.verify(src_indices)
|
.verify(src_indices)
|
||||||
.verify(dst_indices);
|
.verify(dst_indices);
|
||||||
|
|
||||||
@@ -147,13 +147,13 @@ struct TransferMambaKernel {
|
|||||||
|
|
||||||
TensorMatcher({L}) //
|
TensorMatcher({L}) //
|
||||||
.with_dtype<int64_t>()
|
.with_dtype<int64_t>()
|
||||||
.with_device<kDLCUDA>(device_)
|
.with_device<kDLGPU>(device_)
|
||||||
.verify(src_indices)
|
.verify(src_indices)
|
||||||
.verify(dst_indices);
|
.verify(dst_indices);
|
||||||
// src_ptrs is a 1D tensor of device pointers (uint64) on CUDA
|
// src_ptrs is a 1D tensor of device pointers (uint64) on CUDA
|
||||||
TensorMatcher({static_cast<int64_t>(num_layers)}) //
|
TensorMatcher({static_cast<int64_t>(num_layers)}) //
|
||||||
.with_dtype<uint64_t>()
|
.with_dtype<uint64_t>()
|
||||||
.with_device<kDLCUDA>(device_)
|
.with_device<kDLGPU>(device_)
|
||||||
.verify(src_ptrs);
|
.verify(src_ptrs);
|
||||||
|
|
||||||
RuntimeCheck(item_size > 0, "transfer_mamba: item_size must be positive");
|
RuntimeCheck(item_size > 0, "transfer_mamba: item_size must be positive");
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ if _is_cuda or _is_hip:
|
|||||||
transfer_kv_per_layer_mla,
|
transfer_kv_per_layer_mla,
|
||||||
transfer_kv_per_layer_mla_pf_lf,
|
transfer_kv_per_layer_mla_pf_lf,
|
||||||
)
|
)
|
||||||
if _is_cuda:
|
if _is_cuda or _is_hip:
|
||||||
from sglang.kernels.ops.mamba.transfer_mamba import (
|
from sglang.kernels.ops.mamba.transfer_mamba import (
|
||||||
transfer_kv_mamba_lf_pf,
|
transfer_kv_mamba_lf_pf,
|
||||||
transfer_kv_mamba_pf_lf,
|
transfer_kv_mamba_pf_lf,
|
||||||
|
|||||||
Reference in New Issue
Block a user