Skip to content
Closed
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: 2 additions & 0 deletions vllm/model_executor/models/qwen.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
)
from vllm.model_executor.model_loader.weight_utils import default_weight_loader
from vllm.sequence import IntermediateTensors
from vllm.transformers_utils.config import set_default_rope_theta

from .interfaces import SupportsLoRA, SupportsPP
from .utils import (
Expand Down Expand Up @@ -149,6 +150,7 @@ def __init__(
prefix: str = "",
):
super().__init__()
set_default_rope_theta(config, default_theta=10000)
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.

high

Calling set_default_rope_theta in QWenBlock.__init__ is inefficient as it's executed for every model layer. This function should be called only once per model initialization.

Please move this call to the beginning of QWenModel.__init__ (e.g., after line 201) to ensure it runs only once. This will improve model loading efficiency and align with best practices seen in other models in this repository.

self.ln_1 = RMSNorm(config.hidden_size, eps=config.layer_norm_epsilon)

self.attn = QWenAttention(
Expand Down