Skip to content

Commit 5660cf2

Browse files
committed
Added option for internal parallelization of runs. E.g. NN evaluations on GPUs
1 parent 9827c1e commit 5660cf2

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

ensemble/ensemble.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,12 @@ def calc_prediction(self, enX=None, save_prediction=None):
265265
# Parallelization on HPC using SLURM
266266
elif self.sim.input_dict.get('hpc', False): # Run prediction in parallel on hpc
267267
en_pred = self.run_on_HPC(enX, batch_size=nparallel)
268+
269+
# Parallellization internal to the simulator (e.g. batch processing on GPU )
270+
elif self.sim.input_dict.get('parallel_internal', False):
271+
# make a single matrix for each state
272+
batch_enX = {key: np.array([d[key] for d in enX]) for key in enX[0].keys()} # key: (b, state)
273+
en_pred = self.sim.run_fwd_sim(batch_enX, member_i=None)
268274

269275
# Parallelization on local machine using p_map
270276
else:

0 commit comments

Comments
 (0)