Skip to content

Commit 40787d2

Browse files
committed
Add PyTorch Image Classification EfficientNet-B0 Streaming (Right-fitting) ML pipeline
1 parent 4e0dbb9 commit 40787d2

File tree

9 files changed

+713
-1
lines changed

9 files changed

+713
-1
lines changed

.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_Classification_Rightfit.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 Classification EfficientNet-B0 Streaming (Right-fitting)
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_imagenet_rightfit_benchmarks \
201+
-Prunner=DataflowRunner \
202+
-PpythonVersion=3.10 \
203+
-PloadTest.requirementsTxtFile=apache_beam/ml/inference/pytorch_rightfit_requirements.txt \
204+
'-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' \
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
]
4748

4849

0 commit comments

Comments
 (0)