gemini-code-assist[bot] commented on PR #37647: URL: https://github.com/apache/beam/pull/37647#issuecomment-3927562010
## Summary of Changes Hello @aIbrahiim, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances Apache Beam's ML capabilities by introducing a robust example pipeline for performing continuous machine learning inference on structured table data. The new pipeline, built around the `RunInference` transform, is designed to handle both batch and streaming inputs, allowing for flexible data processing from sources like files or Pub/Sub, applying scikit-learn models, and outputting results to BigQuery while maintaining data schema. The changes also include comprehensive support infrastructure, such as data generation utilities, unit tests, and integration into the performance benchmarking system, ensuring the example is well-tested, documented, and its performance characteristics are measurable. ### Highlights * **New ML Pipeline for Table Row Inference**: Introduced a new `RunInference` pipeline example (`table_row_inference.py`) designed to process continuous structured table rows, supporting both batch and streaming modes with BigQuery output. * **Batch-Only Inference Example**: Added a simplified batch-only version of the table row inference pipeline (`table_row_inference_batch.py`) for clearer demonstration and use cases. * **Comprehensive Utilities and Testing**: Included utility functions (`table_row_inference_utils.py`) for generating sample models and data, managing Pub/Sub resources, and provided dedicated unit tests (`table_row_inference_test.py`) for the new pipeline components. * **Performance Benchmarking Integration**: Integrated the new table row inference pipelines into the performance benchmarking framework, adding new benchmark definitions and updating existing cost benchmark logic to support streaming throughput metrics. * **Documentation and Metrics Updates**: Updated documentation and Looker metrics configurations to reflect the new table row inference pipelines, including dedicated performance pages for both batch and streaming variants. 🧠**New Feature in Public Preview:** You can now enable **Memory** to help **Gemini Code Assist** learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. **Click [here](https://codeassist.google/code-review/login) to enable Memory in your admin console.** <details> <summary><b>Changelog</b></summary> * **.test-infra/tools/refresh_looker_metrics.py** * Updated Looker metric IDs to include new Table Row Inference Sklearn Batch and Streaming pipelines. * **sdks/python/apache_beam/examples/inference/README.md** * Documented the new `table_row_inference.py` example, detailing prerequisites, model/data setup, and execution instructions for batch and streaming modes. * **sdks/python/apache_beam/examples/inference/table_row_inference.py** * Added a new `RunInference` pipeline for continuous table row processing, supporting batch (file input) and streaming (Pub/Sub) modes with BigQuery output. * **sdks/python/apache_beam/examples/inference/table_row_inference_batch.py** * Added a simplified batch-only inference pipeline for table rows, offering file or BigQuery output. * **sdks/python/apache_beam/examples/inference/table_row_inference_test.py** * Created unit tests for the `table_row_inference.py` pipeline components, including JSON parsing, schema building, model handling, and pipeline integration. * **sdks/python/apache_beam/examples/inference/table_row_inference_utils.py** * Introduced utility functions to create sample scikit-learn models, generate sample JSONL data, and manage Pub/Sub resources for testing and deployment. * **sdks/python/apache_beam/ml/inference/table_row_inference_requirements.txt** * Added a new requirements file specifying dependencies for table row inference, including `scikit-learn`, `numpy`, `google-cloud-monitoring`, `protobuf`, and `requests`. * **sdks/python/apache_beam/testing/benchmarks/inference/README.md** * Updated the README to include documentation for the new Table Row Inference (Sklearn) benchmark, detailing GCS artifacts and pipeline options. * **sdks/python/apache_beam/testing/benchmarks/inference/table_row_inference_benchmark.py** * Implemented a new benchmark test for the table row inference pipeline, extending `DataflowCostBenchmark` to measure performance metrics for both batch and streaming modes. * sdks/python/apache_beam/testing/load_tests/dataflow_cost_benchmark.py * **sdks/python/apache_beam/testing/load_tests/dataflow_cost_benchmark.py** * Modified `DataflowCostBenchmark` to improve worker time interval extraction, add streaming throughput metrics from Pub/Sub, and refine PCollection throughput metric filtering. * **sdks/python/apache_beam/testing/load_tests/load_test.py** * Updated `LoadTest` to allow `TestPipeline` initialization with specific options classes, improving flexibility for benchmark configurations. * **sdks/python/apache_beam/testing/test_pipeline.py** * Added a `get_options_list` class method to `TestPipeline` for parsing command-line arguments related to test pipeline options. * **website/www/site/content/en/performance/_index.md** * Updated the performance index page to include links to the new Table Row Inference Sklearn Streaming and Batch performance pages. * **website/www/site/content/en/performance/tablerowinference/_index.md** * Added a new performance documentation page for 'Table Row Inference Sklearn Batch', detailing the model, accelerator, host, and linking to cost, version, and date metrics. * **website/www/site/content/en/performance/tablerowinferencestreaming/_index.md** * Added a new performance documentation page for 'Table Row Inference Sklearn Streaming', detailing the model, accelerator, host, and linking to cost, version, and date metrics. * **website/www/site/data/performance.yaml** * Configured new Looker dashboard IDs for 'tablerowinference' and 'tablerowinferencestreaming' performance metrics, including cost, date, and version tracking. </details> <details> <summary><b>Ignored Files</b></summary> * **Ignored by pattern:** `.github/workflows/**` (3) * .github/workflows/beam_Inference_Python_Benchmarks_Dataflow.yml * .github/workflows/load-tests-pipeline-options/beam_Inference_Python_Benchmarks_Dataflow_Table_Row_Inference_Batch.txt * .github/workflows/load-tests-pipeline-options/beam_Inference_Python_Benchmarks_Dataflow_Table_Row_Inference_Stream.txt </details> <details> <summary><b>Activity</b></summary> * The pull request introduces new ML pipeline examples, utilities, tests, and performance benchmarks. No specific human activity (comments, reviews, etc.) was provided in the context. </details> <details> <summary><b>Using Gemini Code Assist</b></summary> <br> The full guide for Gemini Code Assist can be found on our [documentation page](https://developers.google.com/gemini-code-assist/docs/review-github-code), here are some quick tips. <b>Invoking Gemini</b> You can request assistance from Gemini at any point by creating a comment using either `/gemini <command>` or `@gemini-code-assist <command>`. Below is a summary of the supported commands on the current page. Feature | Command | Description --- | --- | --- Code Review | `/gemini review` | Performs a code review for the current pull request in its current state. Pull Request Summary | `/gemini summary` | Provides a summary of the current pull request in its current state. Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments. Help | `/gemini help` | Displays a list of available commands. <b>Customization</b> To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a `.gemini/` folder in the base of the repository. Detailed instructions can be found [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github). <b>Limitations & Feedback</b> Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up [here](https://google.qualtrics.com/jfe/form/SV_2cyuGuTWsEw84yG). <b>You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the [Gemini Code Assist IDE Extension](https://cloud.google.com/products/gemini/code-assist).</b> </details> [^1]: Review the [Privacy Notices](https://policies.google.com/privacy), [Generative AI Prohibited Use Policy](https://policies.google.com/terms/generative-ai/use-policy), [Terms of Service](https://policies.google.com/terms), and learn how to configure Gemini Code Assist in GitHub [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github). Gemini can make mistakes, so double check it and [use code with caution](https://support.google.com/legal/answer/13505487). -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
