You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/09/01 17:55:04 UTC

[GitHub] [beam] damccorm commented on a diff in pull request #21738: Inference benchmark tests

damccorm commented on code in PR #21738:
URL: https://github.com/apache/beam/pull/21738#discussion_r960940764


##########
.test-infra/jenkins/job_InferenceBenchmarkTests_Python.groovy:
##########
@@ -0,0 +1,159 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import CommonJobProperties as commonJobProperties
+import LoadTestsBuilder as loadTestsBuilder
+import PhraseTriggeringPostCommitBuilder
+import CronJobBuilder
+
+def now = new Date().format("MMddHHmmss", TimeZone.getTimeZone('UTC'))
+
+def loadTestConfigurations = {
+  ->
+  [
+    // Benchmark test config. Add multiple configs for multiple models.
+    [
+      title             : 'Pytorch Vision Classification with Resnet 101',
+      test              : 'apache_beam.testing.benchmarks.inference.pytorch_image_classification_benchmarks',
+      runner            : CommonTestProperties.Runner.DATAFLOW,
+      pipelineOptions: [
+        job_name              : 'benchmark-tests-pytorch-imagenet-python' + now,
+        project               : 'apache-beam-testing',
+        region                : 'us-central1',
+        staging_location      : 'gs://temp-storage-for-perf-tests/loadtests',
+        temp_location         : 'gs://temp-storage-for-perf-tests/loadtests',
+        requirements_file     : 'apache_beam/ml/inference/torch_tests_requirements.txt',
+        experiments           : 'no_use_multiple_sdk_containers',
+        publish_to_big_query  : true,
+        metrics_dataset       : 'beam_run_inference',
+        metrics_table         : 'torch_inference_imagenet_results_resnet101',
+        input_options         : '{}', // this option is not required for RunInference tests.
+        influx_measurement    : 'torch_inference_imagenet_resnet101',
+        influx_db_name        : InfluxDBCredentialsHelper.InfluxDBDatabaseName,
+        influx_hostname       : InfluxDBCredentialsHelper.InfluxDBHostUrl,
+        pretrained_model_name : 'resnet101',
+        input                 : 'gs://apache-beam-ml/testing/inputs/openimage_50k_benchmark.txt',
+        model_state_dict_path : 'gs://apache-beam-ml/models/torchvision.models.resnet101.pth',
+        output                : 'gs://temp-storage-for-end-to-end-tests/torch/result_101' + now + '.txt'
+      ]
+    ],
+    [
+      title             : 'Pytorch Imagenet Classification with Resnet 152',
+      test              : 'apache_beam.testing.benchmarks.inference.pytorch_image_classification_benchmarks',
+      runner            : CommonTestProperties.Runner.DATAFLOW,
+      pipelineOptions: [
+        job_name              : 'benchmark-tests-pytorch-imagenet-python' + now,
+        project               : 'apache-beam-testing',
+        region                : 'us-central1',
+        staging_location      : 'gs://temp-storage-for-perf-tests/loadtests',
+        temp_location         : 'gs://temp-storage-for-perf-tests/loadtests',
+        requirements_file     : 'apache_beam/ml/inference/torch_tests_requirements.txt',
+        experiments           : 'no_use_multiple_sdk_containers',
+        publish_to_big_query  : true,
+        metrics_dataset       : 'beam_run_inference',
+        metrics_table         : 'torch_inference_imagenet_results_resnet152',
+        input_options         : '{}', // this option is not required for RunInference tests.
+        influx_measurement    : 'torch_inference_imagenet_resnet152',
+        influx_db_name        : InfluxDBCredentialsHelper.InfluxDBDatabaseName,
+        influx_hostname       : InfluxDBCredentialsHelper.InfluxDBHostUrl,
+        pretrained_model_name : 'resnet152',
+        input                 : 'gs://apache-beam-ml/testing/inputs/openimage_50k_benchmark.txt',
+        model_state_dict_path : 'gs://apache-beam-ml/models/torchvision.models.resnet152.pth',
+        output                : 'gs://temp-storage-for-end-to-end-tests/torch/result_resnet152' + now + '.txt'
+      ]
+    ],
+    // Pytorch language modeling test using HuggingFace BERT models
+    [
+      title             : 'Pytorch Lanugaue Modeling using Hugging face bert-base-uncased model',
+      test              : 'apache_beam.testing.benchmarks.inference.pytorch_language_modeling_benchmarks',
+      runner            : CommonTestProperties.Runner.DATAFLOW,
+      pipelineOptions: [
+        job_name              : 'benchmark-tests-pytorch-language-modeling-bert-base-uncased' + now,
+        project               : 'apache-beam-testing',
+        region                : 'us-central1',
+        staging_location      : 'gs://temp-storage-for-perf-tests/loadtests',
+        temp_location         : 'gs://temp-storage-for-perf-tests/loadtests',
+        requirements_file     : 'apache_beam/ml/inference/torch_tests_requirements.txt',
+        pickle_library       : 'cloudpickle',
+        experiments           : 'no_use_multiple_sdk_containers',
+        publish_to_big_query  : true,
+        metrics_dataset       : 'beam_run_inference',
+        metrics_table         : 'torch_language_modeling_bert_base_uncased',
+        input_options         : '{}', // this option is not required for RunInference tests.
+        influx_measurement    : 'torch_language_modeling_bert_base_uncased',
+        influx_db_name        : InfluxDBCredentialsHelper.InfluxDBDatabaseName,
+        influx_hostname       : InfluxDBCredentialsHelper.InfluxDBHostUrl,
+        input                 : 'gs://apache-beam-ml/testing/inputs/sentences_50k.txt',
+        bert_tokenizer        : 'bert-base-uncased',
+        model_state_dict_path : 'gs://apache-beam-ml/models/huggingface.BertForMaskedLM.bert-base-uncased.pth',
+        output                : 'gs://temp-storage-for-end-to-end-tests/torch/result_bert_base_uncased' + now + '.txt',
+      ]
+    ],
+    [
+      title             : 'Pytorch Langauge Modeling using Hugging Face bert-large-uncased model',
+      test              : 'apache_beam.testing.benchmarks.inference.pytorch_language_modeling_benchmarks',
+      runner            : CommonTestProperties.Runner.DATAFLOW,
+      pipelineOptions: [
+        job_name              : 'benchmark-tests-pytorch-language-modeling-bert-large-cased' + now,
+        project               : 'apache-beam-testing',
+        region                : 'us-central1',
+        staging_location      : 'gs://temp-storage-for-perf-tests/loadtests',
+        temp_location         : 'gs://temp-storage-for-perf-tests/loadtests',
+        requirements_file     : 'apache_beam/ml/inference/torch_tests_requirements.txt',
+        pickle_library       : 'cloudpickle',
+        experiments           : 'no_use_multiple_sdk_containers',
+        publish_to_big_query  : true,
+        metrics_dataset       : 'beam_run_inference',
+        metrics_table         : 'torch_language_modeling_bert_large_uncased',
+        input_options         : '{}', // this option is not required for RunInference tests.
+        influx_measurement    : 'torch_language_modeling_bert_large_uncased',
+        influx_db_name        : InfluxDBCredentialsHelper.InfluxDBDatabaseName,
+        influx_hostname       : InfluxDBCredentialsHelper.InfluxDBHostUrl,
+        input                 : 'gs://apache-beam-ml/testing/inputs/sentences_50k.txt',
+        bert_tokenizer        : 'bert-large-uncased',
+        model_state_dict_path : 'gs://apache-beam-ml/models/huggingface.BertForMaskedLM.bert-large-uncased.pth',
+        output                : 'gs://temp-storage-for-end-to-end-tests/torch/result_bert_large_uncased' + now + '.txt'
+      ]
+    ],
+  ]
+}
+
+def loadTestJob = { scope ->
+  List<Map> testScenarios = loadTestConfigurations()
+  for (Map testConfig: testScenarios){
+    commonJobProperties.setTopLevelMainJobProperties(scope, 'master', 180)
+    loadTestsBuilder.loadTest(scope, testConfig.title, testConfig.runner, CommonTestProperties.SDK.PYTHON, testConfig.pipelineOptions, testConfig.test, null, testConfig.pipelineOptions.requirements_file)
+  }
+}
+
+PhraseTriggeringPostCommitBuilder.postCommitJob(
+    'beam_Inference_Python_Benchmarks_Dataflow',
+    'Run Inference Benchmarks',
+    'Inference benchmarks on Dataflow(\"Run Inference Benchmarks"\"")',
+    this
+    ) {
+      loadTestJob(delegate)
+    }
+
+// TODO(anandinguva): Change the cron job to run once a day
+CronJobBuilder.cronJob(
+    'beam_Inference_Python_Benchmarks_Dataflow', 'H 24 * * *',

Review Comment:
   Helpful cron validator - https://crontab.guru/#0_2_*_*_*
   
   More info about H - https://stackoverflow.com/questions/47302607/meaning-of-h-5-in-cron-jenkins



##########
.test-infra/jenkins/job_InferenceBenchmarkTests_Python.groovy:
##########
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import CommonJobProperties as commonJobProperties
+import LoadTestsBuilder as loadTestsBuilder

Review Comment:
   I think these come from weird space characters via copy paste? I've seen them elsewhere and they've been harmless



##########
sdks/python/apache_beam/options/pipeline_options.py:
##########
@@ -205,7 +205,9 @@ def __init__(self, flags=None, **kwargs):
 
     # Build parser that will parse options recognized by the [sub]class of
     # PipelineOptions whose object is being instantiated.
-    parser = _BeamArgumentParser()
+    # set allow_abbrev=False to avoid prefix matching while parsing.
+    # https://docs.python.org/3/library/argparse.html#partial-parsing
+    parser = _BeamArgumentParser(allow_abbrev=False)

Review Comment:
   I'm also a little nervous about this change - could you help me understand why we need it?
   
   It seems like it would definitely have the potential to break existing pipelines - if we need to do that, it might be better to detect and warn that the behavior will be changed in the future.



##########
sdks/python/apache_beam/testing/benchmarks/inference/pytorch_language_modeling_benchmarks.py:
##########
@@ -0,0 +1,38 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# pytype: skip-file
+
+import logging
+
+from apache_beam.examples.inference import pytorch_language_modeling
+from apache_beam.testing.load_tests.load_test import LoadTest
+
+
+class PytorchLanguageModelingBenchmarkTest(LoadTest):
+  def __init__(self):
+    # TODO (anandinguva): make get_namespace() method in RunInference static

Review Comment:
   Same comment above - please update to `get_metrics_namespace` and add an issue link instead of username in the TODO



##########
.test-infra/jenkins/job_InferenceBenchmarkTests_Python.groovy:
##########
@@ -0,0 +1,159 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import CommonJobProperties as commonJobProperties
+import LoadTestsBuilder as loadTestsBuilder
+import PhraseTriggeringPostCommitBuilder
+import CronJobBuilder
+
+def now = new Date().format("MMddHHmmss", TimeZone.getTimeZone('UTC'))
+
+def loadTestConfigurations = {
+  ->
+  [
+    // Benchmark test config. Add multiple configs for multiple models.
+    [
+      title             : 'Pytorch Vision Classification with Resnet 101',
+      test              : 'apache_beam.testing.benchmarks.inference.pytorch_image_classification_benchmarks',
+      runner            : CommonTestProperties.Runner.DATAFLOW,
+      pipelineOptions: [
+        job_name              : 'benchmark-tests-pytorch-imagenet-python' + now,
+        project               : 'apache-beam-testing',
+        region                : 'us-central1',
+        staging_location      : 'gs://temp-storage-for-perf-tests/loadtests',
+        temp_location         : 'gs://temp-storage-for-perf-tests/loadtests',
+        requirements_file     : 'apache_beam/ml/inference/torch_tests_requirements.txt',
+        experiments           : 'no_use_multiple_sdk_containers',
+        publish_to_big_query  : true,
+        metrics_dataset       : 'beam_run_inference',
+        metrics_table         : 'torch_inference_imagenet_results_resnet101',
+        input_options         : '{}', // this option is not required for RunInference tests.
+        influx_measurement    : 'torch_inference_imagenet_resnet101',
+        influx_db_name        : InfluxDBCredentialsHelper.InfluxDBDatabaseName,
+        influx_hostname       : InfluxDBCredentialsHelper.InfluxDBHostUrl,
+        pretrained_model_name : 'resnet101',
+        input                 : 'gs://apache-beam-ml/testing/inputs/openimage_50k_benchmark.txt',
+        model_state_dict_path : 'gs://apache-beam-ml/models/torchvision.models.resnet101.pth',
+        output                : 'gs://temp-storage-for-end-to-end-tests/torch/result_101' + now + '.txt'
+      ]
+    ],
+    [
+      title             : 'Pytorch Imagenet Classification with Resnet 152',
+      test              : 'apache_beam.testing.benchmarks.inference.pytorch_image_classification_benchmarks',
+      runner            : CommonTestProperties.Runner.DATAFLOW,
+      pipelineOptions: [
+        job_name              : 'benchmark-tests-pytorch-imagenet-python' + now,
+        project               : 'apache-beam-testing',
+        region                : 'us-central1',
+        staging_location      : 'gs://temp-storage-for-perf-tests/loadtests',
+        temp_location         : 'gs://temp-storage-for-perf-tests/loadtests',
+        requirements_file     : 'apache_beam/ml/inference/torch_tests_requirements.txt',
+        experiments           : 'no_use_multiple_sdk_containers',
+        publish_to_big_query  : true,
+        metrics_dataset       : 'beam_run_inference',
+        metrics_table         : 'torch_inference_imagenet_results_resnet152',
+        input_options         : '{}', // this option is not required for RunInference tests.
+        influx_measurement    : 'torch_inference_imagenet_resnet152',
+        influx_db_name        : InfluxDBCredentialsHelper.InfluxDBDatabaseName,
+        influx_hostname       : InfluxDBCredentialsHelper.InfluxDBHostUrl,
+        pretrained_model_name : 'resnet152',
+        input                 : 'gs://apache-beam-ml/testing/inputs/openimage_50k_benchmark.txt',
+        model_state_dict_path : 'gs://apache-beam-ml/models/torchvision.models.resnet152.pth',
+        output                : 'gs://temp-storage-for-end-to-end-tests/torch/result_resnet152' + now + '.txt'
+      ]
+    ],
+    // Pytorch language modeling test using HuggingFace BERT models
+    [
+      title             : 'Pytorch Lanugaue Modeling using Hugging face bert-base-uncased model',
+      test              : 'apache_beam.testing.benchmarks.inference.pytorch_language_modeling_benchmarks',
+      runner            : CommonTestProperties.Runner.DATAFLOW,
+      pipelineOptions: [
+        job_name              : 'benchmark-tests-pytorch-language-modeling-bert-base-uncased' + now,
+        project               : 'apache-beam-testing',
+        region                : 'us-central1',
+        staging_location      : 'gs://temp-storage-for-perf-tests/loadtests',
+        temp_location         : 'gs://temp-storage-for-perf-tests/loadtests',
+        requirements_file     : 'apache_beam/ml/inference/torch_tests_requirements.txt',
+        pickle_library       : 'cloudpickle',
+        experiments           : 'no_use_multiple_sdk_containers',
+        publish_to_big_query  : true,
+        metrics_dataset       : 'beam_run_inference',
+        metrics_table         : 'torch_language_modeling_bert_base_uncased',
+        input_options         : '{}', // this option is not required for RunInference tests.
+        influx_measurement    : 'torch_language_modeling_bert_base_uncased',
+        influx_db_name        : InfluxDBCredentialsHelper.InfluxDBDatabaseName,
+        influx_hostname       : InfluxDBCredentialsHelper.InfluxDBHostUrl,
+        input                 : 'gs://apache-beam-ml/testing/inputs/sentences_50k.txt',
+        bert_tokenizer        : 'bert-base-uncased',
+        model_state_dict_path : 'gs://apache-beam-ml/models/huggingface.BertForMaskedLM.bert-base-uncased.pth',
+        output                : 'gs://temp-storage-for-end-to-end-tests/torch/result_bert_base_uncased' + now + '.txt',
+      ]
+    ],
+    [
+      title             : 'Pytorch Langauge Modeling using Hugging Face bert-large-uncased model',
+      test              : 'apache_beam.testing.benchmarks.inference.pytorch_language_modeling_benchmarks',
+      runner            : CommonTestProperties.Runner.DATAFLOW,
+      pipelineOptions: [
+        job_name              : 'benchmark-tests-pytorch-language-modeling-bert-large-cased' + now,
+        project               : 'apache-beam-testing',
+        region                : 'us-central1',
+        staging_location      : 'gs://temp-storage-for-perf-tests/loadtests',
+        temp_location         : 'gs://temp-storage-for-perf-tests/loadtests',
+        requirements_file     : 'apache_beam/ml/inference/torch_tests_requirements.txt',
+        pickle_library       : 'cloudpickle',
+        experiments           : 'no_use_multiple_sdk_containers',
+        publish_to_big_query  : true,
+        metrics_dataset       : 'beam_run_inference',
+        metrics_table         : 'torch_language_modeling_bert_large_uncased',
+        input_options         : '{}', // this option is not required for RunInference tests.
+        influx_measurement    : 'torch_language_modeling_bert_large_uncased',
+        influx_db_name        : InfluxDBCredentialsHelper.InfluxDBDatabaseName,
+        influx_hostname       : InfluxDBCredentialsHelper.InfluxDBHostUrl,
+        input                 : 'gs://apache-beam-ml/testing/inputs/sentences_50k.txt',
+        bert_tokenizer        : 'bert-large-uncased',
+        model_state_dict_path : 'gs://apache-beam-ml/models/huggingface.BertForMaskedLM.bert-large-uncased.pth',
+        output                : 'gs://temp-storage-for-end-to-end-tests/torch/result_bert_large_uncased' + now + '.txt'
+      ]
+    ],
+  ]
+}
+
+def loadTestJob = { scope ->
+  List<Map> testScenarios = loadTestConfigurations()
+  for (Map testConfig: testScenarios){
+    commonJobProperties.setTopLevelMainJobProperties(scope, 'master', 180)
+    loadTestsBuilder.loadTest(scope, testConfig.title, testConfig.runner, CommonTestProperties.SDK.PYTHON, testConfig.pipelineOptions, testConfig.test, null, testConfig.pipelineOptions.requirements_file)
+  }
+}
+
+PhraseTriggeringPostCommitBuilder.postCommitJob(
+    'beam_Inference_Python_Benchmarks_Dataflow',
+    'Run Inference Benchmarks',
+    'Inference benchmarks on Dataflow(\"Run Inference Benchmarks"\"")',
+    this
+    ) {
+      loadTestJob(delegate)
+    }
+
+// TODO(anandinguva): Change the cron job to run once a day

Review Comment:
   Nit - remove hanging TODO



##########
sdks/python/apache_beam/testing/benchmarks/inference/pytorch_image_classification_benchmarks.py:
##########
@@ -0,0 +1,63 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# pytype: skip-file
+
+import logging
+
+from apache_beam.examples.inference import pytorch_image_classification
+from apache_beam.testing.load_tests.load_test import LoadTest
+from torchvision import models
+
+_PERF_TEST_MODELS = ['resnet50', 'resnet101', 'resnet152']
+_PRETRAINED_MODEL_MODULE = 'torchvision.models'
+
+
+class PytorchVisionBenchmarkTest(LoadTest):
+  def __init__(self):
+    # TODO (anandinguva): make get_namespace() method in RunInference static

Review Comment:
   Agreed - could you update to `get_metrics_namespace` and link to an issue in the TODO instead of just your username?



##########
.test-infra/jenkins/job_InferenceBenchmarkTests_Python.groovy:
##########
@@ -0,0 +1,159 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import CommonJobProperties as commonJobProperties
+import LoadTestsBuilder as loadTestsBuilder
+import PhraseTriggeringPostCommitBuilder
+import CronJobBuilder
+
+def now = new Date().format("MMddHHmmss", TimeZone.getTimeZone('UTC'))
+
+def loadTestConfigurations = {
+  ->
+  [
+    // Benchmark test config. Add multiple configs for multiple models.
+    [
+      title             : 'Pytorch Vision Classification with Resnet 101',
+      test              : 'apache_beam.testing.benchmarks.inference.pytorch_image_classification_benchmarks',
+      runner            : CommonTestProperties.Runner.DATAFLOW,
+      pipelineOptions: [
+        job_name              : 'benchmark-tests-pytorch-imagenet-python' + now,
+        project               : 'apache-beam-testing',
+        region                : 'us-central1',
+        staging_location      : 'gs://temp-storage-for-perf-tests/loadtests',
+        temp_location         : 'gs://temp-storage-for-perf-tests/loadtests',
+        requirements_file     : 'apache_beam/ml/inference/torch_tests_requirements.txt',
+        experiments           : 'no_use_multiple_sdk_containers',
+        publish_to_big_query  : true,
+        metrics_dataset       : 'beam_run_inference',
+        metrics_table         : 'torch_inference_imagenet_results_resnet101',
+        input_options         : '{}', // this option is not required for RunInference tests.
+        influx_measurement    : 'torch_inference_imagenet_resnet101',
+        influx_db_name        : InfluxDBCredentialsHelper.InfluxDBDatabaseName,
+        influx_hostname       : InfluxDBCredentialsHelper.InfluxDBHostUrl,
+        pretrained_model_name : 'resnet101',
+        input                 : 'gs://apache-beam-ml/testing/inputs/openimage_50k_benchmark.txt',
+        model_state_dict_path : 'gs://apache-beam-ml/models/torchvision.models.resnet101.pth',
+        output                : 'gs://temp-storage-for-end-to-end-tests/torch/result_101' + now + '.txt'
+      ]
+    ],
+    [
+      title             : 'Pytorch Imagenet Classification with Resnet 152',
+      test              : 'apache_beam.testing.benchmarks.inference.pytorch_image_classification_benchmarks',
+      runner            : CommonTestProperties.Runner.DATAFLOW,
+      pipelineOptions: [
+        job_name              : 'benchmark-tests-pytorch-imagenet-python' + now,
+        project               : 'apache-beam-testing',
+        region                : 'us-central1',
+        staging_location      : 'gs://temp-storage-for-perf-tests/loadtests',
+        temp_location         : 'gs://temp-storage-for-perf-tests/loadtests',
+        requirements_file     : 'apache_beam/ml/inference/torch_tests_requirements.txt',
+        experiments           : 'no_use_multiple_sdk_containers',
+        publish_to_big_query  : true,
+        metrics_dataset       : 'beam_run_inference',
+        metrics_table         : 'torch_inference_imagenet_results_resnet152',
+        input_options         : '{}', // this option is not required for RunInference tests.
+        influx_measurement    : 'torch_inference_imagenet_resnet152',
+        influx_db_name        : InfluxDBCredentialsHelper.InfluxDBDatabaseName,
+        influx_hostname       : InfluxDBCredentialsHelper.InfluxDBHostUrl,
+        pretrained_model_name : 'resnet152',
+        input                 : 'gs://apache-beam-ml/testing/inputs/openimage_50k_benchmark.txt',
+        model_state_dict_path : 'gs://apache-beam-ml/models/torchvision.models.resnet152.pth',
+        output                : 'gs://temp-storage-for-end-to-end-tests/torch/result_resnet152' + now + '.txt'
+      ]
+    ],
+    // Pytorch language modeling test using HuggingFace BERT models
+    [
+      title             : 'Pytorch Lanugaue Modeling using Hugging face bert-base-uncased model',
+      test              : 'apache_beam.testing.benchmarks.inference.pytorch_language_modeling_benchmarks',
+      runner            : CommonTestProperties.Runner.DATAFLOW,
+      pipelineOptions: [
+        job_name              : 'benchmark-tests-pytorch-language-modeling-bert-base-uncased' + now,
+        project               : 'apache-beam-testing',
+        region                : 'us-central1',
+        staging_location      : 'gs://temp-storage-for-perf-tests/loadtests',
+        temp_location         : 'gs://temp-storage-for-perf-tests/loadtests',
+        requirements_file     : 'apache_beam/ml/inference/torch_tests_requirements.txt',
+        pickle_library       : 'cloudpickle',
+        experiments           : 'no_use_multiple_sdk_containers',
+        publish_to_big_query  : true,
+        metrics_dataset       : 'beam_run_inference',
+        metrics_table         : 'torch_language_modeling_bert_base_uncased',
+        input_options         : '{}', // this option is not required for RunInference tests.
+        influx_measurement    : 'torch_language_modeling_bert_base_uncased',
+        influx_db_name        : InfluxDBCredentialsHelper.InfluxDBDatabaseName,
+        influx_hostname       : InfluxDBCredentialsHelper.InfluxDBHostUrl,
+        input                 : 'gs://apache-beam-ml/testing/inputs/sentences_50k.txt',
+        bert_tokenizer        : 'bert-base-uncased',
+        model_state_dict_path : 'gs://apache-beam-ml/models/huggingface.BertForMaskedLM.bert-base-uncased.pth',
+        output                : 'gs://temp-storage-for-end-to-end-tests/torch/result_bert_base_uncased' + now + '.txt',
+      ]
+    ],
+    [
+      title             : 'Pytorch Langauge Modeling using Hugging Face bert-large-uncased model',
+      test              : 'apache_beam.testing.benchmarks.inference.pytorch_language_modeling_benchmarks',
+      runner            : CommonTestProperties.Runner.DATAFLOW,
+      pipelineOptions: [
+        job_name              : 'benchmark-tests-pytorch-language-modeling-bert-large-cased' + now,
+        project               : 'apache-beam-testing',
+        region                : 'us-central1',
+        staging_location      : 'gs://temp-storage-for-perf-tests/loadtests',
+        temp_location         : 'gs://temp-storage-for-perf-tests/loadtests',
+        requirements_file     : 'apache_beam/ml/inference/torch_tests_requirements.txt',
+        pickle_library       : 'cloudpickle',
+        experiments           : 'no_use_multiple_sdk_containers',
+        publish_to_big_query  : true,
+        metrics_dataset       : 'beam_run_inference',
+        metrics_table         : 'torch_language_modeling_bert_large_uncased',
+        input_options         : '{}', // this option is not required for RunInference tests.
+        influx_measurement    : 'torch_language_modeling_bert_large_uncased',
+        influx_db_name        : InfluxDBCredentialsHelper.InfluxDBDatabaseName,
+        influx_hostname       : InfluxDBCredentialsHelper.InfluxDBHostUrl,
+        input                 : 'gs://apache-beam-ml/testing/inputs/sentences_50k.txt',
+        bert_tokenizer        : 'bert-large-uncased',
+        model_state_dict_path : 'gs://apache-beam-ml/models/huggingface.BertForMaskedLM.bert-large-uncased.pth',
+        output                : 'gs://temp-storage-for-end-to-end-tests/torch/result_bert_large_uncased' + now + '.txt'
+      ]
+    ],
+  ]
+}
+
+def loadTestJob = { scope ->
+  List<Map> testScenarios = loadTestConfigurations()
+  for (Map testConfig: testScenarios){
+    commonJobProperties.setTopLevelMainJobProperties(scope, 'master', 180)
+    loadTestsBuilder.loadTest(scope, testConfig.title, testConfig.runner, CommonTestProperties.SDK.PYTHON, testConfig.pipelineOptions, testConfig.test, null, testConfig.pipelineOptions.requirements_file)
+  }
+}
+
+PhraseTriggeringPostCommitBuilder.postCommitJob(
+    'beam_Inference_Python_Benchmarks_Dataflow',
+    'Run Inference Benchmarks',
+    'Inference benchmarks on Dataflow(\"Run Inference Benchmarks"\"")',
+    this
+    ) {
+      loadTestJob(delegate)
+    }
+
+// TODO(anandinguva): Change the cron job to run once a day
+CronJobBuilder.cronJob(
+    'beam_Inference_Python_Benchmarks_Dataflow', 'H 24 * * *',

Review Comment:
   ```suggestion
       'beam_Inference_Python_Benchmarks_Dataflow', 'H 2 * * *',
   ```
   
   I think this is wrong. Cron syntax is `minute, hour, day of month, month, day of week`. So as written, this tries to run a job at the Hth minute (pseudorandom to avoid collisions) of the 24th hour every day of every week/month. Since the 24th hour doesn't exist, this is invalid syntax. Updating to the second hour should run it when most people are offline which is ideal.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org