Skip to content

Commit

Permalink
[XLA:GPU] NFC: Avoid redundant BitcastMap.
Browse files Browse the repository at this point in the history
There is no need to first bitcast to the hero shape and then to the root shape.
We can directly bitcast to the root shape.

PiperOrigin-RevId: 664678219
  • Loading branch information
akuegel authored and tensorflower-gardener committed Aug 19, 2024
1 parent 1fd3fa4 commit a6b5bdb
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions third_party/xla/xla/service/gpu/fusions/transpose_mlir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,8 @@ std::optional<IndexingMap> MlirTransposeFusion::ComputeThreadIdToOutputIndexing(
analysis_.fusion_root(root_index).instruction(), hero)) {
// The shape of non-transpose roots are bitcast compatible with the input
// shape of transpose heroes.
auto map = ComposeIndexingMaps(
GetIndexing(/*input=*/true, hero.shape(), mlir_context),
GetBitcastMap(hero.shape(), analysis_.fusion_root(root_index).shape(),
mlir_context));
map.Simplify();
return map;
return GetIndexing(/*input=*/true,
analysis_.fusion_root(root_index).shape(), mlir_context);
}
return GetIndexing(/*input=*/false, hero.shape(), mlir_context);
}
Expand Down

0 comments on commit a6b5bdb

Please sign in to comment.