build_mesh

jaxrens.sampling.mesh.build_mesh(axis_name, n_devices)[source]

Return a 1-D jax.sharding.Mesh named axis_name over the first n_devices local devices.

Single place that replaces the Mesh(jax.local_devices()[:n], (name,)) construction previously repeated in nested_sampling.py and batch_descriptor.py.

Parameters:
  • axis_name (str)

  • n_devices (int)

Return type:

Mesh