Skip to content

fix: Fix default RNG synchronization for ditribution - #15141

Open
JingyaHuang wants to merge 6 commits into
huggingface:mainfrom
JingyaHuang:sync-parallel-rng-seed
Open

JingyaHuang wants to merge 6 commits into
huggingface:mainfrom
JingyaHuang:sync-parallel-rng-seed

Conversation

@JingyaHuang

Copy link
Copy Markdown
Contributor

What does this PR do?

Synchronize default RNGs across each parallel group so inference without an explicit generator uses matching random draws on all ranks.

Add tests covering different seeds and matching seeds with different RNG offsets.

Before submitting

  • Did you use an AI agent (Claude Code, Codex, Cursor, etc.) to help with this PR? If so:
    • Did you read the Coding with AI agents guide?
    • Did you run the self-review skill on the diff?
    • Did you share the final self-review notes in the PR description or a comment?
  • Did you read the contributor guideline?
  • Did you read our philosophy doc? (important for complex PRs)
  • Was this discussed/approved via a GitHub issue or the forum? Please add a link to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?
  • Are you the author (or part of the team) of the model/pipeline (only applicable for model/pipeline related PRs)?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@github-actions github-actions Bot added models utils size/S PR with diff < 50 LOC labels Oct 28, 2026
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@github-actions github-actions Bot added tests size/M PR with diff < 200 LOC and removed size/S PR with diff < 50 LOC labels Oct 28, 2026
@github-actions github-actions Bot added size/S PR with diff < 50 LOC and removed size/M PR with diff < 200 LOC labels Oct 28, 2026
@JingyaHuang
JingyaHuang marked this pull request as ready for review October 28, 2026 13:43
@JingyaHuang
JingyaHuang requested a review from sayakpaul October 28, 2026 13:44

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants