From e72142d1b673df35d690dc3ae25906fd64f6947c Mon Sep 17 00:00:00 2001 From: Marcin Ostrowski Date: Tue, 7 Jan 2025 20:05:25 +0100 Subject: [PATCH] Add missing DEFAULT_TRAIN_BSIZE field --- torchbenchmark/models/cm3leon_generate/__init__.py | 1 + torchbenchmark/models/doctr_det_predictor/__init__.py | 1 + torchbenchmark/models/doctr_reco_predictor/__init__.py | 1 + torchbenchmark/models/llama/__init__.py | 1 + torchbenchmark/models/pyhpc_equation_of_state/__init__.py | 1 + torchbenchmark/models/pyhpc_isoneutral_mixing/__init__.py | 1 + torchbenchmark/models/pyhpc_turbulent_kinetic_energy/__init__.py | 1 + torchbenchmark/models/sam/__init__.py | 1 + torchbenchmark/models/sam_fast/__init__.py | 1 + torchbenchmark/models/simple_gpt/__init__.py | 1 + torchbenchmark/models/simple_gpt_tp_manual/__init__.py | 1 + torchbenchmark/util/framework/huggingface/model_factory.py | 1 + 12 files changed, 12 insertions(+) diff --git a/torchbenchmark/models/cm3leon_generate/__init__.py b/torchbenchmark/models/cm3leon_generate/__init__.py index 4bd3ee8ed2..60934fda04 100644 --- a/torchbenchmark/models/cm3leon_generate/__init__.py +++ b/torchbenchmark/models/cm3leon_generate/__init__.py @@ -8,6 +8,7 @@ class Model(BenchmarkModel): task = NLP.LANGUAGE_MODELING DEFAULT_EVAL_BSIZE = 1 + DEFAULT_TRAIN_BSIZE = 1 def __init__(self, test, device, batch_size=None, extra_args=[]): super().__init__( diff --git a/torchbenchmark/models/doctr_det_predictor/__init__.py b/torchbenchmark/models/doctr_det_predictor/__init__.py index dd17ade120..d68bbd605f 100644 --- a/torchbenchmark/models/doctr_det_predictor/__init__.py +++ b/torchbenchmark/models/doctr_det_predictor/__init__.py @@ -13,6 +13,7 @@ class Model(BenchmarkModel): task = COMPUTER_VISION.DETECTION DEFAULT_EVAL_BSIZE = 1 + DEFAULT_TRAIN_BSIZE = 1 CANNOT_SET_CUSTOM_OPTIMIZER = True def __init__(self, test, device, batch_size=None, extra_args=[]): diff --git a/torchbenchmark/models/doctr_reco_predictor/__init__.py b/torchbenchmark/models/doctr_reco_predictor/__init__.py index b7c9322f62..370b39fd7e 100644 --- a/torchbenchmark/models/doctr_reco_predictor/__init__.py +++ b/torchbenchmark/models/doctr_reco_predictor/__init__.py @@ -13,6 +13,7 @@ class Model(BenchmarkModel): task = COMPUTER_VISION.DETECTION DEFAULT_EVAL_BSIZE = 1 + DEFAULT_TRAIN_BSIZE = 1 CANNOT_SET_CUSTOM_OPTIMIZER = True def __init__(self, test, device, batch_size=None, extra_args=[]): diff --git a/torchbenchmark/models/llama/__init__.py b/torchbenchmark/models/llama/__init__.py index dfb22b4ccc..5014f538e1 100644 --- a/torchbenchmark/models/llama/__init__.py +++ b/torchbenchmark/models/llama/__init__.py @@ -12,6 +12,7 @@ class Model(BenchmarkModel): task = NLP.LANGUAGE_MODELING DEFAULT_EVAL_BSIZE = 32 + DEFAULT_TRAIN_BSIZE = 32 def __init__(self, test, device, batch_size=None, extra_args=[]): super().__init__( diff --git a/torchbenchmark/models/pyhpc_equation_of_state/__init__.py b/torchbenchmark/models/pyhpc_equation_of_state/__init__.py index e46761a754..d495cd2f58 100644 --- a/torchbenchmark/models/pyhpc_equation_of_state/__init__.py +++ b/torchbenchmark/models/pyhpc_equation_of_state/__init__.py @@ -40,6 +40,7 @@ class Model(BenchmarkModel): # Source: https://github.com/dionhaefner/pyhpc-benchmarks/blob/650ecc650e394df829944ffcf09e9d646ec69691/run.py#L25 # Pick data point: i = 20, size = 1048576 DEFAULT_EVAL_BSIZE = 1048576 + DEFAULT_TRAIN_BSIZE = 1048576 CANNOT_SET_CUSTOM_OPTIMIZER = True def __init__(self, test, device, batch_size=None, extra_args=[]): diff --git a/torchbenchmark/models/pyhpc_isoneutral_mixing/__init__.py b/torchbenchmark/models/pyhpc_isoneutral_mixing/__init__.py index 03e9f1106b..61cf7ffa62 100644 --- a/torchbenchmark/models/pyhpc_isoneutral_mixing/__init__.py +++ b/torchbenchmark/models/pyhpc_isoneutral_mixing/__init__.py @@ -131,6 +131,7 @@ class Model(BenchmarkModel): # Source: https://github.com/dionhaefner/pyhpc-benchmarks/blob/650ecc650e394df829944ffcf09e9d646ec69691/run.py#L25 # Pick data-point when i = 20, size = 1048576 DEFAULT_EVAL_BSIZE = 1048576 + DEFAULT_TRAIN_BSIZE = 1048576 CANNOT_SET_CUSTOM_OPTIMIZER = True def __init__(self, test, device, batch_size=None, extra_args=[]): diff --git a/torchbenchmark/models/pyhpc_turbulent_kinetic_energy/__init__.py b/torchbenchmark/models/pyhpc_turbulent_kinetic_energy/__init__.py index 1ae1b01d8b..4d5dafb0da 100644 --- a/torchbenchmark/models/pyhpc_turbulent_kinetic_energy/__init__.py +++ b/torchbenchmark/models/pyhpc_turbulent_kinetic_energy/__init__.py @@ -129,6 +129,7 @@ class Model(BenchmarkModel): # Source: https://github.com/dionhaefner/pyhpc-benchmarks/blob/650ecc650e394df829944ffcf09e9d646ec69691/run.py#L25 # Pick data-point when i = 20, size = 1048576 DEFAULT_EVAL_BSIZE = 1048576 + DEFAULT_TRAIN_BSIZE = 1048576 ALLOW_CUSTOMIZE_BSIZE = False CANNOT_SET_CUSTOM_OPTIMIZER = True diff --git a/torchbenchmark/models/sam/__init__.py b/torchbenchmark/models/sam/__init__.py index b416a01451..2d48e8dc2b 100644 --- a/torchbenchmark/models/sam/__init__.py +++ b/torchbenchmark/models/sam/__init__.py @@ -17,6 +17,7 @@ class Model(BenchmarkModel): task = COMPUTER_VISION.SEGMENTATION DEFAULT_EVAL_BSIZE = 32 + DEFAULT_TRAIN_BSIZE = 32 def __init__(self, test, device, batch_size=1, extra_args=[]): super().__init__( diff --git a/torchbenchmark/models/sam_fast/__init__.py b/torchbenchmark/models/sam_fast/__init__.py index c00c9556a1..285f3f64b5 100644 --- a/torchbenchmark/models/sam_fast/__init__.py +++ b/torchbenchmark/models/sam_fast/__init__.py @@ -18,6 +18,7 @@ class Model(BenchmarkModel): task = COMPUTER_VISION.SEGMENTATION DEFAULT_EVAL_BSIZE = 32 + DEFAULT_TRAIN_BSIZE = 32 def __init__(self, test, device, batch_size=1, extra_args=[]): super().__init__( diff --git a/torchbenchmark/models/simple_gpt/__init__.py b/torchbenchmark/models/simple_gpt/__init__.py index ff25d64c24..7c7ff30897 100644 --- a/torchbenchmark/models/simple_gpt/__init__.py +++ b/torchbenchmark/models/simple_gpt/__init__.py @@ -11,6 +11,7 @@ class Model(BenchmarkModel): task = NLP.GENERATION DEFAULT_EVAL_BSIZE = 1 + DEFAULT_TRAIN_BSIZE = 1 def validate_environment(self): if not torch.cuda.is_available() or "cuda" not in self.device: diff --git a/torchbenchmark/models/simple_gpt_tp_manual/__init__.py b/torchbenchmark/models/simple_gpt_tp_manual/__init__.py index 6a146d1518..0bf74ae891 100644 --- a/torchbenchmark/models/simple_gpt_tp_manual/__init__.py +++ b/torchbenchmark/models/simple_gpt_tp_manual/__init__.py @@ -9,6 +9,7 @@ class Model(BenchmarkModel): task = NLP.GENERATION DEFAULT_EVAL_BSIZE = 1 + DEFAULT_TRAIN_BSIZE = 1 def validate_environment(self): if not torch.cuda.is_available() or "cuda" not in self.device: diff --git a/torchbenchmark/util/framework/huggingface/model_factory.py b/torchbenchmark/util/framework/huggingface/model_factory.py index bf49fc4c14..a5d269401f 100644 --- a/torchbenchmark/util/framework/huggingface/model_factory.py +++ b/torchbenchmark/util/framework/huggingface/model_factory.py @@ -140,6 +140,7 @@ def __init__(self): class HuggingFaceGenerationModel(HuggingFaceModel): task = NLP.GENERATION DEFAULT_EVAL_BSIZE = 1 + DEFAULT_TRAIN_BSIZE = 1 """ Instead of just running __call__ on the model, use generate to generate