Skip to content
Merged
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import threading

import fsspec.asyn
import torch

Expand All @@ -15,8 +17,13 @@ def _set_fsspec_for_multiprocess() -> None:
Only required for fsspec >= 0.9.0
See https://github.com/fsspec/gcsfs/issues/379
"""
fsspec.asyn.iothread[0] = None
fsspec.asyn.loop[0] = None
if hasattr(fsspec.asyn, "reset_lock"):
# for future fsspec>2022.05.0
fsspec.asyn.reset_lock()
else:
fsspec.asyn.iothread[0] = None
fsspec.asyn.loop[0] = None
fsspec.asyn.lock = threading.Lock()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously, we were not resetting the lock correctly apparently - I added this line anyway



class TorchIterableDataset(IterableDataset, torch.utils.data.IterableDataset):
Expand Down