darts icon indicating copy to clipboard operation
darts copied to clipboard

Migrate from `pytorch-lightning` to `lightning`

Open dennisbader opened this issue 1 year ago • 3 comments

At some point pytorch-lightning will be deprecated in favor of lightning. We can start migrating as well.

Addresses #2192.

  • [ ] code base
  • [ ] docs

dennisbader avatar Jan 29 '24 16:01 dennisbader

You can also have support for both; for example, Habana does; see, for example: https://github.com/Lightning-AI/lightning-Habana/blob/0dd25af5b83e6a166b359c2de538075d5feaff88/src/lightning_habana/utils/hpu_distributed.py#L19-L28 If this is welcome PR issue, I can have a look at it :rabbit:

Borda avatar Feb 02 '24 19:02 Borda

Hi @Borda,

Sorry for not coming back to you earlier, I think that another user proposer a very similar approach (inspired by the Ray library, in #2432) and I think that it's an elegant way to solve this problem.

I don't know if the other user will have the time to contribute but feel free to open a PR for this if you can.

madtoinou avatar Jun 28 '24 09:06 madtoinou

@Borda For the method in #2432: I like it because it's clean, but multiple imports in the function make it not very easy or clean to return multiple imports - I believe that imports within the function aren't accessible outside unless returned like pl is. I'm no code whiz, but I think it might be best to use a try-except or if-elif block like in your example, unless there's a good way to write that function.

I like the module_available approach used in that Habana link! Ping if you end up going with an option, I might jump on your branch and give a hand!

ru-ko avatar Jun 28 '24 21:06 ru-ko