From 586e81a28a47e7f6f18cbf38ca1aaf17914c17de Mon Sep 17 00:00:00 2001 From: vikram singh shekhawat Date: Fri, 3 Oct 2025 21:44:48 +0530 Subject: [PATCH] [Test] Initialize mem_fraction_static in setUpClass to fix pytest VLM test crashes. (#10859) Co-authored-by: svc_repro_tool --- test/srt/models/test_vlm_models.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/srt/models/test_vlm_models.py b/test/srt/models/test_vlm_models.py index 0748f1ee0..32e275d9a 100644 --- a/test/srt/models/test_vlm_models.py +++ b/test/srt/models/test_vlm_models.py @@ -27,6 +27,8 @@ MODELS = [ SimpleNamespace(model="openbmb/MiniCPM-V-2_6", mmmu_accuracy=0.4), ] +#Set default mem_fraction_static to 0.8 +DEFAULT_MEM_FRACTION_STATIC = 0.8 class TestVLMModels(CustomTestCase): parsed_args = None # Class variable to store args @@ -38,6 +40,9 @@ class TestVLMModels(CustomTestCase): cls.api_key = "sk-123456" cls.time_out = DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH + if cls.parsed_args is None: + cls.parsed_args = SimpleNamespace(mem_fraction_static=DEFAULT_MEM_FRACTION_STATIC) + # Set OpenAI API key and base URL environment variables. Needed for lmm-evals to work. os.environ["OPENAI_API_KEY"] = cls.api_key os.environ["OPENAI_API_BASE"] = f"{cls.base_url}/v1" @@ -302,7 +307,7 @@ if __name__ == "__main__": "--mem-fraction-static", type=float, help="Static memory fraction for the model", - default=0.8, + default=DEFAULT_MEM_FRACTION_STATIC, ) # Parse args intended for unittest