Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tune] Lightning not supported #37416

Closed
pdr9908 opened this issue Jul 14, 2023 · 3 comments
Closed

[Tune] Lightning not supported #37416

pdr9908 opened this issue Jul 14, 2023 · 3 comments
Assignees
Labels
enhancement Request for new feature and/or capability train Ray Train Related Issue

Comments

@pdr9908
Copy link

pdr9908 commented Jul 14, 2023

What happened + What you expected to happen

Hello! As described here, pytorch lightning was renamed and the new package lightning.pytorch is not yet supported by Ray. I get the following error when trying to tune my neural net which uses the new lightning package:

ValueError: 'module_class' must be a subclass of 'pl.LightningModule'

This can be fixed by replacing import lightning.pytorch as pl by import pytorch_lightning as pl (and installing the correct package); however, other parts of my code depend on the new lightning package.

Versions / Dependencies

PyTorch Lightning 2.0.3
Lightning 2.0.3
Python 3.10.6
Ray 2.5.1

Reproduction script

import lightning.pytorch as pl
from ray.train.lightning import LightningConfigBuilder


class MyNet(pl.LightningModule):
    def __init__(self) -> None:
        super().__init__()


LightningConfigBuilder().module(cls=MyNet).build()

Issue Severity

Low: It annoys or frustrates me.

@pdr9908 pdr9908 added bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Jul 14, 2023
@pdr9908 pdr9908 changed the title [<Ray component: Core|RLlib|etc...>] Lightning not supported by Ray [Tune] Lightning not supported Jul 14, 2023
@woshiyyya
Copy link
Member

woshiyyya commented Jul 17, 2023

Hey @pdr9908 , thanks for surfacing this issue. Currently we are using namespace pytorch_lightning for backward compatibility with PTL1.x users. We'll consider including the new namespace lightning.pytorch for LightningTrainer.

@woshiyyya woshiyyya self-assigned this Jul 17, 2023
@woshiyyya woshiyyya added train Ray Train Related Issue enhancement Request for new feature and/or capability and removed bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Jul 17, 2023
@pdr9908
Copy link
Author

pdr9908 commented Jul 19, 2023

Thanks! @woshiyyya

@woshiyyya
Copy link
Member

Resolved by this PR: #39841

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request for new feature and/or capability train Ray Train Related Issue
Projects
None yet
Development

No branches or pull requests

2 participants