Use torch.compile
with optimizer and LightningModule
#21269
Unanswered
Tomas542
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Since PyTorch 2.2.0 the new feature got introduced - compiling
optimizer.step()
(ref). What is the proper way to use it with LightningModule?As far as I understand, I need to overwrite train_step as in Manual Optimization guide, like:
Or I need to unwrap optimizer first?
Also, question about compiling optimizer with scheduler - how to use it with above examples?
Beta Was this translation helpful? Give feedback.
All reactions