Skip to content

Commit 6a09efb

Browse files
committed
ML pipelines: RunInference - OSS Image Object detection
1 parent 358e007 commit 6a09efb

9 files changed

Lines changed: 590 additions & 1 deletion

File tree

.github/workflows/beam_Inference_Python_Benchmarks_Dataflow.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ jobs:
9292
${{ github.workspace }}/.github/workflows/load-tests-pipeline-options/beam_Inference_Python_Benchmarks_Dataflow_Pytorch_Sentiment_Streaming_DistilBert_Base_Uncased.txt
9393
${{ github.workspace }}/.github/workflows/load-tests-pipeline-options/beam_Inference_Python_Benchmarks_Dataflow_Pytorch_Sentiment_Batch_DistilBert_Base_Uncased.txt
9494
${{ github.workspace }}/.github/workflows/load-tests-pipeline-options/beam_Inference_Python_Benchmarks_Dataflow_VLLM_Gemma_Batch.txt
95+
${{ github.workspace }}/.github/workflows/load-tests-pipeline-options/beam_Inference_Python_Benchmarks_Dataflow_Pytorch_Image_Detection.txt
9596
# The env variables are created and populated in the test-arguments-action as "<github.job>_test_arguments_<argument_file_paths_index>"
9697
- name: get current time
9798
run: echo "NOW_UTC=$(date '+%m%d%H%M%S' --utc)" >> $GITHUB_ENV
@@ -189,4 +190,15 @@ jobs:
189190
-Prunner=DataflowRunner \
190191
-PpythonVersion=3.10 \
191192
-PloadTest.requirementsTxtFile=apache_beam/ml/inference/torch_tests_requirements.txt \
192-
'-PloadTest.args=${{ env.beam_Inference_Python_Benchmarks_Dataflow_test_arguments_5 }} --job_name=benchmark-tests-pytorch-imagenet-python-gpu-${{env.NOW_UTC}} --output=gs://temp-storage-for-end-to-end-tests/torch/result_resnet152_gpu-${{env.NOW_UTC}}.txt'
193+
'-PloadTest.args=${{ env.beam_Inference_Python_Benchmarks_Dataflow_test_arguments_5 }} --job_name=benchmark-tests-pytorch-imagenet-python-gpu-${{env.NOW_UTC}} --output=gs://temp-storage-for-end-to-end-tests/torch/result_resnet152_gpu-${{env.NOW_UTC}}.txt'
194+
- name: run PyTorch Image Object Detection Faster R-CNN ResNet-50 Batch
195+
uses: ./.github/actions/gradle-command-self-hosted-action
196+
timeout-minutes: 180
197+
with:
198+
gradle-command: :sdks:python:apache_beam:testing:load_tests:run
199+
arguments: |
200+
-PloadTest.mainClass=apache_beam.testing.benchmarks.inference.pytorch_object_detection_benchmarks \
201+
-Prunner=DataflowRunner \
202+
-PpythonVersion=3.10 \
203+
-PloadTest.requirementsTxtFile=apache_beam/ml/inference/pytorch_object_detection_requirements.txt \
204+
'-PloadTest.args=${{ env.beam_Inference_Python_Benchmarks_Dataflow_test_arguments_9 }} --mode=batch --job_name=benchmark-tests-pytorch-object_detection-batch-${{env.NOW_UTC}} --output_table=apache-beam-testing.beam_run_inference.result_torch_inference_object_detection_batch' \
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
--region=us-central1
18+
--worker_machine_type=n1-standard-4
19+
--num_workers=50
20+
--disk_size_gb=50
21+
--autoscaling_algorithm=NONE
22+
--staging_location=gs://temp-storage-for-perf-tests/loadtests
23+
--temp_location=gs://temp-storage-for-perf-tests/loadtests
24+
--requirements_file=apache_beam/ml/inference/pytorch_object_detection_requirements.txt
25+
--publish_to_big_query=true
26+
--metrics_dataset=beam_run_inference
27+
--metrics_table=result_torch_inference_object_detection_batch
28+
--input_options={}
29+
--influx_measurement=result_torch_inference_object_detection_batch
30+
--pretrained_model_name=fasterrcnn_resnet50_fpn
31+
--device=GPU
32+
--mode=batch
33+
--inference_batch_size=8
34+
--resize_shorter_side=800
35+
--score_threshold=0.5
36+
--max_detections=50
37+
--input=gs://apache-beam-ml/testing/inputs/openimage_50k_benchmark.txt
38+
--model_state_dict_path=gs://apache-beam-ml/models/torchvision.detection.fasterrcnn_resnet50_fpn.pth
39+
--runner=DataflowRunner
40+
--experiments=use_runner_v2
41+
--worker_accelerator=type=nvidia-tesla-t4,count=1,install-nvidia-driver=true

.test-infra/tools/refresh_looker_metrics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
("82", ["263", "264", "265", "266", "267"]), # PyTorch Sentiment Streaming DistilBERT base uncased
4444
("85", ["268", "269", "270", "271", "272"]), # PyTorch Sentiment Batch DistilBERT base uncased
4545
("86", ["284", "285", "286", "287", "288"]), # VLLM Batch Gemma
46+
#TODO: PyTorch Image Object Detection Faster R-CNN ResNet-50 Batch
4647
]
4748

4849

0 commit comments

Comments
 (0)