[XLA:CPU/GPU] Run ZeroSizedHloElimination pass to remove zero-sized HLOs from
the input module. This is to avoid the need of making other passes, such as algebraic simplification to handle zero-size HLOs. PiperOrigin-RevId: 241814646
This commit is contained in:
parent
f40a65e2d4
commit
875b3e6965
@ -252,6 +252,11 @@ Status CpuCompiler::RunHloPassesThroughLayoutAssn(
|
||||
HloPassPipeline pipeline("HLO passes through layout assignment");
|
||||
pipeline.AddInvariantChecker<HloVerifier>(/*layout_sensitive=*/false,
|
||||
/*allow_mixed_precision=*/false);
|
||||
|
||||
// Remove zero-sized HLO from the input so that other passes don't have to
|
||||
// handle it.
|
||||
pipeline.AddPass<ZeroSizedHloElimination>();
|
||||
|
||||
pipeline.AddPass<DynamicIndexSplitter>();
|
||||
pipeline.AddPass<CpuHloSupportChecker>();
|
||||
|
||||
|
@ -183,6 +183,10 @@ Status OptimizeHloModule(HloModule* hlo_module, se::StreamExecutor* stream_exec,
|
||||
HloPassPipeline pipeline("optimization");
|
||||
pipeline.AddInvariantChecker<HloVerifier>(/*layout_sensitive=*/false,
|
||||
/*allow_mixed_precision=*/false);
|
||||
// Remove zero-sized HLO from the input so that other passes don't have to
|
||||
// handle it.
|
||||
pipeline.AddPass<ZeroSizedHloElimination>();
|
||||
|
||||
pipeline.AddPass<DynamicIndexSplitter>();
|
||||
pipeline.AddPass<GpuHloSupportChecker>();
|
||||
ReducePrecisionInsertion::AddPasses(
|
||||
|
Loading…
Reference in New Issue
Block a user