Lightning-AI/pytorch-lightning · error · KeyError

'{}' not found in registry. Available names: {}

Error message

'{}' not found in registry. Available names: {}

What it means

Barebones mode also disables the progress bar. If enable_progress_bar is truthy along with barebones=True, __init__ raises ValueError and then forces enable_progress_bar=False when valid.

Source

Thrown at src/lightning/fabric/accelerators/registry.py:104

    @override
    def get(self, name: str, default: Optional[Any] = None) -> Any:
        """Calls the registered accelerator with the required parameters and returns the accelerator object.

        Args:
            name (str): the name that identifies a accelerator, e.g. "gpu"

        """
        if name in self:
            data = self[name]
            return data["accelerator"](**data["init_params"])

        if default is not None:
            return default

        err_msg = "'{}' not found in registry. Available names: {}"
        available_names = self.available_accelerators()
        raise KeyError(err_msg.format(name, available_names))

    def remove(self, name: str) -> None:
        """Removes the registered accelerator by name."""
        self.pop(name)

    def available_accelerators(self) -> set[str]:
        """Returns a set of registered accelerators."""
        return set(self.keys())

    def __str__(self) -> str:
        return "Registered Accelerators: {}".format(", ".join(self.available_accelerators()))


def call_register_accelerators(registry: _AcceleratorRegistry, base_module: str) -> None:  # pragma: no-cover
    """Legacy.

    Do not use.

View on GitHub (pinned to 9fed5c27d2)

Solutions

  1. Set enable_progress_bar=False (or omit it) with barebones=True
  2. If you need a progress bar, disable barebones and turn off logger/checkpointing individually

Example fix

# before
trainer = Trainer(barebones=True, enable_progress_bar=True)

# after
trainer = Trainer(barebones=True, enable_progress_bar=False)
Defensive patterns

Strategy: validation

Validate before calling

def check_barebones_pb(barebones: bool, enable_progress_bar: bool) -> None:
    if barebones and enable_progress_bar:
        raise ValueError("barebones=True requires enable_progress_bar=False")

Type guard

def progress_bar_allowed_in_barebones(barebones: bool, pb: bool) -> bool:
    return (not barebones) or not pb

Prevention

When it happens

Trigger: Trainer(barebones=True, enable_progress_bar=True); any truthy enable_progress_bar value combined with barebones mode.

Common situations: Copy-pasted Trainer kwargs from a normal run into a benchmark run; shared config templates; wanting some visibility during barebones benchmarks, which Lightning forbids.

Related errors


AI-assisted analysis of Lightning-AI/pytorch-lightning@9fed5c27d2 (2026-08-28). Data as JSON: /api/errors/3fec3eda785569d2. Report an issue: GitHub.