From 82920cf36c5f015668477312695f5d54e06b2031 Mon Sep 17 00:00:00 2001 From: Gokul Gunasekaran Date: Tue, 30 Jul 2024 01:20:30 -0700 Subject: [PATCH] add doc for snapshot_every_n_steps arg param Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: --- torchdata/stateful_dataloader/stateful_dataloader.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/torchdata/stateful_dataloader/stateful_dataloader.py b/torchdata/stateful_dataloader/stateful_dataloader.py index 92553cf69..98734d6e5 100644 --- a/torchdata/stateful_dataloader/stateful_dataloader.py +++ b/torchdata/stateful_dataloader/stateful_dataloader.py @@ -148,6 +148,8 @@ class StatefulDataLoader(DataLoader[_T_co]): maintain the workers `Dataset` instances alive. (default: ``False``) pin_memory_device (str, optional): the device to :attr:`pin_memory` to if ``pin_memory`` is ``True``. + snapshot_every_n_steps (int, optional): Defines how often the state is + transferred from the dataloader workers to the dataloader. By default, it is set to ``1``, i.e., state is transferred every step. If the state is large, this value can be increased (and ideally set to the frequency of training checkpointing) to reduce the overhead of transferring state every step. .. warning:: If the ``spawn`` start method is used, :attr:`worker_init_fn`