Repository navigation
Conversation
Assisted-by: Codex
|
Hi @YueshenZ! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Changes
Source inspection found that restoring
MultiNodeWeightedSamplerorMultiNodeRoundRobinSampleraliases the checkpoint's exhaustion flags. Exhausting the resumed iterator then changes the caller's saved state. Loading that same in-memory checkpoint again can skip the remaining samples (restart_on_stop_iteration=False) or restart from the beginning (the default), instead of returning the saved tail.Copy the boolean exhaustion containers on reset in both samplers. Add public
Loader.state_dict()/load_state_dict()regressions for repeated restoration across the three finite stopping criteria and both restart settings. The checkpoint format and sampling order are unchanged.Validation
ee79a399d3a53676544e0d3f0e826ffa58d1fec9.PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python3 -m pytest -q test/nodes/test_multi_node_weighted_sampler.py test/nodes/test_multi_node_round_robin_sampler.py: 187 passed with the fix.git diff --check: passed.python_versionsetting. The full repository type check and upstream CI are not validated.Environment: macOS arm64, Python 3.13.15, PyTorch 2.14.0, NumPy 2.5.3. This is a deterministic data-pipeline reproduction; no production training incident or GPU validation is claimed. Re-reading a serialized checkpoint into a fresh Python object for every restore does not hit the shared-object case.
AI assistance was used for investigation, implementation, and validation.