Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions python/sglang/srt/model_executor/model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,8 +717,6 @@ def remote_instance_init_transfer_engine(self):
)
return

from sglang.srt.utils import get_local_ip_auto

self.remote_instance_transfer_engine = TransferEngine()
local_ip = get_local_ip_auto()
self.remote_instance_transfer_engine.initialize(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ def do_load_weights(
# for mlp.experts[0].gate_gate_up_proj, which breaks load.
if ("mlp.experts." in name) and name not in params_dict:
continue
# q_a_proj / kv_a_proj_with_mqa must bypass stacked loading
# and use the cache+concat fused A-proj path below.
if param_name == "fused_qkv_a_proj_with_mqa":
continue
name = name.replace(weight_name, param_name)
# Skip loading extra bias for GPTQ models.
if name.endswith(".bias") and name not in params_dict:
Expand Down
4 changes: 2 additions & 2 deletions python/sglang/srt/models/qwen3.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from sglang.srt.models.utils import apply_qk_norm
from sglang.srt.server_args import get_global_server_args
from sglang.srt.utils import add_prefix, get_bool_env_var, is_cuda, is_hip, is_npu
from sglang.srt.utils.hf_transformers_utils import get_rope_config

Qwen3Config = None

Expand Down Expand Up @@ -316,8 +317,7 @@ def __init__(
) -> None:
super().__init__()
self.hidden_size = config.hidden_size
rope_theta = config.rope_parameters["rope_theta"]
rope_scaling = config.rope_parameters
rope_theta, rope_scaling = get_rope_config(config)
max_position_embeddings = getattr(config, "max_position_embeddings", 32768)
head_dim = getattr(config, "head_dim", None)
self.self_attn = Qwen3Attention(
Expand Down
3 changes: 2 additions & 1 deletion python/sglang/srt/utils/weight_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _snapshot(self):

def _reset_tensors(self):
for name, param in self._model_state():
if "cos_sin_cache" in name or "freqs_cis" in name:
if "cos_sin_cache" in name or "freqs_cis" in name or "_weight_fp32" in name:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe we could maintain a list where these keys could be skipped.

continue
param.copy_(_random_like(param))

Expand Down Expand Up @@ -131,6 +131,7 @@ def _postprocess_tensors(
non_persistent_buffer_patterns = [
"cos_sin_cache", # RoPE cache
"inv_freq", # RoPE inverse frequency (if it exists as buffer)
"_weight_fp32", # FP32 cache of gate weight (e.g. Glm4MoeGate)
]

for name in raw:
Expand Down
Loading