Skip to content

Commit b7edf62

Browse files
committed
Add PyTorch Image Classification EfficientNet-B0 Streaming (Right-fitting) ML pipeline
1 parent 64187d9 commit b7edf62

9 files changed

Lines changed: 715 additions & 2 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
@@ -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_Classification_Rightfit.txt
9596
${{ github.workspace }}/.github/workflows/load-tests-pipeline-options/beam_Inference_Python_Benchmarks_Dataflow_Pytorch_Image_Object_Detection.txt
9697
${{ github.workspace }}/.github/workflows/load-tests-pipeline-options/beam_Inference_Python_Benchmarks_Dataflow_Pytorch_Image_Captioning.txt
9798
# The env variables are created and populated in the test-arguments-action as "<github.job>_test_arguments_<argument_file_paths_index>"
@@ -192,6 +193,17 @@ jobs:
192193
-PpythonVersion=3.10 \
193194
-PloadTest.requirementsTxtFile=apache_beam/ml/inference/torch_tests_requirements.txt \
194195
'-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' \
196+
- name: run PyTorch Image Classification EfficientNet-B0 Streaming (Right-fitting)
197+
uses: ./.github/actions/gradle-command-self-hosted-action
198+
timeout-minutes: 180
199+
with:
200+
gradle-command: :sdks:python:apache_beam:testing:load_tests:run
201+
arguments: |
202+
-PloadTest.mainClass=apache_beam.testing.benchmarks.inference.pytorch_imagenet_rightfit_benchmarks \
203+
-Prunner=DataflowRunner \
204+
-PpythonVersion=3.10 \
205+
-PloadTest.requirementsTxtFile=apache_beam/ml/inference/pytorch_rightfit_requirements.txt \
206+
'-PloadTest.args=${{ env.beam_Inference_Python_Benchmarks_Dataflow_test_arguments_9 }} --mode=streaming --job_name=benchmark-tests-pytorch-imagenet-rightfit-streaming-${{env.NOW_UTC}} --output_table=apache-beam-testing.beam_run_inference.result_torch_inference_imagenet_stream_rightfit' \
195207
- name: run PyTorch Image Object Detection Faster R-CNN ResNet-50 Batch
196208
uses: ./.github/actions/gradle-command-self-hosted-action
197209
timeout-minutes: 180
@@ -202,7 +214,7 @@ jobs:
202214
-Prunner=DataflowRunner \
203215
-PpythonVersion=3.10 \
204216
-PloadTest.requirementsTxtFile=apache_beam/ml/inference/pytorch_image_object_detection_requirements.txt \
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' \
217+
'-PloadTest.args=${{ env.beam_Inference_Python_Benchmarks_Dataflow_test_arguments_10 }} --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' \
206218
- name: run PyTorch Image Captioning BLIP + CLIP Batch
207219
uses: ./.github/actions/gradle-command-self-hosted-action
208220
timeout-minutes: 180
@@ -213,4 +225,4 @@ jobs:
213225
-Prunner=DataflowRunner \
214226
-PpythonVersion=3.10 \
215227
-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'
228+
'-PloadTest.args=${{ env.beam_Inference_Python_Benchmarks_Dataflow_test_arguments_11 }} --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,46 @@
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+
--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_rightfit_requirements.txt
25+
--publish_to_big_query=true
26+
--metrics_dataset=beam_run_inference
27+
--metrics_table=torch_inference_imagenet_results_stream_rightfit
28+
--influx_measurement=torch_inference_imagenet_stream_rightfit
29+
--pretrained_model_name=efficientnet_b0
30+
--device=GPU
31+
--input_file=gs://apache-beam-ml/testing/inputs/openimage_50k_benchmark.txt
32+
--runner=DataflowRunner
33+
--mode=streaming
34+
--input_mode=gcs_uris
35+
--input_options={}
36+
--pubsub_topic=projects/apache-beam-testing/topics/images_topic
37+
--pubsub_subscription=projects/apache-beam-testing/subscriptions/images_subscription
38+
--model_state_dict_path=gs://apache-beam-ml/models/efficientnet_b0_state_dict.pth
39+
--rate_limit=250
40+
--image_size=224
41+
--top_k=5
42+
--inference_batch_size=auto
43+
--window_sec=60
44+
--trigger_proc_time_sec=30
45+
--enable_dedup=false
46+
--experiments=worker_accelerator=type:nvidia-tesla-t4;count:1;install-nvidia-driver:5xx

.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+
("92", ["289", "290", "291", "292", "293"]), # PyTorch Image Classification EfficientNet-B0 Streaming (Right-fitting)
4647
#TODO: PyTorch Image Object Detection Faster R-CNN ResNet-50 Batch
4748
#TODO: PyTorch Image Captioning BLIP + CLIP Batch
4849
]

0 commit comments

Comments
 (0)