@@ -903,14 +903,38 @@ function optimization_passes(
903
903
" self_add_to_convolution_like($(Int (backend == " tpu" )) )" ,
904
904
" self_mul_to_convolution_like($(Int (backend == " tpu" )) )" ,
905
905
" subtract_multiply_const_to_add_mul_const" ,
906
- " concat_insert_dim_dot_general" ,
907
- " concat_insert_dim_gather" ,
908
- " concat_insert_dim_iota" ,
909
- " concat_insert_dim_reduce" ,
910
- " concat_insert_dim_sort" ,
911
- " concat_insert_dim_reduce_window" ,
906
+ " trivial_reduce_window_to_reduce_op" ,
907
+ " dot_general_add_distributive_simplify" ,
908
+ " dot_general_subtract_distributive_simplify" ,
912
909
]
913
910
911
+ if ! compile_options. disable_auto_batching_passes
912
+ append! (
913
+ transform_passes_list,
914
+ [
915
+ " add_reduce_slice_fusion" ,
916
+ " mul_reduce_slice_fusion" ,
917
+ " min_reduce_slice_fusion" ,
918
+ " max_reduce_slice_fusion" ,
919
+ " concat_insert_dim_dot_general" ,
920
+ " concat_insert_dim_gather" ,
921
+ " concat_insert_dim_iota" ,
922
+ " concat_insert_dim_reduce" ,
923
+ " concat_insert_dim_sort" ,
924
+ " concat_insert_dim_reduce_window" ,
925
+ " dot_general_slice_to_batch" ,
926
+ " gather_slice_to_batch" ,
927
+ " iota_slice_to_batch" ,
928
+ " reduce_slice_to_batch" ,
929
+ " sort_slice_to_batch" ,
930
+ " transpose_slice_to_batch" ,
931
+ " broadcastindim_slice_to_batch" ,
932
+ " reducewindow_slice_to_batch" ,
933
+ " elementwise_slice_to_batch" ,
934
+ ],
935
+ )
936
+ end
937
+
914
938
if ! compile_options. disable_licm_optimization_passes
915
939
append! (
916
940
transform_passes_list,
@@ -1047,11 +1071,6 @@ function optimization_passes(
1047
1071
" const_prop_through_barrier<16>" ,
1048
1072
" concat_const_prop<1>($max_constant_threshold )" ,
1049
1073
" dynamic_update_slice_const_prop($max_constant_threshold )" ,
1050
- " add_reduce_slice_fusion" ,
1051
- " mul_reduce_slice_fusion" ,
1052
- " min_reduce_slice_fusion" ,
1053
- " max_reduce_slice_fusion" ,
1054
- " trivial_reduce_window_to_reduce_op" ,
1055
1074
],
1056
1075
)
1057
1076
0 commit comments