Open
Description
Bug description
When loading a checkpoint that was compiled using torch.compile
on a using
model = LitModel.load_from_checkpoint(...)
...
#later on
model.submodule = torch.compile(model.submodule)
I am getting missing key(s) and unexpected key(s) errors. Specifically, all the model keys are "missing" and instead there are "unexpected" keys where the compiled module is replaced by _orig_mod
. Is it just not possible to load a checkpoint from a checkpoint containing a compiled module? Going into the checkpoint and replacing the keys by the correct value is not hard, but inconvenient.
I have not tested whether compiling the entire LightningModule works (perhaps it is just a legitimate limitation that lightning cannot know whether a submodule was compiled or not).
What version are you seeing the problem on?
lightning==2.0.0