From 9456cef279ea42f032431600e88e5c2d2752bb86 Mon Sep 17 00:00:00 2001 From: McZyWu Date: Wed, 22 Jul 2026 16:34:59 +0800 Subject: [PATCH] [NPU]fix rl update weights 'Parameter' object has no attribute 'weight_LOADER' (#31796) --- .../npu/quantization/moe_methods.py | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/python/sglang/srt/hardware_backend/npu/quantization/moe_methods.py b/python/sglang/srt/hardware_backend/npu/quantization/moe_methods.py index e36e1ba36..aa307b19c 100644 --- a/python/sglang/srt/hardware_backend/npu/quantization/moe_methods.py +++ b/python/sglang/srt/hardware_backend/npu/quantization/moe_methods.py @@ -333,11 +333,6 @@ class NPUW8A8Int8MoEMethod(_NPUMoEMethodBase): # Process weight weight: torch.Tensor = getattr(layer, f"{weight_prefix}_weight") weight.data = npu_format_cast(weight.data.transpose(1, 2)) - setattr( - layer, - f"{weight_prefix}_weight", - torch.nn.Parameter(weight, requires_grad=False), - ) # Set dispatcher output dtype if weight_prefix == "w13": @@ -442,11 +437,6 @@ class NPUW4A8Int8MoEMethod(_NPUMoEMethodBase): weight = getattr(layer, f"{weight_prefix}_weight") weight.data = npu_format_cast(weight.data.transpose(1, 2)) weight.data = self._pack_to_int32(weight.data) - setattr( - layer, - f"{weight_prefix}_weight", - torch.nn.Parameter(weight, requires_grad=False), - ) # Set dispatcher output dtype if weight_prefix == "w13": @@ -579,11 +569,6 @@ class NPUWNA16Int4MoEMethod(_NPUMoEMethodBase): .int() ) weight.data = self._pack_to_int32(unpacked_weight) - setattr( - layer, - f"{weight_prefix}_weight", - torch.nn.Parameter(weight, requires_grad=False), - ) # Set dispatcher output dtype if weight_prefix == "w13": @@ -704,11 +689,6 @@ class NPUUnquantMoEMethod(_NPUMoEMethodBase): weight: torch.Tensor = getattr(layer, f"{weight_prefix}_weight") weight.data = npu_format_cast(weight) - setattr( - layer, - f"{weight_prefix}_weight", - torch.nn.Parameter(weight, requires_grad=False), - ) if weight_prefix == "w13": self._set_dispatcher_output_dtype(layer, "bf16")