[ReplicaGroupV2] Define compressed replica group list (IotaReplicaGroupList) and migrate collective generation in SPMD to use this format whenever possible.
[ReplicaGroupV2] Define compressed replica group list (IotaReplicaGroupList) and migrate collective generation in SPMD to use this format whenever possible.

In final stage of the SPMD partitioner, the partitioner goes from a sharding to a set of replica groups. It generates replica groups by "merging" devices along certain dimensions of the original sharding. If sharding provided is of HloShardingV2 type, it is possible to generate replica groups in a compressed format via reshapes and transposes of the V2 sharding.

This change also speeds up cloning of collective instruction by migrating CollectiveDeviceList to store pointers to replica groups.
