Conversation
Gives implementers the option to run path simulations in separate processes; this could be particularly helpful for remote simulator backends.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #372 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 49 49
Lines 4879 4898 +19
Branches 560 562 +2
=========================================
+ Hits 4879 4898 +19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| return self.run_jaqcd(circuit_ir, *args, **kwargs) | ||
|
|
||
| @property | ||
| def parallelize_paths(self) -> bool: |
There was a problem hiding this comment.
Should this be an int to allow for configurable thread count?
| # Aggregate samples across all active paths | ||
| paths = list(context.active_paths) | ||
| if self.parallelize_paths and len(paths) > 1: | ||
| with ThreadPoolExecutor() as pool: |
There was a problem hiding this comment.
What is the performance impact of this verse letting the simulator parallelize each serial simulation?
There was a problem hiding this comment.
I have the same question. In the beginning there is only one path, and the paths are only added during a path simulation. Would it cause a conflict? Is there really a performance gain?
| ) | ||
| sim.evolve(path.instructions) | ||
| all_samples.extend(sim.retrieve_samples()) | ||
| for samples in per_path_samples: |
There was a problem hiding this comment.
Why not use per_path_samples?
Issue #, if available:
Description of changes:
Gives implementers the option to run path simulations in separate processes; this could be particularly helpful for remote simulator backends.
Testing done:
Merge Checklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.General
Tests
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.