File tree Expand file tree Collapse file tree
tests/integration/defs/perf Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626from defs .trt_test_alternative import (is_linux , is_windows , print_info ,
2727 print_warning )
2828
29- from ..conftest import get_llm_root , llm_models_root , trt_environment
29+ from ..conftest import (get_device_count , get_llm_root , llm_models_root ,
30+ trt_environment )
3031from .pytorch_model_config import get_model_yaml_config
3132from .sampler_options_config import get_sampler_options_config
3233from .utils import (AbstractPerfScriptTestClass , PerfBenchScriptTestCmds ,
@@ -974,6 +975,15 @@ def validate(self):
974975 [b >= 32 for b in self .batch_sizes ]
975976 ), f"gpt_350m and bloom_560m with small BS are very unstable! Please increase to at least 32."
976977
978+ try :
979+ available_gpus = get_device_count ()
980+ except Exception :
981+ available_gpus = None
982+ if available_gpus is not None and self .num_gpus > available_gpus :
983+ pytest .skip (
984+ f"Test requires { self .num_gpus } GPUs but only { available_gpus } available"
985+ )
986+
977987 def get_model_family (self ) -> str :
978988 """
979989 Get the model family of the current model.
You can’t perform that action at this time.
0 commit comments