Skip to content

Commit

Permalink
Adding three passes to amdgpu compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryyin committed Jan 24, 2020
1 parent 9d1ec06 commit 9d3d2d3
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 @@ -1259,6 +1259,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 9d3d2d3

Please sign in to comment.