Can a pl.LightningModule be used from native pytorch?
Can a pl.LightningModule be used from native pytorch?
We are writing a library, and the use of pl.LightningModule for our modules is convenient, particularly because each module knows its device.
However, our clients might be using native pytorch, and want to include our LightningModule as an nn.Module in their code.
FWIW, our LightningModule currently is used purely for forward inference and currently passes no gradients, nor is it trainable.

Are there any interoperability pitfalls in having a LightningModule be an nn.Module in a pure pytorch codebase?
Are the benefits gained by using pl.LightningModules in our codebase no longer relevant when called from a pure pytorch codebase, particularly given that we pass back no gradients?
It should work as a native nn.Module, it actually subclasses it. If you find any, you can assume it's a bug so feel free to open issues about any pitfalls found.
Depends on which features of the LightningModule you value the most. The benefits left would be mainly organization and such.