-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
bugSomething isn't workingSomething isn't workingfabriclightning.fabric.Fabriclightning.fabric.Fabrichelp wantedOpen to be worked onOpen to be worked onpriority: 2Low priority taskLow priority taskwon't fixThis will not be worked onThis will not be worked on
Description
🐛 Bug
Recent changes to the Lite DataLoader in #10279 have not been properly reviewed and tested. Several clean ups need to be done and better tests need to be written.
The following issue exists:
To Reproduce
def test_setup_custom_dataloaders_new():
class DataLoaderSubclass1(DataLoader):
def __init__(self, attribute1, *args, **kwargs):
# UNCOMMENT THE LINE BELOW, NO DIFFERENCE (EXPECTED)
# self.attribute1 = attribute1
super().__init__(*args, **kwargs)
class DataLoaderSubclass2(DataLoaderSubclass1):
def __init__(self, attribute1, attribute2, *args, **kwargs):
# UNCOMMENT THE LINE BELOW, TEST PASSES
# self.attribute2 = attribute2
super().__init__(attribute1, *args, **kwargs)
class LiteWithCustomDataLoader(LightningLite):
def run(self):
dataloader = DataLoaderSubclass2("attribute1", "attribute2", dataset=range(4), batch_size=2)
lite_dataloader = self.setup_dataloaders(dataloader)
# THIS ASSERTION PASSES
assert lite_dataloader._dataloader.attribute1 == "attribute1"
# THIS ASSERTION FAILS
assert lite_dataloader._dataloader.attribute2 == "attribute2"
LiteWithCustomDataLoader().run()Expected behavior
According to the changes in the PR #10279, this is supposed to work and was the main motivation of it. But it does not because the tests were insufficient. This issue was found by me in #10297 while trying to clean up the code.
Environment
Lightning v1.5.0!
LucasCandiani, AlephNullVEVO and tchaton
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfabriclightning.fabric.Fabriclightning.fabric.Fabrichelp wantedOpen to be worked onOpen to be worked onpriority: 2Low priority taskLow priority taskwon't fixThis will not be worked onThis will not be worked on