Adding three passes to amdgpu compiler
This commit is contained in:
parent
9d1ec06b01
commit
9d3d2d3b3e
@ -1259,6 +1259,9 @@ cc_library(
|
|||||||
":gpu_conv_padding_legalization",
|
":gpu_conv_padding_legalization",
|
||||||
":gpu_conv_rewriter",
|
":gpu_conv_rewriter",
|
||||||
":gpu_layout_assignment",
|
":gpu_layout_assignment",
|
||||||
|
":reduction_degenerate_dim_remover",
|
||||||
|
":reduction_dimension_grouper",
|
||||||
|
":reduction_layout_normalizer",
|
||||||
":target_constants",
|
":target_constants",
|
||||||
"//tensorflow/compiler/xla:statusor",
|
"//tensorflow/compiler/xla:statusor",
|
||||||
"//tensorflow/compiler/xla/service:algebraic_simplifier",
|
"//tensorflow/compiler/xla/service:algebraic_simplifier",
|
||||||
|
@ -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_conv_rewriter.h"
|
||||||
#include "tensorflow/compiler/xla/service/gpu/gpu_layout_assignment.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/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/gpu/target_constants.h"
|
||||||
#include "tensorflow/compiler/xla/service/hlo_constant_folding.h"
|
#include "tensorflow/compiler/xla/service/hlo_constant_folding.h"
|
||||||
#include "tensorflow/compiler/xla/service/hlo_cse.h"
|
#include "tensorflow/compiler/xla/service/hlo_cse.h"
|
||||||
@ -92,6 +95,10 @@ Status AMDGPUCompiler::OptimizeHloPostLayoutAssignment(
|
|||||||
/*allow_mixed_precision=*/false,
|
/*allow_mixed_precision=*/false,
|
||||||
LayoutAssignment::InstructionCanChangeLayout);
|
LayoutAssignment::InstructionCanChangeLayout);
|
||||||
|
|
||||||
|
pipeline.AddPass<ReductionDegenerateDimRemover>();
|
||||||
|
pipeline.AddPass<ReductionLayoutNormalizer>();
|
||||||
|
pipeline.AddPass<ReductionDimensionGrouper>();
|
||||||
|
|
||||||
// The LayoutAssignment pass may leave behind kCopy instructions which are
|
// The LayoutAssignment pass may leave behind kCopy instructions which are
|
||||||
// duplicate or NOPs, so remove them with algebraic simplification and CSE.
|
// duplicate or NOPs, so remove them with algebraic simplification and CSE.
|
||||||
AlgebraicSimplifierOptions options;
|
AlgebraicSimplifierOptions options;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user