Open
Conversation
Contributor
|
@jeffkbkim has exported this pull request. If you are a Meta employee, you can view the originating Diff in D94254756. |
d8b5da6 to
6e1da9c
Compare
jeffkbkim
added a commit
to jeffkbkim/torchrec
that referenced
this pull request
Mar 5, 2026
…rch#3812) Summary: Add DeferrableMetrics, a unified metrics container that wraps either a resolved dict or a pending Future. Provides subscribe()/resolve()/update()/is_resolved() APIs for async-safe metric access. Key design decisions: - __bool__ always returns True to prevent `metrics or {}` from replacing the container - subscribe() fires synchronously when already resolved - update() supports both dict and DeferrableMetrics inputs with deferred merge - update() propagates errors from upstream DeferrableMetrics via on_error handler Deletes metrics_output_util.py entirely. All callers migrated: - memcpy_compute.py: get_metrics_async() -> DeferrableMetrics.subscribe() - test_metrics_output_util.py: deleted (coverage now in test_deferrable_metrics.py) This is the foundation for the ZORM APS integration. Subsequent diffs will migrate RecMetricModule, ITrainModule, and all callers to use this type. Design Doc: https://docs.google.com/document/d/1V7CQEABwyPAYQLg51yVQ61sCASyHUP1O5oZBNd1743s/edit Differential Revision: D94254756
fdf9982 to
4bedb20
Compare
jeffkbkim
added a commit
to jeffkbkim/torchrec
that referenced
this pull request
Mar 6, 2026
…rch#3812) Summary: Add DeferrableMetrics, a unified metrics container that wraps either a resolved dict or a pending Future. Provides subscribe()/resolve()/update()/is_resolved() APIs for async-safe metric access. Implements Mapping for backward compatibility during the transition period. Differential Revision: D94254756
4bedb20 to
f04e551
Compare
jeffkbkim
added a commit
to jeffkbkim/torchrec
that referenced
this pull request
Mar 6, 2026
…rch#3812) Summary: Add DeferrableMetrics, a unified metrics container that wraps either a resolved dict or a pending Future. Provides subscribe()/resolve()/update()/is_resolved() APIs for async-safe metric access. Implements Mapping for backward compatibility during the transition period. Differential Revision: D94254756
f04e551 to
d6b4385
Compare
jeffkbkim
added a commit
to jeffkbkim/torchrec
that referenced
this pull request
Mar 9, 2026
Summary: Add DeferrableMetrics, a unified metrics container that wraps either a resolved dict or a pending Future. Provides subscribe()/resolve()/update()/is_resolved() APIs for async-safe metric access. Implements Mapping for backward compatibility during the transition period. Differential Revision: D94254756
jeffkbkim
added a commit
to jeffkbkim/torchrec
that referenced
this pull request
Mar 9, 2026
Summary: Add DeferrableMetrics, a unified metrics container that wraps either a resolved dict or a pending Future. Provides subscribe()/resolve()/update()/is_resolved() APIs for async-safe metric access. Implements Mapping for backward compatibility during the transition period. Differential Revision: D94254756
jeffkbkim
added a commit
to jeffkbkim/torchrec
that referenced
this pull request
Mar 9, 2026
Summary: Add DeferrableMetrics, a unified metrics container that wraps either a resolved dict or a pending Future. Provides subscribe()/resolve()/update()/is_resolved() APIs for async-safe metric access. Differential Revision: D94254756
d6b4385 to
fdfb959
Compare
jeffkbkim
added a commit
to jeffkbkim/torchrec
that referenced
this pull request
Mar 10, 2026
Summary: Add DeferrableMetrics, a unified metrics container that wraps either a resolved dict or a pending Future. Provides subscribe()/resolve()/update()/is_resolved() APIs for async-safe metric access. Differential Revision: D94254756
fdfb959 to
aebb736
Compare
jeffkbkim
added a commit
to jeffkbkim/torchrec
that referenced
this pull request
Mar 10, 2026
Summary: Pull Request resolved: meta-pytorch#3812 Add DeferrableMetrics, a unified metrics container that wraps either a resolved dict or a pending Future. Provides subscribe()/resolve()/update()/is_resolved() APIs for async-safe metric access. Differential Revision: D94254756
aebb736 to
4d1a0eb
Compare
jeffkbkim
added a commit
to jeffkbkim/torchrec
that referenced
this pull request
Mar 10, 2026
Summary: Pull Request resolved: meta-pytorch#3812 Add DeferrableMetrics, a unified metrics container that wraps either a resolved dict or a pending Future. Provides subscribe()/resolve()/update()/is_resolved() APIs for async-safe metric access. Differential Revision: D94254756
4d1a0eb to
584a53e
Compare
Summary: Add DeferrableMetrics, a unified metrics container that wraps either a resolved dict or a pending Future. Provides subscribe()/resolve()/update()/is_resolved() APIs for async-safe metric access. Differential Revision: D94254756
584a53e to
e932719
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Add DeferrableMetrics, a unified metrics container that wraps either a resolved
dict or a pending Future. Provides subscribe()/resolve()/update()/is_resolved()
APIs for async-safe metric access.
Key design decisions:
metrics or {}from replacing the containerThis is the foundation for the ZORM APS integration. Subsequent diffs will
migrate RecMetricModule, ITrainModule, and all callers to use this type.
Design Doc: https://docs.google.com/document/d/1V7CQEABwyPAYQLg51yVQ61sCASyHUP1O5oZBNd1743s/edit
Differential Revision: D94254756