[NPU][Bugfix] Fix qwen3 error when enable-dp-lm-head (#16115)
This commit is contained in:
@@ -294,8 +294,8 @@ class RotaryEmbedding(MultiPlatformOp):
|
||||
assert (
|
||||
fused_set_kv_buffer_arg is None
|
||||
), "fused_set_kv_buffer_arg is not supported for npu implementation"
|
||||
|
||||
rotary_mode = "half"
|
||||
if query.dtype == torch.bfloat16 and self.cos_sin_cache.dtype == torch.float:
|
||||
return self.forward_native(positions, query, key, offsets)
|
||||
if self.is_neox_style:
|
||||
rotary_mode = "half"
|
||||
else:
|
||||
|
||||
@@ -31,6 +31,7 @@ from sglang.srt.utils import (
|
||||
cpu_has_amx_support,
|
||||
get_compiler_backend,
|
||||
is_cpu,
|
||||
is_npu,
|
||||
set_weight_attrs,
|
||||
)
|
||||
|
||||
@@ -38,6 +39,7 @@ DEFAULT_VOCAB_PADDING_SIZE = 64
|
||||
|
||||
_is_cpu_amx_available = cpu_has_amx_support()
|
||||
_is_cpu = is_cpu()
|
||||
_is_npu = is_npu()
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -123,7 +125,7 @@ class VocabParallelEmbeddingShardIndices:
|
||||
assert self.num_added_elements <= self.num_added_elements_padded
|
||||
|
||||
|
||||
@torch.compile(dynamic=True, backend=get_compiler_backend())
|
||||
@torch.compile(dynamic=True, backend=get_compiler_backend(), disable=_is_npu)
|
||||
def get_masked_input_and_mask(
|
||||
input_: torch.Tensor,
|
||||
org_vocab_start_index: int,
|
||||
|
||||
Reference in New Issue
Block a user