Skip to content

Add max_concurrent_jobs to Engine.get_sampler(). #7442

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

Merged
merged 8 commits into from
Jul 7, 2025

Conversation

dyates
Copy link
Contributor

@dyates dyates commented Jun 27, 2025

Adds max_concurrent_jobs to the utility function Engine.get_sampler to allow setting the same field in the ProcessSampler. This field throttles the number concurrent jobs that are sent to the backend (via run_batch).

@dyates dyates requested review from wcourtney, vtomole, verult and a team as code owners June 27, 2025 20:00
Copy link

google-cla bot commented Jun 27, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot added the size: S 10< lines changed <50 label Jun 27, 2025
Copy link

codecov bot commented Jun 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.68%. Comparing base (b5600e6) to head (15827c3).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7442      +/-   ##
==========================================
- Coverage   98.68%   98.68%   -0.01%     
==========================================
  Files        1092     1092              
  Lines       96626    96635       +9     
==========================================
+ Hits        95356    95361       +5     
- Misses       1270     1274       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pavoljuhas
Copy link
Collaborator

@dyates - please complete the CLA. We are not able to accept contributions without the CLA.

@dyates
Copy link
Contributor Author

dyates commented Jun 30, 2025

@dyates - please complete the CLA. We are not able to accept contributions without the CLA.

Thanks Pavel. I just confirmed, internally, that I am part of the Google CLA.

ProcessorSampler._concurrent_job_limiter is initialized with an integer
max_concurrent_jobs hence we know that _concurrent_job_limiter.capacity
can not be None (unlimited).
@pavoljuhas pavoljuhas enabled auto-merge July 7, 2025 22:34
@pavoljuhas pavoljuhas added this pull request to the merge queue Jul 7, 2025
Merged via the queue into quantumlib:main with commit b3fe874 Jul 7, 2025
64 of 66 checks passed
ddddddanni pushed a commit to ddddddanni/Cirq that referenced this pull request Jul 15, 2025
Adds `max_concurrent_jobs` to the utility function
[Engine.get_sampler](https://github.com/dyates/Cirq/blob/b8ca4844ef80102aa83ace1093552f25c02b101a/cirq-google/cirq_google/engine/engine.py#L580)
to allow setting the [same field in the
`ProcessSampler`]((https://github.com/quantumlib/Cirq/blob/4c7e393eb9fcefcba0c3c509e32cc354197cf014/cirq-google/cirq_google/engine/processor_sampler.py#L37)).
This field throttles the number concurrent jobs that are sent to the
backend (via `run_batch`).

---------

Co-authored-by: Pavol Juhas <juhas@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: S 10< lines changed <50
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants