vllm-project/vllm · error · ValueError

ec_transfer_config must be set to create a connector

Error message

ec_transfer_config must be set to create a connector

What it means

ECConnectorFactory.create_connector() needs config.ec_transfer_config both to look up the connector class and to stamp engine_id on the created instance. A VllmConfig with ec_transfer_config=None means EC transfer was never enabled, so there is nothing sensible to construct and the factory raises ValueError.

Source

Thrown at vllm/distributed/ec_transfer/ec_connector/factory.py:43

        """Register a connector with a lazy-loading module and class name."""
        if name in cls._registry:
            raise ValueError(f"Connector '{name}' is already registered.")

        def loader() -> type[ECConnectorBase]:
            module = importlib.import_module(module_path)
            return getattr(module, class_name)

        cls._registry[name] = loader

    @classmethod
    def create_connector(
        cls,
        config: "VllmConfig",
        role: ECConnectorRole,
    ) -> ECConnectorBase:
        ec_transfer_config = config.ec_transfer_config
        if ec_transfer_config is None:
            raise ValueError("ec_transfer_config must be set to create a connector")
        connector_cls = cls.get_connector_class(ec_transfer_config)
        logger.info(
            "Creating connector with name: %s and engine_id: %s",
            connector_cls.__name__,
            ec_transfer_config.engine_id,
        )
        # Connector is explicitly separated into two roles.
        # Scheduler connector:
        # - Co-locate with scheduler process
        # - Should only be used inside the Scheduler class
        # Worker connector:
        # - Co-locate with worker process
        return connector_cls(config, role)

    @classmethod
    def get_connector_class(
        cls, ec_transfer_config: "ECTransferConfig"
    ) -> type[ECConnectorBase]:

View on GitHub (pinned to c794754062)

Solutions

  1. Only call create_connector when ec_transfer_config is set; gate the call site
  2. Enable EC transfer via its documented config/CLI so ec_transfer_config is populated
  3. In tests, attach a minimal ECTransferConfig before calling the factory

Example fix

# before
connector = ECConnectorFactory.create_connector(vllm_config, role)

# after
if vllm_config.ec_transfer_config is not None:
    connector = ECConnectorFactory.create_connector(vllm_config, role)
else:
    connector = None
Defensive patterns

Strategy: validation

Validate before calling

if vllm_config.ec_transfer_config is None:
    connector = None  # EC transfer disabled
else:
    connector = ECConnectorFactory.create_connector(vllm_config, role)

Type guard

def can_create_ec_connector(config) -> bool:
    return getattr(config, "ec_transfer_config", None) is not None

Prevention

When it happens

Trigger: Calling ECConnectorFactory.create_connector(vllm_config, role) when EC transfer options were not passed (ec_transfer_config stays None); invoking connector creation in a code path reached without the feature flag; building partial configs in scripts/tests.

Common situations: Feature-gated code that constructs connectors unconditionally instead of behind an `if vllm_config.ec_transfer_config is not None` check; scheduler/worker code paths exercised in unit tests with default configs.

Related errors


AI-assisted analysis of vllm-project/vllm@c794754062 (2026-08-14). Data as JSON: /api/errors/0ebc4f0cec12d25a. Report an issue: GitHub.