Fix jax_cuda_visible_devices for distributed GPU clusters.
Fix jax_cuda_visible_devices for distributed GPU clusters.

We were incorrectly assuming that the local device ordinals formed a dense set.

Fixes https://github.com/google/jax/issues/11882

PiperOrigin-RevId: 468529654

google/jax,google/jax,google/jax,google/jax