Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
| return [ | ||
| await self.run_sweep_async(circuit, params=params, repetitions=repetitions) | ||
| for circuit, params, repetitions in zip(programs, params_list, repetitions) | ||
| ] |
There was a problem hiding this comment.
You probably want to use a variant of duet.pmap ("parallel map") to make multiple calls in parallel. In this case, the zip produces tuples of args and we want to call the underlying function like self.run_sweep_async(*args), so we need a "starmap", something like:
return await duet.pstarmap_async(self.run_sweep_async, zip(programs, params_list, repetitions))There was a problem hiding this comment.
For reference, here's the definition of duet.pstarmap_async: https://github.com/google/duet/blob/main/duet/api.py#L171
There was a problem hiding this comment.
Thank you for the code pointer!
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6387 +/- ##
========================================
Coverage 97.80% 97.81%
========================================
Files 1111 1111
Lines 96877 97054 +177
========================================
+ Hits 94754 94931 +177
Misses 2123 2123 ☔ View full report in Codecov by Sentry. |
wcourtney
left a comment
There was a problem hiding this comment.
LGTM % some test nits. Thanks!
call run batch async asynchronously
This change gives a 2x speedup when using
run_batch