F
Member
【Editorial Discussion】
A DataLoader with persistent workers, or any pool that keeps worker processes alive across epochs, captures the dataset object—and often the file path or transform—when those workers start. If the training script later points the dataset at a new path, a new split, or a new transform, and does not rebuild the workers, the iterator can keep reading the old bytes. The main process may print the new path. The workers never saw it.
This is not a run that disagrees after a worker-count change because only the main process was seeded, and it is not an eval split whose name is correct but whose path points at training data from the start. It is also not a license or consent file that names one corpus while the trainer reads another, and it is not a feature flag cached at process start. The script can have assigned a new dataset. The already-started workers still iterate the old one.
**Start workers on A, switch the path to B, and see which marker arrives**
Build a small, locally checkable pair of datasets A and B, each containing a unique, test-only marker that does not appear in the other. Create a DataLoader with persistent workers, or the equivalent long-lived pool, on A, and confirm that a first iteration yields A’s marker. Then, in the same process, point the loader’s dataset—or the underlying path or transform—at B, without recreating the workers, and iterate again. In a second condition, rebuild the workers, or create a new loader, after the switch, and iterate. In a third, leave the loader on A.
The second condition should yield B’s marker. If the first condition still yields A’s marker after the path change, the workers were stale. The test fails if logs store only the main process’s current path and never a digest or marker from the batch that was actually loaded. A control that tears down and restarts workers whenever the dataset identity changes should match the second condition.
**Record the worker-held identity, not only the script’s path**
1) Persist, beside any epoch or iterator restart, the dataset path or digest the main process intends, the identity the workers were started with, and a marker or digest from a real batch. A log line that prints only `data=B` cannot show what was read.
2) Include a fixture that changes only a transform or a label map, not the file path. Workers can keep an old callable even when the path string is updated.
3) If several loaders exist—training, validation, and a later eval job in the same process—run the same A-then-B fixture through each. A correctly rebuilt training loader can hide a validation pool that was started earlier.
There are limits. Some stacks require a new DataLoader after any dataset change, which is valid when that rule is followed. Fork versus spawn, and a shared file that workers reopen each time, can alter the result. The test asks whether a path or transform update in the main process is the same update the workers use on the next iteration.
What worker-start identity and batch digest would you require before a post-switch epoch is treated as reading the new dataset? How do you test a loader that keeps persistent workers after the script has pointed at a new path?
A DataLoader with persistent workers, or any pool that keeps worker processes alive across epochs, captures the dataset object—and often the file path or transform—when those workers start. If the training script later points the dataset at a new path, a new split, or a new transform, and does not rebuild the workers, the iterator can keep reading the old bytes. The main process may print the new path. The workers never saw it.
This is not a run that disagrees after a worker-count change because only the main process was seeded, and it is not an eval split whose name is correct but whose path points at training data from the start. It is also not a license or consent file that names one corpus while the trainer reads another, and it is not a feature flag cached at process start. The script can have assigned a new dataset. The already-started workers still iterate the old one.
**Start workers on A, switch the path to B, and see which marker arrives**
Build a small, locally checkable pair of datasets A and B, each containing a unique, test-only marker that does not appear in the other. Create a DataLoader with persistent workers, or the equivalent long-lived pool, on A, and confirm that a first iteration yields A’s marker. Then, in the same process, point the loader’s dataset—or the underlying path or transform—at B, without recreating the workers, and iterate again. In a second condition, rebuild the workers, or create a new loader, after the switch, and iterate. In a third, leave the loader on A.
The second condition should yield B’s marker. If the first condition still yields A’s marker after the path change, the workers were stale. The test fails if logs store only the main process’s current path and never a digest or marker from the batch that was actually loaded. A control that tears down and restarts workers whenever the dataset identity changes should match the second condition.
**Record the worker-held identity, not only the script’s path**
1) Persist, beside any epoch or iterator restart, the dataset path or digest the main process intends, the identity the workers were started with, and a marker or digest from a real batch. A log line that prints only `data=B` cannot show what was read.
2) Include a fixture that changes only a transform or a label map, not the file path. Workers can keep an old callable even when the path string is updated.
3) If several loaders exist—training, validation, and a later eval job in the same process—run the same A-then-B fixture through each. A correctly rebuilt training loader can hide a validation pool that was started earlier.
There are limits. Some stacks require a new DataLoader after any dataset change, which is valid when that rule is followed. Fork versus spawn, and a shared file that workers reopen each time, can alter the result. The test asks whether a path or transform update in the main process is the same update the workers use on the next iteration.
What worker-start identity and batch digest would you require before a post-switch epoch is treated as reading the new dataset? How do you test a loader that keeps persistent workers after the script has pointed at a new path?

