MCPcopy Create free account
hub / github.com/NVIDIA/DALI / prefetch

Method prefetch

dali/python/nvidia/dali/external_source.py:232–239  ·  view source on GitHub ↗
(self, pool, context_i, batch_size, epoch_idx)

Source from the content-addressed store, hash-verified

230 self.current_sample = 0
231
232 def prefetch(self, pool, context_i, batch_size, epoch_idx):
233 # NOTE We can't schedule more than what's on top of pipeline's prefetch queue, as the
234 # entires in the pipeline are zero-copy and cannot be overwritten.
235 context = pool.contexts[context_i]
236 while context.scheduled_ahead < self.prefetch_queue_depth and self.schedule_batch(
237 pool, context_i, context.scheduled_ahead, batch_size, epoch_idx
238 ):
239 pass
240
241 def schedule_batch(self, pool, context_i, lead, batch_size, epoch_idx):
242 """Schedule computing new batch from source callback by the parallel pool."""

Callers 6

schedule_and_receiveMethod · 0.95
_schedule_py_workersMethod · 0.80
datasetMethod · 0.80
image_setFunction · 0.80
_prefetch_datasetMethod · 0.80
get_datasetMethod · 0.80

Calls 1

schedule_batchMethod · 0.95

Tested by

no test coverage detected