Skip to content

Commit b060cff

Browse files
authored
Enable parallel execution of scenarios (#543)
I noticed that `simulate_scenarios` doesn't actually saturate all cores on my machine. The `run_combos` function takes a `parallel` parameter that we can set to true to spread the simulation across all cores. https://xyzpy.readthedocs.io/en/latest/gen_parallel.html
2 parents 724b3e1 + f913afc commit b060cff

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
random or deterministic sampling for equidistant cases
1111
- `random_tie_break` and `initialization` attributes to `FPSRecommender` to
1212
control sampling in `farthest_point_sampling`
13+
### Fixed
14+
- `simulate_scenarios` not making use of fully parallel computation
1315

1416
## [0.13.0] - 2025-04-16
1517
### Added

baybe/simulation/scenarios.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def unpack_simulation_results(array: DataArray) -> pd.DataFrame:
152152
category=UnusedObjectWarning,
153153
module="baybe.recommenders.pure.nonpredictive.base",
154154
)
155-
da_results = batch_simulator.run_combos(combos)[result_variable]
155+
da_results = batch_simulator.run_combos(combos, parallel=True)[result_variable]
156156

157157
df_results = unpack_simulation_results(da_results)
158158

0 commit comments

Comments
 (0)