[npu]fix: qwen3-next w8a8 precision bugs (#21698)
This commit is contained in:
@@ -65,6 +65,14 @@ _is_cpu = is_cpu()
|
|||||||
_is_amx_available = cpu_has_amx_support()
|
_is_amx_available = cpu_has_amx_support()
|
||||||
|
|
||||||
|
|
||||||
|
if _is_npu:
|
||||||
|
from sgl_kernel_npu.fla.utils import (
|
||||||
|
fused_qkvzba_split_reshape_cat as fused_qkvzba_split_reshape_cat_npu,
|
||||||
|
)
|
||||||
|
|
||||||
|
fused_qkvzba_split_reshape_cat = fused_qkvzba_split_reshape_cat_npu
|
||||||
|
|
||||||
|
|
||||||
class Qwen3GatedDeltaNet(nn.Module):
|
class Qwen3GatedDeltaNet(nn.Module):
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
@@ -223,7 +231,16 @@ class Qwen3GatedDeltaNet(nn.Module):
|
|||||||
ModelWeightParameter exposes weight_loader as a read-only property
|
ModelWeightParameter exposes weight_loader as a read-only property
|
||||||
backed by _weight_loader, while plain parameters store it as a
|
backed by _weight_loader, while plain parameters store it as a
|
||||||
regular attribute. This helper handles both cases."""
|
regular attribute. This helper handles both cases."""
|
||||||
param = module.weight
|
for attr_name in (
|
||||||
|
"weight",
|
||||||
|
"weight_scale_inv",
|
||||||
|
"weight_scale",
|
||||||
|
"input_scale",
|
||||||
|
"weight_offset",
|
||||||
|
):
|
||||||
|
param = getattr(module, attr_name, None)
|
||||||
|
if param is None:
|
||||||
|
continue
|
||||||
if hasattr(param, "_weight_loader"):
|
if hasattr(param, "_weight_loader"):
|
||||||
param._weight_loader = new_loader
|
param._weight_loader = new_loader
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user