[TPU] Change the TPU DeviceAssignment class to use a flatter (replica, logical core) indexing scheme for cores.
[TPU] Change the TPU DeviceAssignment class to use a flatter (replica, logical core) indexing scheme for cores.

Previously the DeviceAssignment class mixed both a general concept (a mapping from (replica, logical core) to physical TPU core) and a specific instantiation of that concept, by imposing a particular 3D grid structure on the logical core numbers. This was excessive — while the physical core numbers have a particular structure, there is no need to impose any particular structure on the logical core numbers.

This change simplifies the DeviceAssignment scheme, changing it so logical cores within a replica are numbered sequentially without any particular semantics.

PiperOrigin-RevId: 213984629

tensorflow/lingvo,tensorflow/lingvo,tensorflow/lingvo,tensorflow/lingvo