diff --git a/.github/workflows/load-tests-pipeline-options/beam_Inference_Python_Benchmarks_Dataflow_Pytorch_Image_Object_Detection.txt b/.github/workflows/load-tests-pipeline-options/beam_Inference_Python_Benchmarks_Dataflow_Pytorch_Image_Object_Detection.txt index 18f017ad0109..5cdaaaacdecf 100644 --- a/.github/workflows/load-tests-pipeline-options/beam_Inference_Python_Benchmarks_Dataflow_Pytorch_Image_Object_Detection.txt +++ b/.github/workflows/load-tests-pipeline-options/beam_Inference_Python_Benchmarks_Dataflow_Pytorch_Image_Object_Detection.txt @@ -31,6 +31,7 @@ --resize_shorter_side=800 --score_threshold=0.5 --max_detections=50 +--timeout_ms=3600000 --input=gs://apache-beam-ml/testing/inputs/openimage_50k_benchmark.txt --model_state_dict_path=gs://apache-beam-ml/models/torchvision.detection.fasterrcnn_resnet50_fpn.pth --runner=DataflowRunner diff --git a/sdks/python/apache_beam/examples/inference/pytorch_image_object_detection.py b/sdks/python/apache_beam/examples/inference/pytorch_image_object_detection.py index a8eef5a7d5e7..63e7a3b4a113 100644 --- a/sdks/python/apache_beam/examples/inference/pytorch_image_object_detection.py +++ b/sdks/python/apache_beam/examples/inference/pytorch_image_object_detection.py @@ -268,6 +268,11 @@ def parse_known_args(argv): 'and publishes them to Pub/Sub. This delay allows the main streaming ' 'pipeline workers to start and scale before data ingestion begins.'), ) + parser.add_argument( + '--timeout_ms', + type=int, + default=1800000, + help='Maximum pipeline runtime before cleanup, in milliseconds.') # Model & inference parser.add_argument( @@ -496,7 +501,7 @@ def run( result = pipeline.run() try: - result.wait_until_finish(duration=1800000) # 30 min + result.wait_until_finish(duration=known_args.timeout_ms) finally: try: result.cancel()