diff --git a/BUILD.bazel b/BUILD.bazel index a48f4b05aabb1..d3084d9ebd447 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -503,353 +503,6 @@ filegroup( ], ) -filegroup( - name = "caffe2_ideep_srcs", - srcs = [ - "caffe2/ideep/operators/adam_op.cc", - "caffe2/ideep/operators/channel_shuffle_op.cc", - "caffe2/ideep/operators/concat_split_op.cc", - "caffe2/ideep/operators/conv_op.cc", - "caffe2/ideep/operators/conv_transpose_op.cc", - "caffe2/ideep/operators/dropout_op.cc", - "caffe2/ideep/operators/elementwise_sum_op.cc", - "caffe2/ideep/operators/expand_squeeze_dims_op.cc", - "caffe2/ideep/operators/fully_connected_op.cc", - "caffe2/ideep/operators/local_response_normalization_op.cc", - "caffe2/ideep/operators/momentum_sgd_op.cc", - "caffe2/ideep/operators/operator_fallback_ideep.cc", - "caffe2/ideep/operators/order_switch_ops.cc", - "caffe2/ideep/operators/pool_op.cc", - "caffe2/ideep/operators/quantization/int8_add_op.cc", - "caffe2/ideep/operators/quantization/int8_conv_op.cc", - "caffe2/ideep/operators/quantization/int8_dequantize_op.cc", - "caffe2/ideep/operators/quantization/int8_fully_connected_op.cc", - "caffe2/ideep/operators/quantization/int8_given_tensor_fill_op.cc", - "caffe2/ideep/operators/quantization/int8_pool_op.cc", - "caffe2/ideep/operators/quantization/int8_quantize_op.cc", - "caffe2/ideep/operators/quantization/int8_relu_op.cc", - "caffe2/ideep/operators/queue_ops.cc", - "caffe2/ideep/operators/relu_op.cc", - "caffe2/ideep/operators/reshape_op.cc", - "caffe2/ideep/operators/shape_op.cc", - "caffe2/ideep/operators/sigmoid_op.cc", - "caffe2/ideep/operators/spatial_batch_norm_op.cc", - "caffe2/ideep/operators/transpose_op.cc", - "caffe2/ideep/operators/utility_ops.cc", - "caffe2/ideep/utils/ideep_register.cc", - ], -) - -filegroup( - name = "caffe2_onnx_srcs", - srcs = [ - "caffe2/onnx/backend.cc", - "caffe2/onnx/backend_rep.cc", - "caffe2/onnx/device.cc", - "caffe2/onnx/helper.cc", - "caffe2/onnx/offline_tensor.cc", - "caffe2/onnx/onnx_exporter.cc", - "caffe2/onnx/onnxifi_graph_info.cc", - "caffe2/onnx/onnxifi_init.cc", - ], -) - -filegroup( - name = "caffe2_operators_srcs", - srcs = [ - "caffe2/operators/abs_op.cc", - "caffe2/operators/accumulate_op.cc", - "caffe2/operators/accuracy_op.cc", - "caffe2/operators/acos_op.cc", - "caffe2/operators/affine_channel_op.cc", - "caffe2/operators/alias_with_name.cc", - "caffe2/operators/apmeter_op.cc", - "caffe2/operators/arg_ops.cc", - "caffe2/operators/asin_op.cc", - "caffe2/operators/assert_op.cc", - "caffe2/operators/atan_op.cc", - "caffe2/operators/atomic_ops.cc", - "caffe2/operators/batch_box_cox_op.cc", - "caffe2/operators/batch_bucketize_op.cc", - "caffe2/operators/batch_gather_ops.cc", - "caffe2/operators/batch_matmul_op.cc", - "caffe2/operators/batch_moments_op.cc", - "caffe2/operators/batch_permutation_op.cc", - "caffe2/operators/batch_sparse_to_dense_op.cc", - "caffe2/operators/bbox_transform_op.cc", - "caffe2/operators/bisect_percentile_op.cc", - "caffe2/operators/boolean_mask_ops.cc", - "caffe2/operators/boolean_unmask_ops.cc", - "caffe2/operators/box_with_nms_limit_op.cc", - "caffe2/operators/bucketize_op.cc", - "caffe2/operators/byte_weight_dequant_op.cc", - "caffe2/operators/cast_op.cc", - "caffe2/operators/cbrt_op.cc", - "caffe2/operators/cc_bmm_bg_op.cc", - "caffe2/operators/ceil_op.cc", - "caffe2/operators/channel_backprop_stats_op.cc", - "caffe2/operators/channel_shuffle_op.cc", - "caffe2/operators/channel_stats_op.cc", - "caffe2/operators/clip_op.cc", - "caffe2/operators/collect_and_distribute_fpn_rpn_proposals_op.cc", - "caffe2/operators/communicator_op.cc", - "caffe2/operators/concat_split_op.cc", - "caffe2/operators/conditional_op.cc", - "caffe2/operators/conv_gradient_op.cc", - "caffe2/operators/conv_op.cc", - "caffe2/operators/conv_op_eigen.cc", - "caffe2/operators/conv_op_shared.cc", - "caffe2/operators/conv_transpose_gradient_op.cc", - "caffe2/operators/conv_transpose_op.cc", - "caffe2/operators/conv_transpose_op_mobile.cc", - "caffe2/operators/copy_op.cc", - "caffe2/operators/copy_rows_to_tensor_op.cc", - "caffe2/operators/cos_op.cc", - "caffe2/operators/cosh_op.cc", - "caffe2/operators/cosine_embedding_criterion_op.cc", - "caffe2/operators/counter_ops.cc", - "caffe2/operators/crash_op.cc", - "caffe2/operators/create_scope_op.cc", - "caffe2/operators/crf_viterbi_op.cc", - "caffe2/operators/cross_entropy_op.cc", - "caffe2/operators/ctc_beam_search_decoder_op.cc", - "caffe2/operators/ctc_greedy_decoder_op.cc", - "caffe2/operators/cube_op.cc", - "caffe2/operators/data_couple.cc", - "caffe2/operators/dataset_ops.cc", - "caffe2/operators/deform_conv_gradient_op.cc", - "caffe2/operators/deform_conv_op.cc", - "caffe2/operators/dense_vector_to_id_list_op.cc", - "caffe2/operators/distance_op.cc", - "caffe2/operators/do_op.cc", - "caffe2/operators/dropout_op.cc", - "caffe2/operators/elementwise_add_gradient_op.cc", - "caffe2/operators/elementwise_add_op.cc", - "caffe2/operators/elementwise_div_gradient_op.cc", - "caffe2/operators/elementwise_div_op.cc", - "caffe2/operators/elementwise_linear_op.cc", - "caffe2/operators/elementwise_logical_ops.cc", - "caffe2/operators/elementwise_mul_gradient_op.cc", - "caffe2/operators/elementwise_mul_op.cc", - "caffe2/operators/elementwise_ops.cc", - "caffe2/operators/elementwise_ops_schema.cc", - "caffe2/operators/elementwise_ops_utils.cc", - "caffe2/operators/elementwise_sub_gradient_op.cc", - "caffe2/operators/elementwise_sub_op.cc", - "caffe2/operators/elementwise_sum_op.cc", - "caffe2/operators/elu_op.cc", - "caffe2/operators/enforce_finite_op.cc", - "caffe2/operators/ensure_clipped_op.cc", - "caffe2/operators/ensure_cpu_output_op.cc", - "caffe2/operators/erf_op.cc", - "caffe2/operators/exp_op.cc", - "caffe2/operators/expand_op.cc", - "caffe2/operators/expand_squeeze_dims_op.cc", - "caffe2/operators/fc_inference.cc", - "caffe2/operators/feature_maps_ops.cc", - "caffe2/operators/feed_blob_op.cc", - "caffe2/operators/filler_op.cc", - "caffe2/operators/find_duplicate_elements_op.cc", - "caffe2/operators/find_op.cc", - "caffe2/operators/flatten_op.cc", - "caffe2/operators/flexible_top_k.cc", - "caffe2/operators/floor_op.cc", - "caffe2/operators/free_op.cc", - "caffe2/operators/fully_connected_op.cc", - "caffe2/operators/fused_rowwise_8bit_conversion_ops.cc", - "caffe2/operators/fused_rowwise_random_quantization_ops.cc", - "caffe2/operators/gather_fused_8bit_rowwise_op.cc", - "caffe2/operators/gather_op.cc", - "caffe2/operators/gather_ranges_to_dense_op.cc", - "caffe2/operators/gelu_op.cc", - "caffe2/operators/generate_proposals_op.cc", - "caffe2/operators/given_tensor_byte_string_to_uint8_fill_op.cc", - "caffe2/operators/given_tensor_fill_op.cc", - "caffe2/operators/glu_op.cc", - "caffe2/operators/group_norm_op.cc", - "caffe2/operators/gru_unit_op.cc", - "caffe2/operators/h_softmax_op.cc", - "caffe2/operators/half_float_ops.cc", - "caffe2/operators/hard_sigmoid_op.cc", - "caffe2/operators/heatmap_max_keypoint_op.cc", - "caffe2/operators/if_op.cc", - "caffe2/operators/im2col_op.cc", - "caffe2/operators/index_hash_ops.cc", - "caffe2/operators/index_ops.cc", - "caffe2/operators/inference_lstm_op.cc", - "caffe2/operators/instance_norm_gradient_op.cc", - "caffe2/operators/instance_norm_op.cc", - "caffe2/operators/integral_image_op.cc", - "caffe2/operators/is_empty_op.cc", - "caffe2/operators/jsd_op.cc", - "caffe2/operators/key_split_ops.cc", - "caffe2/operators/last_n_window_collector.cc", - "caffe2/operators/layer_norm_op.cc", - "caffe2/operators/leaky_relu_op.cc", - "caffe2/operators/length_split_op.cc", - "caffe2/operators/lengths_pad_op.cc", - "caffe2/operators/lengths_reducer_fused_8bit_rowwise_ops.cc", - "caffe2/operators/lengths_reducer_ops.cc", - "caffe2/operators/lengths_reducer_rowwise_8bit_ops.cc", - "caffe2/operators/lengths_tile_op.cc", - "caffe2/operators/lengths_top_k_op.cc", - "caffe2/operators/listwise_l2r_op.cc", - "caffe2/operators/load_save_op.cc", - "caffe2/operators/load_save_op_util.cc", - "caffe2/operators/local_response_normalization_op.cc", - "caffe2/operators/locally_connected_op.cc", - "caffe2/operators/locally_connected_op_util.cc", - "caffe2/operators/log_op.cc", - "caffe2/operators/logit_op.cc", - "caffe2/operators/loss_op.cc", - "caffe2/operators/lp_pool_op.cc", - "caffe2/operators/lpnorm_op.cc", - "caffe2/operators/lstm_unit_op.cc", - "caffe2/operators/map_ops.cc", - "caffe2/operators/margin_ranking_criterion_op.cc", - "caffe2/operators/matmul_op.cc", - "caffe2/operators/mean_op.cc", - "caffe2/operators/merge_id_lists_op.cc", - "caffe2/operators/minmax_gradient_ops.cc", - "caffe2/operators/minmax_ops.cc", - "caffe2/operators/mod_op.cc", - "caffe2/operators/moments_op.cc", - "caffe2/operators/multi_class_accuracy_op.cc", - "caffe2/operators/negate_gradient_op.cc", - "caffe2/operators/negative_op.cc", - "caffe2/operators/ngram_ops.cc", - "caffe2/operators/norm_planar_yuv_op.cc", - "caffe2/operators/normalize_l1_op.cc", - "caffe2/operators/normalize_op.cc", - "caffe2/operators/numpy_tile_op.cc", - "caffe2/operators/one_hot_ops.cc", - "caffe2/operators/onnx_while_op.cc", - "caffe2/operators/order_switch_ops.cc", - "caffe2/operators/pack_rnn_sequence_op.cc", - "caffe2/operators/pack_segments.cc", - "caffe2/operators/pad_op.cc", - "caffe2/operators/partition_ops.cc", - "caffe2/operators/percentile_op.cc", - "caffe2/operators/perplexity_op.cc", - "caffe2/operators/piecewise_linear_transform_op.cc", - "caffe2/operators/pool_gradient_op.cc", - "caffe2/operators/pool_op.cc", - "caffe2/operators/pool_op_util.cc", - "caffe2/operators/pow_op.cc", - "caffe2/operators/prelu_op.cc", - "caffe2/operators/prepend_dim_op.cc", - "caffe2/operators/quant_decode_op.cc", - "caffe2/operators/rank_loss_op.cc", - "caffe2/operators/reciprocal_gradient_op.cc", - "caffe2/operators/reciprocal_op.cc", - "caffe2/operators/reduce_front_back_max_ops.cc", - "caffe2/operators/reduce_front_back_mean_ops.cc", - "caffe2/operators/reduce_front_back_sum_ops.cc", - "caffe2/operators/reduce_ops.cc", - "caffe2/operators/reduction_ops.cc", - "caffe2/operators/relu_n_op.cc", - "caffe2/operators/relu_op.cc", - "caffe2/operators/remove_data_blocks_op.cc", - "caffe2/operators/replace_nan_op.cc", - "caffe2/operators/reservoir_sampling.cc", - "caffe2/operators/reshape_op.cc", - "caffe2/operators/resize_3d_op.cc", - "caffe2/operators/resize_op.cc", - "caffe2/operators/reverse_packed_segs_op.cc", - "caffe2/operators/rmac_regions_op.cc", - "caffe2/operators/rnn/recurrent_network_blob_fetcher_op.cc", - "caffe2/operators/rnn/recurrent_network_executor.cc", - "caffe2/operators/rnn/recurrent_network_op.cc", - "caffe2/operators/roi_align_gradient_op.cc", - "caffe2/operators/roi_align_op.cc", - "caffe2/operators/roi_align_rotated_gradient_op.cc", - "caffe2/operators/roi_align_rotated_op.cc", - "caffe2/operators/roi_pool_op.cc", - "caffe2/operators/rowmul_op.cc", - "caffe2/operators/rsqrt_op.cc", - "caffe2/operators/scale_blobs_op.cc", - "caffe2/operators/scale_op.cc", - "caffe2/operators/segment_reduction_op.cc", - "caffe2/operators/selu_op.cc", - "caffe2/operators/sequence_ops.cc", - "caffe2/operators/shape_op.cc", - "caffe2/operators/sigmoid_gradient_op.cc", - "caffe2/operators/sigmoid_op.cc", - "caffe2/operators/sin_op.cc", - "caffe2/operators/sinh_op.cc", - "caffe2/operators/sinusoid_position_encoding_op.cc", - "caffe2/operators/slice_op.cc", - "caffe2/operators/softmax_op.cc", - "caffe2/operators/softmax_utils.cc", - "caffe2/operators/softmax_with_loss_op.cc", - "caffe2/operators/softplus_op.cc", - "caffe2/operators/softsign_op.cc", - "caffe2/operators/space_batch_op.cc", - "caffe2/operators/sparse_dropout_with_replacement_op.cc", - "caffe2/operators/sparse_normalize_op.cc", - "caffe2/operators/sparse_to_dense_mask_op.cc", - "caffe2/operators/sparse_to_dense_op.cc", - "caffe2/operators/spatial_batch_norm_gradient_op.cc", - "caffe2/operators/spatial_batch_norm_op.cc", - "caffe2/operators/spatial_softmax_with_loss_op.cc", - "caffe2/operators/sqr_op.cc", - "caffe2/operators/sqrt_op.cc", - "caffe2/operators/square_root_divide_op.cc", - "caffe2/operators/stats_ops.cc", - "caffe2/operators/stats_put_ops.cc", - "caffe2/operators/stop_gradient.cc", - "caffe2/operators/string_ops.cc", - "caffe2/operators/stump_func_op.cc", - "caffe2/operators/stylizer_ops.cc", - "caffe2/operators/summarize_op.cc", - "caffe2/operators/swish_op.cc", - "caffe2/operators/tan_op.cc", - "caffe2/operators/tanh_gradient_op.cc", - "caffe2/operators/tanh_op.cc", - "caffe2/operators/tensor_protos_db_input.cc", - "caffe2/operators/text_file_reader.cc", - "caffe2/operators/text_file_reader_utils.cc", - "caffe2/operators/thresholded_relu_op.cc", - "caffe2/operators/tile_op.cc", - "caffe2/operators/top_k.cc", - "caffe2/operators/transpose_op.cc", - "caffe2/operators/tt_linear_op.cc", - "caffe2/operators/unique_ops.cc", - "caffe2/operators/upsample_op.cc", - "caffe2/operators/utility_ops.cc", - "caffe2/operators/variable_length_sequence_padding.cc", - "caffe2/operators/weighted_multi_sampling_op.cc", - "caffe2/operators/weighted_sample_op.cc", - "caffe2/operators/while_op.cc", - "caffe2/operators/workspace_ops.cc", - "caffe2/operators/zero_gradient_op.cc", - ], -) - -filegroup( - name = "caffe2_opt_srcs", - srcs = [ - "caffe2/opt/annotations.cc", - "caffe2/opt/backend_cutting.cc", - "caffe2/opt/backend_transformer_base.cc", - "caffe2/opt/bound_shape_inferencer.cc", - "caffe2/opt/converter.cc", - "caffe2/opt/dead_code_elim.cc", - "caffe2/opt/device.cc", - "caffe2/opt/distributed.cc", - "caffe2/opt/distributed_converter.cc", - "caffe2/opt/fusion.cc", - "caffe2/opt/mobile.cc", - "caffe2/opt/onnxifi_op.cc", - "caffe2/opt/onnxifi_transformer.cc", - "caffe2/opt/optimize_ideep.cc", - "caffe2/opt/optimizer.cc", - "caffe2/opt/passes.cc", - "caffe2/opt/shape_info.cc", - "caffe2/opt/tvm_transformer.cc", - ], -) - filegroup( name = "caffe2_perfkernels_srcs", srcs = [ @@ -865,70 +518,6 @@ filegroup( ], ) -filegroup( - name = "caffe2_predictor_srcs", - srcs = [ - "caffe2/predictor/emulator/data_filler.cc", - "caffe2/predictor/emulator/data_filler.h", - "caffe2/predictor/predictor.cc", - "caffe2/predictor/predictor_config.cc", - "caffe2/predictor/predictor_utils.cc", - ], -) - -filegroup( - name = "caffe2_quantization_srcs", - srcs = [ - "caffe2/quantization/server/activation_distribution_observer.cc", - "caffe2/quantization/server/batch_matmul_dnnlowp_op.cc", - "caffe2/quantization/server/caffe2_dnnlowp_utils.cc", - "caffe2/quantization/server/channel_shuffle_dnnlowp_op.cc", - "caffe2/quantization/server/concat_dnnlowp_op.cc", - "caffe2/quantization/server/conv_dnnlowp_acc16_op.cc", - "caffe2/quantization/server/conv_dnnlowp_op.cc", - "caffe2/quantization/server/conv_relu_op.cc", - "caffe2/quantization/server/dequantize_dnnlowp_op.cc", - "caffe2/quantization/server/dnnlowp.cc", - "caffe2/quantization/server/dnnlowp_partition.cc", - "caffe2/quantization/server/dynamic_histogram.cc", - "caffe2/quantization/server/elementwise_add_dnnlowp_op.cc", - "caffe2/quantization/server/elementwise_linear_dnnlowp_op.cc", - "caffe2/quantization/server/elementwise_mul_dnnlowp_op.cc", - "caffe2/quantization/server/elementwise_sum_dnnlowp_op.cc", - "caffe2/quantization/server/elementwise_sum_relu_op.cc", - "caffe2/quantization/server/fbgemm_pack_matrix_cache.cc", - "caffe2/quantization/server/fbgemm_pack_op.cc", - "caffe2/quantization/server/fully_connected_dnnlowp_acc16_op.cc", - "caffe2/quantization/server/fully_connected_dnnlowp_op.cc", - "caffe2/quantization/server/fully_connected_fake_lowp_op.cc", - "caffe2/quantization/server/group_norm_dnnlowp_op.cc", - "caffe2/quantization/server/int8_gen_quant_params.cc", - "caffe2/quantization/server/kl_minimization.cc", - "caffe2/quantization/server/lstm_unit_dnnlowp_op.cc", - "caffe2/quantization/server/norm_minimization.cc", - "caffe2/quantization/server/p99.cc", - "caffe2/quantization/server/pool_dnnlowp_op.cc", - "caffe2/quantization/server/quantize_dnnlowp_op.cc", - "caffe2/quantization/server/relu_dnnlowp_op.cc", - "caffe2/quantization/server/sigmoid.cc", - "caffe2/quantization/server/sigmoid_dnnlowp_op.cc", - "caffe2/quantization/server/spatial_batch_norm_dnnlowp_op.cc", - "caffe2/quantization/server/tanh.cc", - "caffe2/quantization/server/tanh_dnnlowp_op.cc", - "caffe2/quantization/server/utility_dnnlowp_ops.cc", - ], -) - -filegroup( - name = "caffe2_queue_srcs", - srcs = [ - "caffe2/queue/blobs_queue.cc", - "caffe2/queue/blobs_queue_db.cc", - "caffe2/queue/queue_ops.cc", - "caffe2/queue/rebatching_queue.cc", - "caffe2/queue/rebatching_queue_ops.cc", - ], -) filegroup( name = "caffe2_serialize_srcs", @@ -940,36 +529,6 @@ filegroup( ], ) -filegroup( - name = "caffe2_sgd_srcs", - srcs = [ - "caffe2/sgd/adadelta_op.cc", - "caffe2/sgd/adagrad_op.cc", - "caffe2/sgd/adam_op.cc", - "caffe2/sgd/clip_tensor_op.cc", - "caffe2/sgd/ftrl_op.cc", - "caffe2/sgd/gftrl_op.cc", - "caffe2/sgd/iter_op.cc", - "caffe2/sgd/lars_op.cc", - "caffe2/sgd/learning_rate_adaption_op.cc", - "caffe2/sgd/learning_rate_op.cc", - "caffe2/sgd/momentum_sgd_op.cc", - "caffe2/sgd/rmsprop_op.cc", - "caffe2/sgd/wngrad_op.cc", - "caffe2/sgd/yellowfin_op.cc", - ], -) - -filegroup( - name = "caffe2_transforms_srcs", - srcs = [ - "caffe2/transforms/common_subexpression_elimination.cc", - "caffe2/transforms/conv_to_nnpack_transform.cc", - "caffe2/transforms/pattern_net_transform.cc", - "caffe2/transforms/single_op_transform.cc", - ], -) - filegroup( name = "caffe2_utils_srcs", srcs = [ @@ -994,222 +553,6 @@ filegroup( ], ) -filegroup( - name = "caffe2_cuda_cpp_srcs", - srcs = [ - "caffe2/core/blob_serialization_gpu.cc", - "caffe2/core/common_cudnn.cc", - "caffe2/core/common_gpu.cc", - "caffe2/core/event_gpu.cc", - "caffe2/operators/communicator_op_gpu.cc", - "caffe2/operators/concat_split_op_gpu.cc", - "caffe2/operators/conv_op_cache_cudnn.cc", - "caffe2/operators/conv_op_cudnn.cc", - "caffe2/operators/conv_op_gpu.cc", - "caffe2/operators/conv_op_shared_gpu.cc", - "caffe2/operators/conv_transpose_op_cudnn.cc", - "caffe2/operators/conv_transpose_op_gpu.cc", - "caffe2/operators/counter_ops_gpu.cc", - "caffe2/operators/do_op_gpu.cc", - "caffe2/operators/dropout_op_cudnn.cc", - "caffe2/operators/elementwise_add_op_gpu.cc", - "caffe2/operators/elementwise_sub_op_gpu.cc", - "caffe2/operators/elu_op_cudnn.cc", - "caffe2/operators/exp_op_gpu.cc", - "caffe2/operators/expand_op_gpu.cc", - "caffe2/operators/expand_squeeze_dims_op_gpu.cc", - "caffe2/operators/free_op_gpu.cc", - "caffe2/operators/fully_connected_op_gpu.cc", - "caffe2/operators/if_op_gpu.cc", - "caffe2/operators/im2col_op_gpu.cc", - "caffe2/operators/load_save_op_gpu.cc", - "caffe2/operators/local_response_normalization_op_cudnn.cc", - "caffe2/operators/locally_connected_op_gpu.cc", - "caffe2/operators/log_op_gpu.cc", - "caffe2/operators/matmul_op_gpu.cc", - "caffe2/operators/negate_gradient_op_gpu.cc", - "caffe2/operators/negative_op_gpu.cc", - "caffe2/operators/order_switch_ops_cudnn.cc", - "caffe2/operators/order_switch_ops_gpu.cc", - "caffe2/operators/pool_op_cudnn.cc", - "caffe2/operators/prepend_dim_op_gpu.cc", - "caffe2/operators/reshape_op_gpu.cc", - "caffe2/operators/rnn/recurrent_network_blob_fetcher_op_gpu.cc", - "caffe2/operators/rnn/recurrent_network_executor_gpu.cc", - "caffe2/operators/rnn/recurrent_op_cudnn.cc", - "caffe2/operators/scale_op_gpu.cc", - "caffe2/operators/shape_op_gpu.cc", - "caffe2/operators/sigmoid_op_cudnn.cc", - "caffe2/operators/softmax_op_cudnn.cc", - "caffe2/operators/sqr_op_gpu.cc", - "caffe2/operators/sqrt_op_gpu.cc", - "caffe2/operators/stop_gradient_gpu.cc", - "caffe2/operators/tanh_op_cudnn.cc", - "caffe2/operators/tensor_protos_db_input_gpu.cc", - "caffe2/operators/transpose_op_cudnn.cc", - "caffe2/operators/while_op_gpu.cc", - "caffe2/operators/zero_gradient_op_gpu.cc", - "caffe2/queue/queue_ops_gpu.cc", - "caffe2/sgd/iter_op_gpu.cc", - "caffe2/sgd/learning_rate_op_gpu.cc", - ], -) - -filegroup( - name = "caffe2_cu_srcs", - srcs = [ - "caffe2/core/context_gpu.cu", - "caffe2/operators/abs_op.cu", - "caffe2/operators/accumulate_op.cu", - "caffe2/operators/accuracy_op.cu", - "caffe2/operators/acos_op.cu", - "caffe2/operators/affine_channel_op.cu", - "caffe2/operators/alias_with_name.cu", - "caffe2/operators/arg_ops.cu", - "caffe2/operators/asin_op.cu", - "caffe2/operators/assert_op.cu", - "caffe2/operators/atan_op.cu", - "caffe2/operators/batch_gather_ops.cu", - "caffe2/operators/batch_matmul_op.cu", - "caffe2/operators/batch_moments_op.cu", - "caffe2/operators/batch_permutation_op.cu", - "caffe2/operators/batch_sparse_to_dense_op.cu", - "caffe2/operators/boolean_mask_ops.cu", - "caffe2/operators/boolean_unmask_ops.cu", - "caffe2/operators/bucketize_op.cu", - "caffe2/operators/cast_op.cu", - "caffe2/operators/cbrt_op.cu", - "caffe2/operators/ceil_op.cu", - "caffe2/operators/channel_backprop_stats_op.cu", - "caffe2/operators/channel_shuffle_op.cu", - "caffe2/operators/channel_stats_op.cu", - "caffe2/operators/channelwise_conv3d_op_cudnn.cu", - "caffe2/operators/clip_op.cu", - "caffe2/operators/copy_op.cu", - "caffe2/operators/cos_op.cu", - "caffe2/operators/cosh_op.cu", - "caffe2/operators/cosine_embedding_criterion_op.cu", - "caffe2/operators/cross_entropy_op.cu", - "caffe2/operators/cube_op.cu", - "caffe2/operators/data_couple_gpu.cu", - "caffe2/operators/deform_conv_op.cu", - "caffe2/operators/depthwise_3x3_conv_op_cudnn.cu", - "caffe2/operators/distance_op.cu", - "caffe2/operators/dropout_op.cu", - "caffe2/operators/elementwise_div_op.cu", - "caffe2/operators/elementwise_linear_op.cu", - "caffe2/operators/elementwise_mul_op.cu", - "caffe2/operators/elementwise_ops.cu", - "caffe2/operators/elu_op.cu", - "caffe2/operators/enforce_finite_op.cu", - "caffe2/operators/ensure_cpu_output_op.cu", - "caffe2/operators/erf_op.cu", - "caffe2/operators/filler_op.cu", - "caffe2/operators/find_op.cu", - "caffe2/operators/floor_op.cu", - "caffe2/operators/gather_op.cu", - "caffe2/operators/gelu_op.cu", - "caffe2/operators/generate_proposals_op.cu", - "caffe2/operators/generate_proposals_op_util_nms_gpu.cu", - "caffe2/operators/given_tensor_byte_string_to_uint8_fill_op.cu", - "caffe2/operators/given_tensor_fill_op.cu", - "caffe2/operators/glu_op.cu", - "caffe2/operators/group_norm_op.cu", - "caffe2/operators/gru_unit_op_gpu.cu", - "caffe2/operators/half_float_ops.cu", - "caffe2/operators/hard_sigmoid_op.cu", - "caffe2/operators/instance_norm_op.cu", - "caffe2/operators/integral_image_op.cu", - "caffe2/operators/layer_norm_op.cu", - "caffe2/operators/leaky_relu_op.cu", - "caffe2/operators/lengths_pad_op.cu", - "caffe2/operators/lengths_tile_op.cu", - "caffe2/operators/local_response_normalization_op.cu", - "caffe2/operators/logit_op.cu", - "caffe2/operators/loss_op.cu", - "caffe2/operators/lp_pool_op.cu", - "caffe2/operators/lstm_unit_op_gpu.cu", - "caffe2/operators/margin_ranking_criterion_op.cu", - "caffe2/operators/max_pool_with_index.cu", - "caffe2/operators/mean_op.cu", - "caffe2/operators/mem_query_op.cu", - "caffe2/operators/minmax_ops.cu", - "caffe2/operators/moments_op.cu", - "caffe2/operators/multi_class_accuracy_op.cu", - "caffe2/operators/normalize_ops.cu", - "caffe2/operators/one_hot_ops.cu", - "caffe2/operators/pack_segments.cu", - "caffe2/operators/pad_op_gpu.cu", - "caffe2/operators/perplexity_op.cu", - "caffe2/operators/piecewise_linear_transform_op.cu", - "caffe2/operators/pool_op.cu", - "caffe2/operators/pow_op.cu", - "caffe2/operators/prelu_op.cu", - "caffe2/operators/reciprocal_op.cu", - "caffe2/operators/reduce_front_back_max_ops.cu", - "caffe2/operators/reduce_front_back_sum_mean_ops.cu", - "caffe2/operators/reduce_ops.cu", - "caffe2/operators/reduction_ops.cu", - "caffe2/operators/relu_n_op.cu", - "caffe2/operators/relu_op.cu", - "caffe2/operators/replace_nan_op.cu", - "caffe2/operators/resize_3d_op.cu", - "caffe2/operators/resize_op.cu", - "caffe2/operators/reverse_packed_segs_op.cu", - "caffe2/operators/rmac_regions_op.cu", - "caffe2/operators/rnn/recurrent_network_op_gpu.cu", - "caffe2/operators/roi_align_gradient_op.cu", - "caffe2/operators/roi_align_op.cu", - "caffe2/operators/roi_align_rotated_gradient_op.cu", - "caffe2/operators/roi_align_rotated_op.cu", - "caffe2/operators/roi_pool_op.cu", - "caffe2/operators/rsqrt_op.cu", - "caffe2/operators/scale_blobs_op.cu", - "caffe2/operators/segment_reduction_op_gpu.cu", - "caffe2/operators/selu_op.cu", - "caffe2/operators/sequence_ops.cu", - "caffe2/operators/sigmoid_op.cu", - "caffe2/operators/sin_op.cu", - "caffe2/operators/sinh_op.cu", - "caffe2/operators/slice_op.cu", - "caffe2/operators/softmax_ops.cu", - "caffe2/operators/softplus_op.cu", - "caffe2/operators/softsign_op.cu", - "caffe2/operators/space_batch_op_gpu.cu", - "caffe2/operators/sparse_normalize_op_gpu.cu", - "caffe2/operators/sparse_to_dense_op.cu", - "caffe2/operators/spatial_batch_norm_op.cu", - "caffe2/operators/spatial_batch_norm_op_cudnn.cu", - "caffe2/operators/stump_func_op.cu", - "caffe2/operators/summarize_op.cu", - "caffe2/operators/swish_op.cu", - "caffe2/operators/tan_op.cu", - "caffe2/operators/tanh_op.cu", - "caffe2/operators/thresholded_relu_op.cu", - "caffe2/operators/tile_op.cu", - "caffe2/operators/top_k.cu", - "caffe2/operators/transpose_op.cu", - "caffe2/operators/unique_ops.cu", - "caffe2/operators/upsample_op.cu", - "caffe2/operators/utility_ops.cu", - "caffe2/operators/weighted_sample_op.cu", - "caffe2/sgd/adadelta_op_gpu.cu", - "caffe2/sgd/adagrad_op_gpu.cu", - "caffe2/sgd/adam_op_gpu.cu", - "caffe2/sgd/fp16_momentum_sgd_op.cu", - "caffe2/sgd/fp32_momentum_sgd_op.cu", - "caffe2/sgd/lars_op_gpu.cu", - "caffe2/sgd/momentum_sgd_op_gpu.cu", - "caffe2/sgd/rmsprop_op_gpu.cu", - "caffe2/sgd/yellowfin_op_gpu.cu", - "caffe2/utils/math/broadcast.cu", - "caffe2/utils/math/elementwise.cu", - "caffe2/utils/math/reduce.cu", - "caffe2/utils/math/transpose.cu", - "caffe2/utils/math_gpu.cu", - ], -) - # To achieve finer granularity and make debug easier, caffe2 is split into three libraries: # ATen, caffe2 and caffe2_for_aten_headers. ATen lib group up source codes under # aten/ directory and caffe2 contains most files under `caffe2/` directory. Since the @@ -1250,23 +593,8 @@ cc_library( "caffe2/core/nomnigraph/include/nomnigraph/Support/*.h", "caffe2/core/nomnigraph/include/nomnigraph/Transformations/*.h", "caffe2/core/nomnigraph/tests/*.h", - "caffe2/ideep/*.h", - "caffe2/ideep/operators/*.h", - "caffe2/ideep/operators/quantization/*.h", - "caffe2/ideep/utils/*.h", - "caffe2/onnx/*.h", - "caffe2/operators/*.h", - "caffe2/operators/rnn/*.h", - "caffe2/opt/*.h", "caffe2/perfkernels/*.h", - "caffe2/predictor/*.h", - "caffe2/predictor/emulator/*.h", - "caffe2/quantization/server/*.h", - "caffe2/queue/*.h", "caffe2/serialize/*.h", - "caffe2/sgd/*.h", - "caffe2/share/contrib/depthwise/*.h", - "caffe2/transforms/*.h", "caffe2/utils/*.h", "caffe2/utils/math/*.h", "caffe2/utils/threadpool/*.h", @@ -1292,48 +620,12 @@ cc_library( ], ) -cc_library( - name = "caffe2_dnnlowp_avx2_ops", - srcs = [ - "caffe2/quantization/server/elementwise_sum_dnnlowp_op_avx2.cc", - "caffe2/quantization/server/fully_connected_fake_lowp_op_avx2.cc", - "caffe2/quantization/server/group_norm_dnnlowp_op_avx2.cc", - "caffe2/quantization/server/norm_minimization_avx2.cc", - "caffe2/quantization/server/pool_dnnlowp_op_avx2.cc", - "caffe2/quantization/server/relu_dnnlowp_op_avx2.cc", - "caffe2/quantization/server/spatial_batch_norm_dnnlowp_op_avx2.cc", - "caffe2/quantization/server/transpose.cc", - ], - copts = CAFFE2_COPTS + [ - "-mf16c", - "-mavx2", - "-mfma", - "-mxsave", - ], - visibility = ["//visibility:public"], - deps = [ - ":caffe2_headers", - "@fbgemm", - ], - alwayslink = True, -) - cc_library( name = "caffe2", srcs = [ - "caffe2/share/contrib/depthwise/depthwise3x3_conv_op.cc", ":caffe2_core_srcs", - ":caffe2_ideep_srcs", - ":caffe2_onnx_srcs", - ":caffe2_operators_srcs", - ":caffe2_opt_srcs", ":caffe2_perfkernels_srcs", - ":caffe2_predictor_srcs", - ":caffe2_quantization_srcs", - ":caffe2_queue_srcs", ":caffe2_serialize_srcs", - ":caffe2_sgd_srcs", - ":caffe2_transforms_srcs", ":caffe2_utils_srcs", ], copts = CAFFE2_COPTS + ["-mf16c"], @@ -1341,7 +633,6 @@ cc_library( visibility = ["//visibility:public"], deps = [ ":caffe2_core_macros", - ":caffe2_dnnlowp_avx2_ops", ":caffe2_headers", ":caffe2_perfkernels_avx", ":caffe2_perfkernels_avx2", @@ -1357,7 +648,6 @@ cc_library( "@onnx", ] + if_cuda( [ - ":caffe2_cuda_cpp", ":aten_cuda", "@tensorpipe//:tensorpipe_cuda", ], @@ -1369,34 +659,16 @@ cc_library( alwayslink = True, ) -cc_library( - name = "caffe2_cuda_cpp", - srcs = [":caffe2_cuda_cpp_srcs"], - copts = CAFFE2_COPTS, - visibility = ["//visibility:public"], - deps = [ - ":caffe2_cuda", - ":caffe2_headers", - ], - alwayslink = True, -) - cu_library( - name = "caffe2_cuda", - # one may think that `quantization_gpu.cu` could be a separate kernel, - # however that leads to de-registration problem that's described in - # https://github.com/pytorch/pytorch/issues/79236 - # To solve it we add it into the `caffe2_cuda`, - # this is also aligned with the CMake build. - srcs = [":caffe2_cu_srcs"] + [ + name = "torch_cuda", + srcs = [ "torch/csrc/distributed/c10d/intra_node_comm.cu", "torch/csrc/distributed/c10d/quantization/quantization_gpu.cu", ], - copts = CAFFE2_COPTS + torch_cuda_half_options, + copts = torch_cuda_half_options, visibility = ["//visibility:public"], deps = [ ":aten", - ":caffe2_headers", "@cuda//:cublas", "@cuda//:curand", "@cudnn", @@ -1574,6 +846,7 @@ cc_library( ] + if_cuda([ "@cuda//:nvToolsExt", "@cutlass", + ":torch_cuda", ]), alwayslink = True, ) diff --git a/CMakeLists.txt b/CMakeLists.txt index d61f3a7619990..79db67e7357b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -232,7 +232,6 @@ option(USE_GFLAGS "Use GFLAGS" OFF) option(USE_GLOG "Use GLOG" OFF) option(USE_LITE_PROTO "Use lite protobuf instead of full." OFF) option(USE_MAGMA "Use MAGMA" ON) -option(USE_METAL "Use Metal for Caffe2 iOS build" ON) option(USE_PYTORCH_METAL "Use Metal for PyTorch iOS build" OFF) option(USE_PYTORCH_METAL_EXPORT "Export Metal models on MacOSX desktop" OFF) option(USE_NATIVE_ARCH "Use -march=native" OFF) diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt index 569bc010f40fd..0f2c54bb0e506 100644 --- a/caffe2/CMakeLists.txt +++ b/caffe2/CMakeLists.txt @@ -116,35 +116,14 @@ endif() # Skip modules that are not used by libtorch mobile yet. if(BUILD_CAFFE2 AND NOT INTERN_BUILD_MOBILE) - add_subdirectory(predictor) - add_subdirectory(predictor/emulator) add_subdirectory(core/nomnigraph) if(USE_NVRTC) add_subdirectory(cuda_rtc) endif() - add_subdirectory(ideep) - add_subdirectory(mobile) - add_subdirectory(mpi) - add_subdirectory(observers) - add_subdirectory(onnx) if(BUILD_CAFFE2_OPS) - add_subdirectory(operators) - add_subdirectory(operators/rnn) - if(USE_FBGEMM) - add_subdirectory(quantization/server) - endif() - if(USE_QNNPACK) - add_subdirectory(operators/quantized) - endif() endif() - add_subdirectory(opt) add_subdirectory(proto) add_subdirectory(python) - add_subdirectory(queue) - add_subdirectory(sgd) - add_subdirectory(share) - # add_subdirectory(test) # todo: use caffe2_gtest_main instead of gtest_main because we will need to call GlobalInit - add_subdirectory(transforms) endif() if(NOT BUILD_CAFFE2 AND NOT INTERN_BUILD_MOBILE) add_subdirectory(proto) @@ -1239,11 +1218,6 @@ if(USE_TBB) target_link_libraries(torch_cpu PUBLIC TBB::tbb) endif() -if(BUILD_CAFFE2 AND BUILD_CAFFE2_OPS AND USE_FBGEMM) - # FIXME: quantization/server/conv_dnnlowp_op.cc depends on fbgemm/src/RefImplementations.h - target_include_directories(torch_cpu PRIVATE ${CMAKE_CURRENT_LIST_DIR}/../third_party) -endif() - target_include_directories(torch_cpu PRIVATE ${ATen_CPU_INCLUDE}) target_include_directories(torch_cpu PRIVATE diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index 688d814817c82..f984bbebfab0d 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -1446,13 +1446,6 @@ if(USE_SNPE AND ANDROID) endif() endif() -if(USE_METAL) - if(NOT IOS) - message(WARNING "Metal is only used in ios builds.") - caffe2_update_option(USE_METAL OFF) - endif() -endif() - if(USE_NNAPI AND NOT ANDROID) message(WARNING "NNApi is only used in android builds.") caffe2_update_option(USE_NNAPI OFF) diff --git a/cmake/Summary.cmake b/cmake/Summary.cmake index 9b2859955702d..72c1243c24ea9 100644 --- a/cmake/Summary.cmake +++ b/cmake/Summary.cmake @@ -131,7 +131,6 @@ function(caffe2_print_configuration_summary) message(STATUS " USE_GFLAGS : ${USE_GFLAGS}") message(STATUS " USE_GLOG : ${USE_GLOG}") message(STATUS " USE_LITE_PROTO : ${USE_LITE_PROTO}") - message(STATUS " USE_METAL : ${USE_METAL}") message(STATUS " USE_PYTORCH_METAL : ${USE_PYTORCH_METAL}") message(STATUS " USE_PYTORCH_METAL_EXPORT : ${USE_PYTORCH_METAL_EXPORT}") message(STATUS " USE_MPS : ${USE_MPS}")