Skip to content

upload to spanner and add min input and output len #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kaushikmitr
Copy link
Collaborator

@kaushikmitr kaushikmitr commented Jun 20, 2025

This pull request introduces significant enhancements to the benchmark_serving.py script and related files, focusing on data validation, Spanner integration, and improved configurability for benchmarking datasets. Key changes include adding support for uploading benchmark results to Google Cloud Spanner, introducing minimum input/output length filters, and enabling additional arguments for dataset filtering and Spanner configuration.

Enhancements to Benchmarking and Data Validation:

  • Added safe_json_value function to handle NaN and Infinity values for JSON serialization, ensuring compatibility with Spanner and other systems. (benchmark_serving.py, benchmark_serving.pyR45-R239)
  • Introduced min_input_len and min_output_len parameters in get_filtered_dataset to filter datasets based on minimum sequence lengths. (benchmark_serving.py, [1] [2]

Integration with Google Cloud Spanner:

  • Implemented upload_to_spanner_batch_with_retry function to upload benchmark results to Spanner with retry logic for batch uploads. (benchmark_serving.py, benchmark_serving.pyR45-R239)
  • Added Spanner-related arguments (--spanner-instance-id, --spanner-database-id) to the CLI parser for configuring Spanner uploads. (benchmark_serving.py, benchmark_serving.pyR1345-R1356)
  • Modified save_json_results to optionally upload results to Spanner, controlled by the spanner_upload flag. (benchmark_serving.py, benchmark_serving.pyR837-R847)

Updates to Benchmark Workflow:

  • Enhanced async def benchmark to pass minimum input/output lengths and enable Spanner uploads. (benchmark_serving.py, [1] [2]
  • Updated print_and_save_result to support Spanner uploads and optional server metrics scraping. (benchmark_serving.py, [1] [2]

Shell Script Modifications:

  • Added support for --min-input-length, --min-output-length, --spanner-instance-id, and --spanner-database-id in latency_throughput_curve.sh. (latency_throughput_curve.sh, [1] [2]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant