Skip to content

Choosing an invalid accelerator does not raise an error #12698

@awaelchli

Description

@awaelchli

🐛 Bug

To Reproduce

trainer = Trainer(accelerator="invalid",)
print(type(trainer.accelerator))

Expected behavior

Raises an error.

The error is already implemented in the AcceleratorConnector:
https://github.com/PyTorchLightning/pytorch-lightning/blob/3f0f277d5bbf6f9c1f07e8f03e1d6ae048608d7a/pytorch_lightning/trainer/connectors/accelerator_connector.py#L490-L494

However, the code is never triggered. It was introduced in #12180 but not tested.

Environment

PL 1.7

cc @justusschock @kaushikb11 @awaelchli @ninginthecloud @akihironitta @rohitgr7

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions