Skip to content

Commit a07c781

Browse files
tlongerijax authors
authored andcommitted
[Mosaic] Fix bug in VectorLayout::generalizes introduced in cl/636250759
PiperOrigin-RevId: 638253907
1 parent cf6f0aa commit a07c781

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

jaxlib/mosaic/dialect/tpu/layout.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,10 +577,12 @@ bool VectorLayout::generalizes(
577577
}
578578
// Since we do not reorder axes, if the shapes resulting from inserting
579579
// implicit dimensions resulting are the same in the 2 minormost dimensions
580-
// for both layouts, then the elements must be laid out the same way (i.e.
581-
// layouts are equivalent).
582-
return getImplicitTiledDims(shape, 1) ==
583-
other.getImplicitTiledDims(shape, 1);
580+
// for both layouts, then the elements must be laid out the same way (before
581+
// tiling).
582+
if (getImplicitTiledDims(shape, 1) !=
583+
other.getImplicitTiledDims(shape, 1)) {
584+
return false;
585+
}
584586
}
585587
if (tiling_ != other.tiling_) {
586588
// Don't fail yet!

0 commit comments

Comments
 (0)