Skip to content
Open
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: 1 addition & 1 deletion vllm/model_executor/models/flex_olmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import torch
from torch import nn
from transformers import FlexOlmoConfig

Comment on lines 17 to 20

Choose a reason for hiding this comment

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

P1 Badge Missing transformers version bump for new Flex/Olmo configs

The new imports of FlexOlmoConfig from transformers drop our vendored config copies, but the repo still advertises compatibility with transformers >=4.56.0 (see requirements/common.txt). FlexOlmoConfig and Olmo3Config were only added in upstream transformers 4.57, so in any environment that installs 4.56.x—still allowed by our requirements—flex_olmo.py (and olmo2.py) will crash with ImportError at import time. The lower bound should be raised or a fallback retained to avoid breaking supported installs.

Useful? React with 👍 / 👎.

from vllm.config import VllmConfig
from vllm.distributed import get_tensor_model_parallel_world_size
Expand All @@ -24,7 +25,6 @@
from vllm.model_executor.layers.layernorm import RMSNorm
from vllm.model_executor.layers.linear import ReplicatedLinear
from vllm.model_executor.models.olmoe import OlmoeAttention, OlmoeForCausalLM
from vllm.transformers_utils.configs import FlexOlmoConfig

logger = init_logger(__name__)

Expand Down
3 changes: 1 addition & 2 deletions vllm/model_executor/models/olmo2.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

import torch
from torch import nn
from transformers import Olmo2Config
from transformers import Olmo2Config, Olmo3Config
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

While it's correct to import Olmo3Config from transformers, this change has an unintended side effect. The removed local vllm.transformers_utils.configs.Olmo3Config contained a crucial architecture override for olmo3 models, mapping them to Olmo2ForCausalLM which is implemented in this file. The new transformers.Olmo3Config defaults to the Olmo3ForCausalLM architecture, which is not registered in vLLM, and will cause model loading to fail for olmo3 models.

To fix this, you should re-introduce the architecture override. A good place for this would be in vllm/transformers_utils/config.py within the get_config function, after parsing the configuration:

# in vllm/transformers_utils/config.py
def get_config(...):
    ...
    config_dict, config = config_parser.parse(...)

    # This model uses Olmo3ForCausalLM in transformers but Olmo2ForCausalLM
    # in vLLM.
    if config.model_type == "olmo3":
        config.architectures = ["Olmo2ForCausalLM"]

    ...


from vllm.attention.layer import Attention
from vllm.compilation.decorators import support_torch_compile
Expand Down Expand Up @@ -63,7 +63,6 @@
maybe_prefix,
)
from vllm.sequence import IntermediateTensors
from vllm.transformers_utils.configs import Olmo3Config


class Olmo2Attention(nn.Module):
Expand Down
2 changes: 0 additions & 2 deletions vllm/transformers_utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ def __getitem__(self, key):
chatglm="ChatGLMConfig",
deepseek_vl_v2="DeepseekVLV2Config",
deepseek_v32="DeepseekV3Config",
flex_olmo="FlexOlmoConfig",
hunyuan_vl="HunYuanVLConfig",
kimi_linear="KimiLinearConfig",
kimi_vl="KimiVLConfig",
Expand All @@ -101,7 +100,6 @@ def __getitem__(self, key):
eagle="EAGLEConfig",
speculators="SpeculatorsConfig",
nemotron="NemotronConfig",
olmo3="Olmo3Config",
ovis="OvisConfig",
ultravox="UltravoxConfig",
step3_vl="Step3VLConfig",
Expand Down
4 changes: 0 additions & 4 deletions vllm/transformers_utils/configs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
# tiiuae/falcon-7b(-instruct) models. Newer Falcon models will use the
# `FalconConfig` class from the official HuggingFace transformers library.
from vllm.transformers_utils.configs.falcon import RWConfig
from vllm.transformers_utils.configs.flex_olmo import FlexOlmoConfig
from vllm.transformers_utils.configs.hunyuan_vl import (
HunYuanVLConfig,
HunYuanVLTextConfig,
Expand All @@ -38,7 +37,6 @@
from vllm.transformers_utils.configs.moonvit import MoonViTConfig
from vllm.transformers_utils.configs.nemotron import NemotronConfig
from vllm.transformers_utils.configs.nemotron_h import NemotronHConfig
from vllm.transformers_utils.configs.olmo3 import Olmo3Config
from vllm.transformers_utils.configs.ovis import OvisConfig
from vllm.transformers_utils.configs.qwen3_next import Qwen3NextConfig
from vllm.transformers_utils.configs.radio import RadioConfig
Expand All @@ -57,7 +55,6 @@
"DeepseekV3Config",
"DotsOCRConfig",
"EAGLEConfig",
"FlexOlmoConfig",
"HunYuanVLConfig",
"HunYuanVLTextConfig",
"HunYuanVLVisionConfig",
Expand All @@ -72,7 +69,6 @@
"KimiVLConfig",
"NemotronConfig",
"NemotronHConfig",
"Olmo3Config",
"OvisConfig",
"RadioConfig",
"SpeculatorsConfig",
Expand Down
82 changes: 0 additions & 82 deletions vllm/transformers_utils/configs/flex_olmo.py

This file was deleted.

83 changes: 0 additions & 83 deletions vllm/transformers_utils/configs/olmo3.py

This file was deleted.

Loading