code: def test_warmup_checkpointing(self) -> None:
      warmup_steps = 5
      extra_steps = 2
      throughput_metric = ThroughputMetric(
          batch_size=self.batch_size,
          world_size=self.world_size,
          window_seconds=10,
          warmup_steps=warmup_steps,
      )
      for i in range(5):
          for _ in range(warmup_steps + extra_steps):
              throughput_metric.update()
          self.assertEqual(
              throughput_metric.warmup_examples.item(),
              warmup_steps
              * (i + 1)
              * self.batch_size
              * self.world_size,
          )
          self.assertEqual(
              throughput_metric.total_examples.item(),
              (warmup_steps + extra_steps)
              * (i + 1)
              * self.batch_size
              * self.world_size,
          )
  
          # Mimic trainer crashing and loading a checkpoint
          throughput_metric._steps = 0
  
file_path: torchrec/torchrec/metrics/tests/test_throughput.py
imports: import unittest
  from unittest.mock import Mock, patch
  from torchrec.metrics.throughput import ThroughputMetric
label_desc: Use image node_id 9 for calling the ThroughputMetricTest obj's underlying member method code with example usage: obj.test_warmup_checkpointing() without return types