unisim.backend.mujoco.chunk_tuner.make_candidates

unisim.backend.mujoco.chunk_tuner.make_candidates(num_envs, nthread)[source]

Candidate chunk_sizes within [1, upper], densified at the sweet spot.

upper = ceil(num_envs / nthread) is a hard ceiling: a chunk_size beyond it produces fewer chunks than threads, leaving threads idle -> always slower. The optimum sits near heur = num_envs / (10 * nthread) (~10 chunks per thread), so the band around it is sampled densely while the always-bad large chunks are never generated.

Parameters:
  • num_envs (int)

  • nthread (int)

Return type:

list[int]