[Pallas:MGPU] Support batch dimension for TMEM references
Currently, we only supports 2D TMEM references. This change adds support for N-D TMEM references by encoding batch dimensions.
Specifically, this change:
* Introduces `CollapseLeadingBatchDimensionsTransform` to map N-D references `(*batch_shape, m, n)` to a 2D representation `(m, math.prod(batch_shape) * n)`.
* Converts batch dimensions indexing to slice over the minor dimension.
PiperOrigin-RevId: 930560840