[NPU] [bugfix] Fix import of ggml_moe_a8_vec and Fix NPU MLA HiCache backup accessing missing data_ptrs (#36640)

Co-authored-by: sglang-npu-bot <sglangnpu@163.com>
This commit is contained in:
chx96642264
2026-08-27 16:14:48 -07:00
committed by GitHub
co-authored by sglang-npu-bot
parent 5d52f02f22
commit 5640e53cab
2 changed files with 20 additions and 13 deletions
@@ -17,6 +17,7 @@ from sglang.srt.layers.moe.utils import RoutingMethodType
from sglang.srt.runtime_context import get_exec
from sglang.srt.utils import (
is_flashinfer_available,
is_npu,
log_info_on_rank0,
set_weight_attrs,
)
@@ -380,7 +381,6 @@ def maybe_fuse_routed_scale_and_shared_add(
# alpha=scale)`. With no shared output, the missing scale is applied
# in-place. Otherwise `routed` is already scale-final and we just add
# `shared` (or pass through if there is none).
from sglang.srt.layers.quantization.expert_pack import ExpertPackMoEMethod
from sglang.srt.layers.quantization.mxfp4_flashinfer_cutlass_moe import (
Mxfp4FlashinferCutlassMoEMethod,
)
@@ -388,15 +388,17 @@ def maybe_fuse_routed_scale_and_shared_add(
Mxfp4MarlinMoEMethod,
)
fused = isinstance(
experts.quant_method,
(
Mxfp4FlashinferTrtllmMoEMethod,
Mxfp4FlashinferCutlassMoEMethod,
Mxfp4MarlinMoEMethod,
ExpertPackMoEMethod,
),
)
fused_methods = [
Mxfp4FlashinferTrtllmMoEMethod,
Mxfp4FlashinferCutlassMoEMethod,
Mxfp4MarlinMoEMethod,
]
if not is_npu():
from sglang.srt.layers.quantization.expert_pack import ExpertPackMoEMethod
fused_methods.append(ExpertPackMoEMethod)
fused = isinstance(experts.quant_method, tuple(fused_methods))
if fused:
already_scaled = experts.should_fuse_routed_scaling_factor_in_topk
if shared is not None:
+8 -3
View File
@@ -436,9 +436,14 @@ class MLATokenToKVPoolHost(HiSparseHostPoolMixin, HostKVCache):
)
return
device_data_ptrs, device_kv_buffers = self._resolve_device_transfer_buffers(
device_pool
)
if io_backend == "kernel_ascend":
# NPU pools use contiguous multi-layer tensors and intentionally do
# not build the CUDA-style data_ptrs array.
device_data_ptrs, device_kv_buffers = None, None
else:
device_data_ptrs, device_kv_buffers = self._resolve_device_transfer_buffers(
device_pool
)
if io_backend == "kernel":
if self.layout == "layer_first":