From 842d5c9b49ced8b226396e40ef686fdf69c5392b Mon Sep 17 00:00:00 2001 From: Shengliang Xu Date: Tue, 20 Oct 2026 23:55:05 +0000 Subject: [PATCH] Shrink the input of the conv/IsInf ONNX test model build_conv_isinf_model builds a 6x32x900x256 fp32 input (177 MB per activation, and the Conv/Cast/IsInf/Where chain keeps several of them), but the three tests that use it check node dtypes and QDQ placement, never values. Measured as the peak summed RSS of the pytest process tree (imports included) on a CPU host, test_autocast.py peaks at 2.6 GB and test_qdq_rules_int8.py at 2.3 GB; with a 1x32x64x64 input they peak at 1.3 GB and 1.5 GB and run 3.5 s and 1.6 s faster. The assertions are unchanged. Under pytest-xdist the memory adds up: four workers run files at once, and each worker that has used cpu_dist_workers keeps its two-rank pool alive. Of the 251 unit test files run alone, these two are the 9th and 10th largest; the eight above them (2.9-3.6 GB) are six files that use the pool, test_gptq.py (it spawns its own processes) and test_distill.py. A transient spike of 0.8-1.2 GB in one worker is what tips a 4-vCPU runner over: the hfep PRs' torch_28 unit jobs were stopped by the runner ("received a shutdown signal") with these tests in flight in 9 of 33 runs. Signed-off-by: Shengliang Xu --- tests/_test_utils/onnx/lib_test_models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/_test_utils/onnx/lib_test_models.py b/tests/_test_utils/onnx/lib_test_models.py index 57a0621c5da..d7527e859ca 100644 --- a/tests/_test_utils/onnx/lib_test_models.py +++ b/tests/_test_utils/onnx/lib_test_models.py @@ -833,8 +833,9 @@ def build_conv_isinf_model(opset_version=13): # Define your model inputs and outputs input_names = ["input_0"] output_names = ["output_0"] - input_shapes = [(6, 32, 900, 256)] - output_shapes = [(6, 32, 900, 256)] + # Small: the tests check node dtypes, not values, and a large activation costs GBs per worker + input_shapes = [(1, 32, 64, 64)] + output_shapes = [(1, 32, 64, 64)] inputs = [ helper.make_tensor_value_info(input_name, onnx.TensorProto.FLOAT, input_shape)