Skip to content

Preserve explicit plate subsamples during replay - #3471

Open
aswanth-07 wants to merge 1 commit into
pyro-ppl:devfrom
aswanth-07:fix/replay-explicit-subsample
Open

Preserve explicit plate subsamples during replay#3471
aswanth-07 wants to merge 1 commit into
pyro-ppl:devfrom
aswanth-07:fix/replay-explicit-subsample

Conversation

@aswanth-07

Copy link
Copy Markdown

Summary

poutine.replay now preserves caller-provided indices at pyro.plate(..., subsample=...) sites. Automatically generated plate subsamples still replay from the guide so model and guide minibatches remain aligned.

The change fixes the silent mismatch reported in #3468. A default AutoGuide no longer replaces a model's explicit subsample with an independently generated guide index.

Fixes #3468

Validation

  • Added an AutoGuide regression that failed on the pristine base and passes with this change.
  • pytest -q tests/infer/test_autoguide.py -k "replay_preserves_explicit_subsample or replay_plates or subsample_guide": 53 passed. Optional Funsor cases were excluded because Funsor is not installed in the local environment.
  • pytest -q tests/poutine: 3036 passed.
  • ruff check pyro/poutine/replay_messenger.py tests/infer/test_autoguide.py: passed.
  • black --check pyro/poutine/replay_messenger.py tests/infer/test_autoguide.py: passed.
  • mypy --warn-unused-ignores pyro/poutine/replay_messenger.py tests/infer/test_autoguide.py: passed.
  • The repository header check still reports the pre-existing generated pyro/_version.py outside this diff.

AI assistance disclosure: AI-assisted development tools were used during investigation and implementation. The reported tests were run against the final diff.

@aswanth-07
aswanth-07 marked this pull request as ready for review August 28, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] AutoGuide silently overrides a model's manual pyro.plate(subsample=idx)

1 participant