Skip to content

Commit 2771a90

Browse files
joebosfacebook-github-bot
authored andcommitted
make model.model_metrics.qps_metric.warmup_steps can be passed through config (#2255)
Summary: Pull Request resolved: #2255 `ThroughputMetric` already support warm_steps, however it's default to always 100. Thsi diff is to make qps_metric.warmup_steps configurable so that it can be control through model yaml file or command argument, for example, ``` buck2 run mode/{opt,amd-gpu} //aps_models/ads/icvr:icvr_launcher -- mode=local_ctr_cvr_cmf_rep_1000x_v1_no_atom +model.model_metrics.qps_metric.warmup_steps=1 ``` Reviewed By: Yuzhen11 Differential Revision: D60388121 fbshipit-source-id: 7963e8e4f87bde651cd4a39c9b68310ef408acb6
1 parent 5ddb831 commit 2771a90

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

torchrec/metrics/metric_module.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ def generate_metric_module(
463463
batch_size=batch_size,
464464
world_size=world_size,
465465
window_seconds=metrics_config.throughput_metric.window_size,
466+
warmup_steps=metrics_config.throughput_metric.warmup_steps,
466467
)
467468
else:
468469
throughput_metric = None

torchrec/metrics/metrics_config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class RecComputeMode(Enum):
8080

8181
_DEFAULT_WINDOW_SIZE = 10_000_000
8282
_DEFAULT_THROUGHPUT_WINDOW_SECONDS = 100
83+
_DEFAULT_THROUGHPUT_WARMUP_STEPS = 100
8384

8485

8586
@dataclass
@@ -113,6 +114,7 @@ class StateMetricEnum(StrValueMixin, Enum):
113114
@dataclass
114115
class ThroughputDef:
115116
window_size: int = _DEFAULT_THROUGHPUT_WINDOW_SECONDS
117+
warmup_steps: int = _DEFAULT_THROUGHPUT_WARMUP_STEPS
116118

117119

118120
@dataclass

0 commit comments

Comments
 (0)