sgl-project/sglang · error · ValueError

Module(s) requested for update not found in pipeline: {unkno

Error message

Module(s) requested for update not found in pipeline: {unknown}. Available Module(s): {list(components.keys())}

What it means

Raised by WeightsUpdater._collect_modules when the list of target_modules passed to a weight-update API contains names that are not modules of the loaded pipeline. The error lists both the unknown names and the modules actually available, so it is purely a name-mismatch validation error.

Source

Thrown at python/sglang/multimodal_gen/runtime/post_training/weights_updater.py:439

        logger.info(message)
        return success, message

    def _collect_modules(
        self, target_modules: list[str] | None
    ) -> list[tuple[str, torch.nn.Module]]:
        """Resolve target_modules to (name, module) pairs.

        Raises:
            ValueError: If target_modules contains names not found in the pipeline.
        """
        components = get_updatable_modules(self.pipeline)

        if target_modules is None:
            names = list(components.keys())
        else:
            unknown = [n for n in target_modules if n not in components]
            if unknown:
                raise ValueError(
                    f"Module(s) requested for update not found in pipeline: {unknown}. "
                    f"Available Module(s): {list(components.keys())}"
                )
            names = target_modules

        return [(name, components[name]) for name in names]

    def _apply_weights(
        self,
        modules_to_update: list[tuple[str, torch.nn.Module]],
        weights_map: dict[str, str],
    ) -> tuple[bool, str]:
        """Load weights into each module; rollback on first failure."""
        updated_modules: list[str] = []

        for module_name, module in modules_to_update:
            try:
                weights_iter = _get_weights_iter(weights_map[module_name])

View on GitHub (pinned to 0132848349)

Solutions

  1. Use a module name from the 'Available Module(s)' list printed in the message
  2. Pass target_modules=None to update all modules
  3. Print the components keys first to discover valid names before calling

Example fix

// before
updater.update_weights_from_tensor(named_tensors=t, target_modules=["vision_tower"])
// after
updater.update_weights_from_tensor(named_tensors=t, target_modules=None)  # or a name from available modules
Defensive patterns

Strategy: validation

Validate before calling

valid = set(updater.list_modules()) if hasattr(updater,'list_modules') else None
# or derive from the error's Available list; check before calling
assert all(m in known for m in target_modules), f"unknown modules {set(target_modules)-known}"

Prevention

When it happens

Trigger: Calling update_weights_from_disk / update_weights_from_tensor / _update_lora_from_tensor with target_modules=['foo'] where 'foo' is not a key in the pipeline components dict (e.g. typo, or using a module name from a different model/pipeline variant).

Common situations: Model architecture changed between versions so module names differ; copying module names from another checkpoint; stale hardcoded module list; extra whitespace/case mismatch in names.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/8cf2fa123c352722. Report an issue: GitHub.