-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
Milestone
Description
Bug description
See reproduction below
What version are you seeing the problem on?
master
How to reproduce the bug
import pytest
import torch
import lightning as L
from lightning.fabric.plugins import HalfPrecision
class MyPlugin(HalfPrecision):
def init_context(self):
# arbitrary error
raise NotImplementedError
fabric = L.Fabric(devices=1, accelerator="cuda", plugins=MyPlugin("16-true"))
with pytest.raises(NotImplementedError):
with fabric.init_module():
pass
default_device = torch.tensor(0).device
assert default_device.type == "cpu", default_deviceError messages and logs
The assertion fails
Environment
Current master
More info
This blocks #18704