Skip to content

Commit

Permalink
Merge pull request #36191 from ROCmSoftwarePlatform:google-upstream-p…
Browse files Browse the repository at this point in the history
…r-enable-passes-amdgpu_compiler

PiperOrigin-RevId: 294239845
Change-Id: I905c62570b73021a8275dd2925d5badb0af1ceee
  • Loading branch information
tensorflower-gardener committed Feb 10, 2020
2 parents 95e4ade + 9d3d2d3 commit cf35e65
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tensorflow/compiler/xla/service/gpu/BUILD
Expand Up @@ -1278,6 +1278,9 @@ cc_library(
":gpu_conv_padding_legalization",
":gpu_conv_rewriter",
":gpu_layout_assignment",
":reduction_degenerate_dim_remover",
":reduction_dimension_grouper",
":reduction_layout_normalizer",
":target_constants",
"//tensorflow/compiler/xla:statusor",
"//tensorflow/compiler/xla/service:algebraic_simplifier",
Expand Down
7 changes: 7 additions & 0 deletions tensorflow/compiler/xla/service/gpu/amdgpu_compiler.cc
Expand Up @@ -22,6 +22,9 @@ limitations under the License.
#include "tensorflow/compiler/xla/service/gpu/gpu_conv_rewriter.h"
#include "tensorflow/compiler/xla/service/gpu/gpu_layout_assignment.h"
#include "tensorflow/compiler/xla/service/gpu/llvm_gpu_backend/gpu_backend_lib.h"
#include "tensorflow/compiler/xla/service/gpu/reduction_degenerate_dim_remover.h"
#include "tensorflow/compiler/xla/service/gpu/reduction_dimension_grouper.h"
#include "tensorflow/compiler/xla/service/gpu/reduction_layout_normalizer.h"
#include "tensorflow/compiler/xla/service/gpu/target_constants.h"
#include "tensorflow/compiler/xla/service/hlo_constant_folding.h"
#include "tensorflow/compiler/xla/service/hlo_cse.h"
Expand Down Expand Up @@ -92,6 +95,10 @@ Status AMDGPUCompiler::OptimizeHloPostLayoutAssignment(
/*allow_mixed_precision=*/false,
LayoutAssignment::InstructionCanChangeLayout);

pipeline.AddPass<ReductionDegenerateDimRemover>();
pipeline.AddPass<ReductionLayoutNormalizer>();
pipeline.AddPass<ReductionDimensionGrouper>();

// The LayoutAssignment pass may leave behind kCopy instructions which are
// duplicate or NOPs, so remove them with algebraic simplification and CSE.
AlgebraicSimplifierOptions options;
Expand Down

0 comments on commit cf35e65

Please sign in to comment.