pytorch/caffe2/python/operator_test
Lu Fang 664fe34e0a
[Caffe2][fbcode=>GH sync] Update from facebook 4323b18ce13c (#7116)
* [fix] Re-enable events in RNN ops

We have earlier added event disabling in RNN ops as back then we didn't use
events, with current use cases this is no longer true
(https://fburl.com/8vd0lp8y)

* use ops with cude impl

* Revert D7729695: [caffe2][fix] Re-enable events in RNN ops

This reverts commit 4b215c7496fb724656ff4c776933a15bdbbcde5e

@bypass-lint

An infra SEV is better than not reverting this diff.
If you copy this password, see you in SEV Review!
@cause_a_sev_many_files

* [observer] Clean up observer_config.h

#accept2ship

* [1/n] Refactor dataio_test.py

Replace code duplication with a common function

* Add barrier net that runs before training nets

Add a synchonize barrier net that is run before training nets.  With this net, shards that are faster will wait for other shards before start training.  This reduce chances of the faster shards timing out during GLOO AllReduce.

Removed explicit data_parallel_model.py.synchronize call in holmes workflow.  Similar change in speech/asr_training workflow will come in another diff.

* Support the dnnlowp backend in caffe2_benchmark

This is for SHARE operator latency evaluation

* Migrate integral_image_op to main caffe2

migrate integral_image_op(GPU version) given by https://fburl.com/yvqezigi
to caffe2/caffe2/operators and implement its CPU version. Write up a test
using the hypothesis_test mechanism

* [pos_disc, fbcode] Implement unjoined lr loss

As explained in https://our.intern.facebook.com/intern/wiki/Model_Based_Calibration/, when the dataset is an joined data set, where labels might change later, we need to use unjoined logloss.

The implementation is almost the same as in Sigrid (https://fburl.com/1trngsls), where
    loss = y (log(p) - log(1-p)) + (1-y)(log(1-p)) = xy - (1-y)x - (1-y)log(1+exp(-x))

For x < 0, to ensure stability and avoid overflow, we reformulate the above exp as
    loss = xy - (1-y)x - (1-y)x + (1-y)log(1+exp(x)) = xy + (1-y)log(1+exp(x))

Then the final expression becomes
    loss = xy + (y - 1) x (x >= 0) - (1 - y) log(1 + exp(x - 2 x (x >= 0)))

where y is the true label, x is the dot product and p = logistic(x).

This kind of implementation is align with the current implementation of the original cross entropy in
https://phabricator.intern.facebook.com/diffusion/FBS/browse/master/fbcode/caffe2/caffe2/operators/cross_entropy_op.cc;0bae3b5d0f825897c5e0dd0ff10f489d7271bf25$7-13

* Keep the array to fix the conflict

* [C2] Compute Adagrad effective LR

The AdagradWithLR op outputs an extra blob which is contains the average effective learning rate across all weights in this blob.

* Open-source extractMetaNetDef & runGlobalInitialization, add new Predictor constructor from db file, and add run_map_outputs

1. Open-source extractMetaNetDef and runGlobalInitialization, for use in
2. new Predictor constructor from db file.
3. Add new run function that returns outputs as TensorMap

* Disable eigen cpu

Disable eigen cpu in transpose and reduce

* Introduce request_only/object_only property of ModelLayer

by default this is False

* A simple TC Caffe2 benchmark

We can run tunner, get MappingOptions and then use them to
compare against cuBLAS

currently broken due to LLVM issues. How to run:

hg checkout eec1ab31b59c03b8deded1c755a9abaf8c45be01
add D7401202
add D7434625
add D7506031
add D7540728

buck run @mode/dev-nosan tc/tc/benchmarks_python:caffe2_benchmark

* Move Caffe2 feature_maps_ops to open source

Need feature maps operators in open source project facebookresearch/BlueWhale

* Manually fix the conflicts in channel shuffle op

* Fix the inconsistency between different gh and fbcode

* Skip Adagrad GPU Test (Because some gpu implementation is missing)

* Fix another test to make sure it won't run on gpu when implementation is not available yet
2018-05-01 20:49:00 -07:00
..
activation_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
adagrad_test.py [Caffe2][fbcode=>GH sync] Update from facebook 4323b18ce13c (#7116) 2018-05-01 20:49:00 -07:00
adam_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
apmeter_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
arg_max_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
arg_ops_test.py [caffe2] Update math functions with params on host. (#6602) 2018-04-14 21:41:41 -07:00
assert_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
atomic_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
basic_rnn_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
batch_box_cox_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
batch_sparse_to_dense_op_test.py Add batch-based/row-based sparse from/to dense operator 2017-11-16 00:59:21 -08:00
bbox_transform_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
blobs_queue_db_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
boolean_mask_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
boolean_unmask_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
cast_op_test.py cast op for empty batch 2017-11-16 12:20:20 -08:00
ceil_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
channel_backprop_stats_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
channel_shuffle_test.py ChannelShuffle with NHWC layout (#6667) 2018-04-18 19:13:45 -07:00
channel_stats_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
checkpoint_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
clip_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
clip_tensor_op_test.py Add gradient clipping (#2452) 2018-03-27 15:10:15 -07:00
collect_and_distribute_fpn_rpn_proposals_op_test.py [Caffe2] Fix the wrong argument name in collect_and_distribute_op (#7091) 2018-04-30 15:01:11 -07:00
concat_split_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
conditional_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
conv_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
conv_transpose_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
copy_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
cosine_embedding_criterion_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
counter_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
crf_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
cross_entropy_ops_test.py [Caffe2][fbcode=>GH sync] Update from facebook 4323b18ce13c (#7116) 2018-05-01 20:49:00 -07:00
cudnn_recurrent_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
dataset_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
deform_conv_test.py Deformable convolution operator in Caffe2 2017-09-26 16:20:31 -07:00
depthwise_3x3_conv_test.py [caffe2] Open-source DEPTHWISE_3x3 engine (#6601) 2018-04-26 02:30:51 -04:00
distance_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
dropout_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
duplicate_operands_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
elementwise_linear_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
elementwise_logical_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
elementwise_op_broadcast_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
elementwise_ops_test.py Add rsqrt op in caffe2 (#7154) 2018-05-01 15:06:53 -07:00
emptysample_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
enforce_finite_op_test.py Update from Facebook (#6692) 2018-04-17 23:36:40 -07:00
extend_tensor_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
fc_operator_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
feature_maps_ops_test.py [Caffe2][fbcode=>GH sync] Update from facebook 4323b18ce13c (#7116) 2018-05-01 20:49:00 -07:00
filler_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
find_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
flatten_op_test.py Enable Flatten operator to take an arbitrary axis arguemnt 2017-10-13 12:28:22 -07:00
flexible_top_k_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
floor_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
gather_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
gather_ranges_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
given_tensor_fill_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
glu_op_test.py Supress hypothesis health check in glu_op_test.py 2017-12-03 22:51:46 -08:00
group_conv_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
group_norm_op_test.py [Caffe2] Add moments op in caffe2 (#7114) 2018-05-01 12:19:08 -07:00
gru_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
hsm_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
im2col_col2im_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
image_input_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
index_hash_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
index_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
instance_norm_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
integral_image_ops_test.py [Caffe2][fbcode=>GH sync] Update from facebook 4323b18ce13c (#7116) 2018-05-01 20:49:00 -07:00
jsd_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
key_split_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
lars_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
layer_norm_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
lc_operator_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
leaky_relu_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
learning_rate_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
lengths_pad_op_test.py Update from facebook (#6871) 2018-04-23 15:01:56 -07:00
lengths_tile_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
lengths_top_k_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
listwise_l2r_operator_test.py Update caffe2 from facebook 4f527ef46abf (#2234) 2018-03-12 12:22:59 -07:00
load_save_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
loss_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
lpnorm_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
map_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
margin_ranking_criterion_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
math_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
matmul_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
mean_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
merge_id_lists_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
mkl_conv_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
mkl_packed_fc_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
mkl_speed_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
mod_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
moments_op_test.py [Caffe2] Add moments op in caffe2 (#7114) 2018-05-01 12:19:08 -07:00
momentum_sgd_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
mpi_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
negate_gradient_op_test.py NegateGradientOp and test 2017-11-13 18:05:14 -08:00
ngram_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
normalize_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
numpy_tile_op_test.py [caffe2][ONNX] Implement CPU NumpyTileOp and corresponding ONNX backend (#7053) 2018-04-27 19:58:15 -07:00
one_hot_ops_test.py [easy] fix comments 2018-03-30 21:00:44 -07:00
onnx_while_test.py [caffe2] Add flag to ONNXWhile to skip scoping (#6910) 2018-04-24 16:53:22 -07:00
pack_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
pack_rnn_sequence_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
pad_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
partition_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
percentile_op_test.py Adding the Percentile op & UT 2018-02-05 16:08:00 -08:00
piecewise_linear_transform_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
pooling_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
prepend_dim_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
python_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
rank_loss_operator_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
rebatching_queue_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
record_queue_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
recurrent_net_executor_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
recurrent_network_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
reduce_ops_test.py [caffe2] Add ReduceMinOp and ReduceMaxOp (#6744) 2018-04-19 00:22:23 -07:00
reduction_ops_test.py Add SumElementsInt operator 2018-03-27 18:10:39 -07:00
relu_op_test.py [caffe2] Fbcode to GitHub sync (#6208) 2018-04-02 16:35:27 -07:00
reshape_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
resize_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
rmac_regions_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
rnn_cell_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
segment_ops_test.py [Caffe2] Changes done inside Facebook (#6378) 2018-04-10 21:11:43 -07:00
selu_op_test.py selu op 2017-12-15 15:38:44 -08:00
sequence_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
shape_inference_test.py Update from facebook (#6871) 2018-04-23 15:01:56 -07:00
sinusoid_position_encoding_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
softmax_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
softplus_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
sparse_gradient_checker_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
sparse_lengths_sum_benchmark.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
sparse_normalize_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
sparse_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
sparse_to_dense_mask_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
spatial_bn_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
specialized_segment_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
square_root_divide_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
stats_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
string_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
text_file_reader_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
thresholded_relu_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
tile_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
top_k_test.py Update from facebook (#6871) 2018-04-23 15:01:56 -07:00
transpose_op_test.py [caffe2] Update math functions with params on host. (#6602) 2018-04-14 21:41:41 -07:00
unique_ops_test.py [Caffe2] Changes done inside Facebook (#6378) 2018-04-10 21:11:43 -07:00
unique_uniform_fill_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
utility_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
video_input_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
weighted_multi_sample_test.py Only run WeightedMultiSample test on CPU and not GPU. 2018-03-20 13:34:22 -07:00
weighted_sample_test.py support non-normalized weights 2017-10-27 23:18:25 -07:00
weighted_sum_test.py Don't run CUDA tests for ops without CUDA implementation 2017-11-08 10:28:02 -08:00