Fix wrong weight reference in dynamic EPLB (#6818)

This commit is contained in:
fzyzcjy
2025-06-02 23:26:04 -07:00
committed by GitHub
parent 27e327b415
commit 0ea330ca34
3 changed files with 27 additions and 13 deletions
+1 -5
View File
@@ -18,15 +18,10 @@
"""Inference-only Qwen3MoE model compatible with HuggingFace weights."""
import logging
from dataclasses import dataclass
from enum import Enum, auto
from functools import partial
from typing import Any, Dict, Iterable, Optional, Tuple
import torch
import torch.nn.functional as F
from torch import nn
from transformers.configuration_utils import PretrainedConfig
from sglang.srt.distributed import (
get_pp_group,
@@ -811,6 +806,7 @@ class Qwen3MoeForCausalLM(nn.Module):
else:
logger.warning(f"Parameter {name} not found in params_dict")
# TODO mimic deepseek
self.routed_experts_weights_of_layer = {
layer_id: self.model.layers[layer_id].mlp.get_moe_weights()
for layer_id in range(self.start_layer, self.end_layer)