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

introduce has_len_all_ranks() to check the length of dataloader across ranks #9827

Merged
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e31710f
introduce , udpate tests
ninginthecloud Oct 6, 2021
87a5a63
update CHANGELOG.md
ninginthecloud Oct 6, 2021
4ac7426
change staticmethod and hook attribute naming
ninginthecloud Oct 8, 2021
8860149
Merge branch 'master' into fix/valueerror_has_len_9785_2
ninginthecloud Oct 25, 2021
fda4c65
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 25, 2021
43057d3
fix typo
ninginthecloud Oct 26, 2021
aa78bb5
remove non-essential comment
ninginthecloud Oct 26, 2021
6b07d00
Merge branch 'master' into fix/valueerror_has_len_9785_2
ninginthecloud Oct 26, 2021
19fc124
fix merge error and comment format
ninginthecloud Oct 27, 2021
d41c114
try to fix test_tpu.py failure
ninginthecloud Oct 27, 2021
9e78e0d
Merge branch 'master' into fix/valueerror_has_len_9785_2
awaelchli Oct 28, 2021
51d8f7e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 28, 2021
927dfde
Merge branch 'master' into fix/valueerror_has_len_9785_2
tchaton Nov 1, 2021
079bf17
Merge branch 'master' into fix/valueerror_has_len_9785_2
rohitgr7 Nov 2, 2021
09107e1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 2, 2021
a8f8435
update on comments
rohitgr7 Nov 2, 2021
e0b376e
chlog
rohitgr7 Nov 2, 2021
ee691fe
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 2, 2021
03e854d
chlog
rohitgr7 Nov 2, 2021
5af44d2
update
rohitgr7 Nov 2, 2021
51cac01
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 2, 2021
c5a11b9
try fix
rohitgr7 Nov 2, 2021
0b0a1e8
Revert back TPUSpawn changes
kaushikb11 Nov 2, 2021
44835b0
Update test
kaushikb11 Nov 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 2, 2021
commit 51cac01123ffb6f44d7cc7a05592176ec17fdb3b
4 changes: 2 additions & 2 deletions pytorch_lightning/utilities/data.py
Original file line number Diff line number Diff line change
@@ -110,7 +110,7 @@ def has_len_all_ranks(
try:
total_length = training_type.reduce(torch.tensor(len(dataloader)).to(model.device), reduce_op="sum")
local_length = len(dataloader)

if total_length == 0:
raise MisconfigurationException(
"Total length of `Dataloader` across ranks is zero. Please make sure that it returns at least 1 batch."
@@ -133,7 +133,7 @@ def has_len_all_ranks(
has_len = False
except NotImplementedError: # e.g. raised by torchtext if a batch_size_fn is used
has_len = False

if has_len and has_iterable_dataset(dataloader):
rank_zero_warn(
ninginthecloud marked this conversation as resolved.
Show resolved Hide resolved
"Your `IterableDataset` has `__len__` defined."