Skip to content

Conversation

@jeffkbkim
Copy link
Contributor

Differential Revision: D88297404

Summary:

Utilities for CPUOffloadedRecMetricModule and RecMetricModule.

Also raise exceptions in the main thread if any of the background threads. Added unit tests.

Simplify the core metric types:
- MetricsResult = Dict[str, MetricValue]: sync metrics computation
- MetricsFuture = concurrent.futures.Future[MetricsResult]: for async computation
- MetricsOutput = Union[MetricsResult, MetricsFuture]: Either a MetricsResult, or a MetricsFuture

Introduce a metrics_output_util to handle the logic between futures and dicts. Users can schedule callbacks via
`on_metrics_ready()`

Introduce `device` argument to RecMetricModule constructor. It is a noop for the standard metric module, but CPUOffloadedRecMetricModule requires it to determine whether to perform GPU to CPU transfers.

Differential Revision: D87110900
@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 Dec 5, 2025
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Dec 5, 2025

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

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. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant