Skip to content

defensive snapshot of model_out via torch._foreach_clone#4341

Open
jeffkbkim wants to merge 1 commit into
meta-pytorch:mainfrom
jeffkbkim:export-D107427093
Open

defensive snapshot of model_out via torch._foreach_clone#4341
jeffkbkim wants to merge 1 commit into
meta-pytorch:mainfrom
jeffkbkim:export-D107427093

Conversation

@jeffkbkim

Copy link
Copy Markdown
Contributor

Summary: Take a defensive batched clone of model_out (and any tensor kwargs) in _update_rec_metrics before enqueueing a MetricUpdateJob, so the worker thread always observes a stable snapshot regardless of what the caller does with its references after update() returns.

Differential Revision: D107427093

Summary: Take a defensive batched clone of `model_out` (and any tensor kwargs) in `_update_rec_metrics` before enqueueing a `MetricUpdateJob`, so the worker thread always observes a stable snapshot regardless of what the caller does with its references after `update()` returns.

Differential Revision: D107427093
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 11, 2026
@meta-codesync

meta-codesync Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

@jeffkbkim has exported this pull request. If you are a Meta employee, you can view the originating Diff in D107427093.

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant