From 1e8828bfa99d7f3db751b9b26c671200c5aa35d4 Mon Sep 17 00:00:00 2001 From: Ming Du Date: Thu, 18 Apr 2024 15:46:01 -0500 Subject: [PATCH] Avoid calling __getitems__ in DistributedDataLoaderIterator --- generic_trainer/data.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/generic_trainer/data.py b/generic_trainer/data.py index 8a43c5a..2005013 100644 --- a/generic_trainer/data.py +++ b/generic_trainer/data.py @@ -63,6 +63,8 @@ def __next__(self): self.i_sample += self.batch_size self.i_batch += 1 try: + raise AttributeError('__getitems__ suffers from a performance bottleneck (reason unclear) on some HPCs. ' + 'Until a fix is found, calling __getitems__ should be avoided.') data = self.dataset.__getitems__(inds) except AttributeError: raw_data = [self.dataset[i] for i in inds]