From 33168a13fe1cd87d3a732cf3e345afb2d65e60c5 Mon Sep 17 00:00:00 2001 From: Carl Chengyan Fu Date: Thu, 16 Jan 2025 16:36:53 -0800 Subject: [PATCH] batch size scheduling remove asending batch size constraint (#2686) Summary: Pull Request resolved: https://github.com/pytorch/torchrec/pull/2686 In the use case of NE verification for paft, there are cases that global batch will decrease. Remove the sanity check in batch size scheduling to couple with this scenario for NE verification. Reviewed By: xunnanxu Differential Revision: D68284699 fbshipit-source-id: 74c975b4599350919d51e21897ce3ee46557c478 --- torchrec/metrics/metrics_config.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/torchrec/metrics/metrics_config.py b/torchrec/metrics/metrics_config.py index ce30e3026..a971019ce 100644 --- a/torchrec/metrics/metrics_config.py +++ b/torchrec/metrics/metrics_config.py @@ -236,11 +236,6 @@ def validate_batch_size_stages( if len(batch_size_stages) == 0: raise ValueError("Batch size stages should not be empty") - for i in range(len(batch_size_stages) - 1): - if batch_size_stages[i].batch_size >= batch_size_stages[i + 1].batch_size: - raise ValueError( - f"Batch size should be in ascending order. Got {batch_size_stages}" - ) if batch_size_stages[-1].max_iters is not None: raise ValueError( f"Batch size stages last stage should have max_iters = None, but get {batch_size_stages[-1].max_iters}"