{"record":{"id":"6aebc6111e5c7961","repo":"Lightning-AI/pytorch-lightning","slug":"name-is-already-present-in-the-registry-hint","errorCode":null,"errorMessage":"'{name}' is already present in the registry. HINT: Use `override=True`.","messagePattern":"'(.+?)' is already present in the registry\\. HINT: Use `override=True`\\.","errorType":"validation","errorClass":"MisconfigurationException","httpStatus":null,"severity":"error","filePath":"src/lightning/fabric/accelerators/registry.py","lineNumber":69,"sourceCode":"        description: str = \"\",\n        override: bool = False,\n        **init_params: Any,\n    ) -> Callable:\n        \"\"\"Registers a accelerator mapped to a name and with required metadata.\n\n        Args:\n            name : the name that identifies a accelerator, e.g. \"gpu\"\n            accelerator : accelerator class\n            description : accelerator description\n            override : overrides the registered accelerator, if True\n            init_params: parameters to initialize the accelerator\n\n        \"\"\"\n        if not (name is None or isinstance(name, str)):\n            raise TypeError(f\"`name` must be a str, found {name}\")\n\n        if name in self and not override:\n            raise MisconfigurationException(f\"'{name}' is already present in the registry. HINT: Use `override=True`.\")\n\n        data: dict[str, Any] = {}\n\n        data[\"description\"] = description\n        data[\"init_params\"] = init_params\n\n        def do_register(accelerator: Callable) -> Callable:\n            data[\"accelerator\"] = accelerator\n            data[\"accelerator_name\"] = name\n            self[name] = data\n            return accelerator\n\n        if accelerator is not None:\n            return do_register(accelerator)\n\n        return do_register\n\n    @override","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/Lightning-AI/pytorch-lightning/blob/9fed5c27d2a62ff0efd6c3573599921d6ff67c14/src/lightning/fabric/accelerators/registry.py#L51-L87","documentation":"In barebones mode the Trainer disables logging for maximum speed. Passing any logger that is not None and not False (i.e. a Logger instance, True, or a list of loggers) together with barebones=True raises ValueError; otherwise logger is forced to False.","triggerScenarios":"Trainer(barebones=True, logger=TensorBoardLogger('logs')); Trainer(barebones=True, logger=True); passing a list of loggers with barebones=True.","commonSituations":"Benchmark configs that keep the logger from the training config; reusing a shared kwargs dict; wanting to compare barebones speed but forgetting Lightning forbids loggers there.","solutions":["Set logger=False (or omit it, default is None behavior may still be replaced) when using barebones=True","If logging is required, don't use barebones mode; instead disable checkpointing/progress bar individually"],"exampleFix":"# before\nfrom lightning.pytorch.loggers import TensorBoardLogger\ntrainer = Trainer(barebones=True, logger=TensorBoardLogger(\"logs\"))\n\n# after\ntrainer = Trainer(barebones=True, logger=False)\n# or keep logging\ntrainer = Trainer(logger=TensorBoardLogger(\"logs\"))","handlingStrategy":"validation","validationCode":"def check_barebones(barebones: bool, logger) -> None:\n    if barebones and logger is not None and logger is not False:\n        raise ValueError(\"barebones=True requires logger=False or None\")","typeGuard":"def logger_allowed_in_barebones(barebones: bool, logger) -> bool:\n    return (not barebones) or logger is None or logger is False","tryCatchPattern":null,"preventionTips":["Set logger=False explicitly in benchmark configs","Keep separate config objects for benchmark vs training runs","If you need logs during benchmarking, you cannot use barebones mode"],"tags":["pytorch-lightning","trainer","barebones","logger"],"backgroundTag":"conflicting-options","analyzedSha":"9fed5c27d2a62ff0efd6c3573599921d6ff67c14","analyzedAt":"2026-08-28T11:52:41.083Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}