Skip to content

Commit a22d694

Browse files
committed
Add PyTorch Image Captioning BLIP + CLIP Batch
1 parent 281509a commit a22d694

10 files changed

Lines changed: 650 additions & 4 deletions

File tree

.github/workflows/beam_Inference_Python_Benchmarks_Dataflow.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ jobs:
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
9595
${{ github.workspace }}/.github/workflows/load-tests-pipeline-options/beam_Inference_Python_Benchmarks_Dataflow_Pytorch_Image_Object_Detection.txt
96+
${{ github.workspace }}/.github/workflows/load-tests-pipeline-options/beam_Inference_Python_Benchmarks_Dataflow_Pytorch_Image_Object_Captioning.txt
9697
# The env variables are created and populated in the test-arguments-action as "<github.job>_test_arguments_<argument_file_paths_index>"
9798
- name: get current time
9899
run: echo "NOW_UTC=$(date '+%m%d%H%M%S' --utc)" >> $GITHUB_ENV
@@ -190,7 +191,7 @@ jobs:
190191
-Prunner=DataflowRunner \
191192
-PpythonVersion=3.10 \
192193
-PloadTest.requirementsTxtFile=apache_beam/ml/inference/torch_tests_requirements.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+
'-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' \
194195
- name: run PyTorch Image Object Detection Faster R-CNN ResNet-50 Batch
195196
uses: ./.github/actions/gradle-command-self-hosted-action
196197
timeout-minutes: 180
@@ -201,4 +202,15 @@ jobs:
201202
-Prunner=DataflowRunner \
202203
-PpythonVersion=3.10 \
203204
-PloadTest.requirementsTxtFile=apache_beam/ml/inference/pytorch_image_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' \
205+
'-PloadTest.args=${{ env.beam_Inference_Python_Benchmarks_Dataflow_test_arguments_9 }} --mode=batch --job_name=benchmark-tests-pytorch-image-object_detection-batch-${{env.NOW_UTC}} --output_table=apache-beam-testing.beam_run_inference.result_torch_inference_image_object_detection_batch' \
206+
- name: run PyTorch Image Captioning BLIP + CLIP Batch
207+
uses: ./.github/actions/gradle-command-self-hosted-action
208+
timeout-minutes: 180
209+
with:
210+
gradle-command: :sdks:python:apache_beam:testing:load_tests:run
211+
arguments: |
212+
-PloadTest.mainClass=apache_beam.testing.benchmarks.inference.pytorch_image_captioning_benchmarks \
213+
-Prunner=DataflowRunner \
214+
-PpythonVersion=3.10 \
215+
-PloadTest.requirementsTxtFile=apache_beam/ml/inference/pytorch_image_captioning_requirements.txt \
216+
'-PloadTest.args=${{ env.beam_Inference_Python_Benchmarks_Dataflow_test_arguments_10 }} --mode=batch --job_name=benchmark-tests-pytorch-image-captioning-batch-${{env.NOW_UTC}} --output_table=apache-beam-testing.beam_run_inference.result_torch_inference_image_captioning_batch'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# distributed with this work for additional information
2+
# regarding copyright ownership. The ASF licenses this file
3+
# to you under the Apache License, Version 2.0 (the
4+
# "License"); you may not use this file except in compliance
5+
# with the License. You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
--region=us-central1
16+
--worker_machine_type=n1-standard-4
17+
--num_workers=50
18+
--disk_size_gb=50
19+
--autoscaling_algorithm=NONE
20+
--staging_location=gs://temp-storage-for-perf-tests/loadtests
21+
--temp_location=gs://temp-storage-for-perf-tests/loadtests
22+
--requirements_file=apache_beam/ml/inference/pytorch_image_captioning_requirements.txt
23+
--publish_to_big_query=true
24+
--metrics_dataset=beam_run_inference
25+
--metrics_table=result_torch_inference_image_captioning_batch
26+
--input_options={}
27+
--influx_measurement=result_torch_inference_image_captioning_batch
28+
--device=GPU
29+
--mode=batch
30+
--input=gs://apache-beam-ml/testing/inputs/openimage_50k_benchmark.txt
31+
--blip_model_name=Salesforce/blip-image-captioning-base
32+
--blip_batch_size=4
33+
--num_captions=5
34+
--max_new_tokens=30
35+
--num_beams=5
36+
--clip_model_name=openai/clip-vit-base-patch32
37+
--clip_batch_size=8
38+
--clip_score_normalize=false
39+
--runner=DataflowRunner
40+
--experiments=use_runner_v2
41+
--worker_accelerator=type=nvidia-tesla-t4,count=1,install-nvidia-driver=true

.github/workflows/load-tests-pipeline-options/beam_Inference_Python_Benchmarks_Dataflow_Pytorch_Image_Object_Detection.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
--requirements_file=apache_beam/ml/inference/pytorch_image_object_detection_requirements.txt
2525
--publish_to_big_query=true
2626
--metrics_dataset=beam_run_inference
27-
--metrics_table=result_torch_inference_object_detection_batch
27+
--metrics_table=result_torch_inference_image_object_detection_batch
2828
--input_options={}
29-
--influx_measurement=result_torch_inference_object_detection_batch
29+
--influx_measurement=result_torch_inference_image_object_detection_batch
3030
--pretrained_model_name=fasterrcnn_resnet50_fpn
3131
--device=GPU
3232
--mode=batch

.test-infra/tools/refresh_looker_metrics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
("85", ["268", "269", "270", "271", "272"]), # PyTorch Sentiment Batch DistilBERT base uncased
4545
("86", ["284", "285", "286", "287", "288"]), # VLLM Batch Gemma
4646
#TODO: PyTorch Image Object Detection Faster R-CNN ResNet-50 Batch
47+
#TODO: PyTorch Image Captioning BLIP + CLIP Batch
4748
]
4849

4950

0 commit comments

Comments
 (0)