There was a long standing bug when resuming a streaming, finetuning dataset with packing enabled. The issue would only occur if you resumed not on an epoch boundary. The issue would be fairly significant, in that resumption would resume at an earlier sample than it should have, so data would be unexpectedly repeated. The root cause of the issue is that, when packing, the num samples recorded for streaming resumption needed to be multiplied by the packing ratio.
Manual test, with PR, resumption is deterministic:
Before this PR (note, loss is lower upon resumption because its repeating samples, and then it reverts to the same general loss curve once its through the repeats):
The above plots were with num_workers=0, when setting num_workers=8, we discovered a second deterministic resumption bug, where the wrong batch size was passed to streaming. This has now also been fixed, and here is a manual test with num_workers=8.
Note: There will still be some non determinism if max_leftover_bins_to_keep is not set to zero, because we don't save the reservoir. This will just be slight non determinism, as opposed to the current bug which would repeat samples.
There was a long standing bug when resuming a streaming, finetuning dataset with packing enabled. The issue would only occur if you resumed not on an epoch boundary. The issue would be fairly significant, in that resumption would resume at an earlier sample than it should have, so data would be unexpectedly repeated. The root cause of the issue is that, when packing, the num samples recorded for streaming resumption needed to be multiplied by the packing ratio.
Manual test, with PR, resumption is deterministic:
Before this PR (note, loss is lower upon resumption because its repeating samples, and then it reverts to the same general loss curve once its through the repeats):
The above plots were with
num_workers=0
, when settingnum_workers=8
, we discovered a second deterministic resumption bug, where the wrong batch size was passed to streaming. This has now also been fixed, and here is a manual test withnum_workers=8
.Note: There will still be some non determinism if
max_leftover_bins_to_keep
is not set to zero, because we don't save the reservoir. This will just be slight non determinism, as opposed to the current bug which would repeat samples.