Commit Graph

2494 Commits

Author SHA1 Message Date
Yanghan Wang
ad64789a1e add aligned option to RoIAlign
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/23706

Reviewed By: ppwwyyxx

Differential Revision: D16615823

fbshipit-source-id: fd9152af8bc979cb04044413e66af349b032a99d
2019-08-07 21:22:33 -07:00
Shali Jiang
15d3f0242b support Gather different indices for different examples in one batch (#23813)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/23813

Pull Request resolved: https://github.com/pytorch/pytorch/pull/23285

for example:

Inputs:
  data:
   [[[2 4 2 0],
     [0 1 2 0],
     [1 1 0 0]],
    [[3 4 1 3],
     [0 3 2 2],
     [4 1 0 4]]]

  idx:
    [[0 2],
     [0 1]]

outputs:
  [[[2 4 2 0],
    [1 1 0 0]],
   [[3 4 1 3],
    [0 3 2 2]]]

data and idx must have the same outer dimension

call Gather or BatchGather with argument match_outer=True

Reviewed By: huayuli00

Differential Revision: D16652485

fbshipit-source-id: 9e144e97a8d6fceaf3b5714df1534338068f4a10
2019-08-07 21:14:30 -07:00
Amy Yang
9588cd921e weight_names bug fix (#23848)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/23848

Problem:
In experiment running feed model 127607201 (/mnt/public/tracelog/feed_repro2/127607201_0.predictor), encountered blob dimensionality mismatch error when running onnxified net. This is due to the model initializing input blobs in current workspace with blob size 0, and onnxifi() falsely identified those input blobs as weight blobs and assigned wrong dimension.

Solution:
Add option to pass correct weight blob names to onnxifi() instead of using all blobs in current workspace.

Reviewed By: yinghai

Differential Revision: D16661396

fbshipit-source-id: cabe44db6b64e6538bef4b65e380312214b3ba9f
2019-08-06 10:58:43 -07:00
Andrey Malevich
d58059bc6f Fix SliceGradientOp to handle properly empty batches (#23784)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/23784

Backward path does nothing during the gradient path when the input as empty, as
a result workspace can preserve gradient values from previous iteration and get
inconsistent inputs for some of the backward pass operators. This diff should
fix this disrepancy by always reinitializing output during the backward path.

Reviewed By: dzhulgakov

Differential Revision: D16646096

fbshipit-source-id: 8ca68dfad17a63fc87c033cce7b36b40bd77245c
2019-08-06 02:43:32 -07:00
Michael Suo
a3c165f9d2 Revert D16452539: support Gather different indices for different examples in one batch
Differential Revision:
D16452539

Original commit changeset: 7229489f4a9c

fbshipit-source-id: 010c177e551cb81521d2af84ce951bf964cdab44
2019-08-05 10:22:01 -07:00
Shali Jiang
f87a4cc23f support Gather different indices for different examples in one batch (#23285)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/23285

for example:

Inputs:
  data:
   [[[2 4 2 0],
     [0 1 2 0],
     [1 1 0 0]],
    [[3 4 1 3],
     [0 3 2 2],
     [4 1 0 4]]]

  idx:
    [[0 2],
     [0 1]]

outputs:
  [[[2 4 2 0],
    [1 1 0 0]],
   [[3 4 1 3],
    [0 3 2 2]]]

data and idx must have the same outer dimension

call Gather or BatchGather with argument match_outer=True

Reviewed By: huayuli00

Differential Revision: D16452539

fbshipit-source-id: 7229489f4a9c02ee9f3c6a8a24bcd02925d96e07
2019-08-04 21:17:49 -07:00
Le Fang
a1b10270c2 Fix the bug in regularizer matching (#23485)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/23485

In previous diff D16326492, the "regularizer" in dot processor is defined according to input regularizer options through the function "get_emb_weighting_reg" in processor_utils.py. The option matching is only valid in local test, but doesn't work in workflows. This bug causes the regularizer not added in actual models and has made previous trimmed lasso implementation useless.

An evidence is that before D16326492, a flow f126010621 has elastic regularizer added:
https://our.intern.facebook.com/intern/chronos/jobinstance/?jobinstanceid=5375243255&smc=chronos_gp_admin_client

{F171862755}

while after D16326492, the regularizer is gone in flow f127262007
https://our.intern.facebook.com/intern/chronos/jobinstance/?jobinstanceid=5428982684&smc=chronos_gp_admin_client

{F171862770}

Differential Revision: D16535466

fbshipit-source-id: 6b0b5e95b2b14a0d6c6d65f96bab89529f4e79c5
2019-08-02 15:54:48 -07:00
Jiexian Li
302adf1d20 add LambdaRank DCG Loss Option (#23679)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/23679
Full Canary: https://fburl.com/fblearner/sa1pkpya
Add LambdaRank DCG Loss Option
* when use_idcg_normalization == true, regular LambdaRank with NDCG loss
* when use_idcg_normalization == false, gradient and loss functions are not normalized by idcg.

Differential Revision: D16605459

fbshipit-source-id: a16f071e69516974e48d27bef4ca179019ca4ae7
2019-08-02 11:47:46 -07:00
Jiexian Li
fc6aec9491 format only change (#23685)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/23685

format only changes.

Differential Revision: D16607482

fbshipit-source-id: 572afb59c6ff9f8a8842ba044fed6c87f8506843
2019-08-02 11:47:42 -07:00
Levent Ertoz
8d4956fd02 hook up dropout sparse with replacement operator
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/23183

Reviewed By: ffjiang

Differential Revision: D16428262

fbshipit-source-id: 0d6e17d15c898629bbd2826441f2c9701a78b0bd
2019-07-23 14:34:25 -07:00
Levent Ertoz
6f01d13728 Implement dropout with replacement for id list features. (#22880)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22880

Implement sparse dropout with replacement value.

Reviewed By: xianjiec

Differential Revision: D16267012

fbshipit-source-id: 8c4878230f61bb3ac333291e2c6aaf2fbdc5f9ce
2019-07-23 14:34:21 -07:00
Kevin Wilfong
3ca7c0ffdb Add get_accessed_features function to ModelLayer class (#23036)
Summary:
We need a way to figure get a complete list fo features that are used in training a model.  One way to do this is to make it possible to get the list of features used in each Model Layer.  Then once the model is complete we can go through the layers and aggregate the features.

I've introduced a function to expose that information here, get_accessed_features, and implemented it in the FeatureSparseToDense layer to start with.

I've tried to include the minimum amount of information to make this useful, while making it easy to integrate into the variety of model layers.  This is, for example, why AccessedFeatures does not contain feature_names which is not always present in a model layer.  I debated whether or not to include feature_type, but I think that's useful enough, and easy enough to figure out in a model layer, that it's worth including.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/23036

Test Plan:
Added a unit test to verify the behavior of get_accessed_features in FeatureSparseToDense.

aml_dper2-fblearner-flow-integration-tests failed due to a known issue D16355865
aml_dper3-fblearner-flow-integration-tests failed due to a known issue T47197113

I verified no tests in the integration tests failed to issues other than those known ones.

DPER2 canaries: https://fburl.com/fblearner/1217voga

Reviewed By: volkhin

Differential Revision: D16365380

Pulled By: kevinwilfong

fbshipit-source-id: 2dbb4d832628180336533f29f7d917cbad171950
2019-07-22 15:04:28 -07:00
Le Fang
442dd7b906 Implement "trimmed lasso" regularization and support all available regularization in a single interface (#22966)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22966

We want to implement "trimmed lasso" for feature selection with learnable and regularizable weights. Trimmed lasso is a simple yet powerful improved version from traditional lasso. More reference can be found at https://arxiv.org/abs/1708.04527 and http://proceedings.mlr.press/v97/yun19a.html. For quick and necessary intro, please refer to P1-3 of the paper at https://arxiv.org/abs/1708.04527.

Given n weights, traditional lasso sums up all weights' l1 norms. The trimmed lasso takes an input integer k (how many weights you want to select from n) and only sums over the smallest n - k weights. Given lambda as the regularization constant, the penalty term is only on the smallest n - k weights, but not other larger weights. If lambda becomes larger than certain threshold, the smallest n - k weights are shrunk to zero. That means we have those weights "dropped". With this property, the number k is the number of weights left after lasso, which we can easily control.

Meanwhile, we further support all available regularization in a single interface. Current supported regularizers on weights include no reg, l1, l2, elastic, trimmed l1, elastic with trimmed l1, group l1, and logbarrier.

Differential Revision: D16326492

fbshipit-source-id: 6e1fd75606005d9bc09d6650435c96a7984ba69c
2019-07-17 16:12:31 -07:00
Lu Fang
796a39ba85 Automatic update of fbcode/onnx to 707064980b9825b8705b9d1c9aad34d8b022d5dd (#22981)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22981

Previous import was 806aa863020fa180e57f576cb032ec44ce8ddcca

Included changes:
- **[70706498](https://github.com/onnx/onnx/commit/70706498)**: TensorProto::INT8 & INT16 were missed here (#2164) <ZINEKS>
- **[8218a4ea](https://github.com/onnx/onnx/commit/8218a4ea)**: Fix LabelEncoder's shape inference (#2170) <Wei-Sheng Chin>
- **[0f1a9a1c](https://github.com/onnx/onnx/commit/0f1a9a1c)**: Fixing a unit test in Cumsum Operator (#2157) <Jeff Saremi>
- **[2c03cff0](https://github.com/onnx/onnx/commit/2c03cff0)**: [New Operator] CumSum (#2030) <Jeff Saremi>
- **[220b8300](https://github.com/onnx/onnx/commit/220b8300)**: Fix globalpool output shape (#2147) <daquexian>

Reviewed By: benoitsteiner

Differential Revision: D16341736

fbshipit-source-id: 7e7a2684d8c821991231bfd6558f9f6cb4fb05fb
2019-07-17 14:05:14 -07:00
Xiaodong Wang
2630109727 always restore dlopen flag in dyndep (#22958)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22958

When we use `extension_loader.DlopenGuard()` to dyndep or import modules, it sets a `RTLD_GLOBAL` flag, and restores the original flags after the `yield`. However, if the modules is not there, yield will fail, and the flags won't be restored, creating all kinds of symbol conflict problems.

Reviewed By: bddppq

Differential Revision: D16311949

fbshipit-source-id: 7b9ec6d60423ec5e78cae694b66c2f17493840b0
2019-07-17 10:26:25 -07:00
Xiaodong Wang
9b8d771733 skip import nccl and gloo_gpu in cpu machine (#22522)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22522

Skip importing nccl and gloo_gpu modules in cpu machine

Reviewed By: bddppq

Differential Revision: D16115827

fbshipit-source-id: 329b7a0bb5eccb78c9e772bdab5db7c79b546d55
2019-07-10 11:56:56 -07:00
Will Feng
3a12520844 Pass Variable into Caffe2 ops, by requiring that the Variable doesn't require grad (#22473)
Summary:
As part of the Variable/Tensor merge, we want to be able to pass Variables into Caffe2 without doing extra shallow copy, to improve performance and also allow for in-place mutations in Caffe2 ops. There are a few approaches outlined in https://github.com/pytorch/pytorch/pull/22418, and this PR is the chosen approach.

Specifically, we can have the assumption that we won't be connecting autograd to C2 gradients at any point (as it's too tricky and not that useful). Therefore, we can pass Variable into Caffe2 ops by requiring that all Variables in Caffe2 don't require grad. For code paths in Caffe2 that might potentially track gradients (e.g. `ScriptModuleOp` and `call_caffe2_op_from_c10`), we use the `torch::NoGradGuard` to make sure gradients are not tracked.

This supersedes https://github.com/pytorch/pytorch/pull/22418.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22473

Differential Revision: D16099042

Pulled By: yf225

fbshipit-source-id: 57efc3c7cfb3048d9abe90e63759acc14ebd2972
2019-07-08 11:31:10 -07:00
Du Tran
d2ceab2766 update video input (#22471)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22471

update C2 video input with latest augmentation

Reviewed By: HengCV

Differential Revision: D16096127

fbshipit-source-id: bb07394e211cd52b50005d801b6d03250248ea9e
2019-07-05 00:56:33 -07:00
Alyssa Wang
d9e15bccb0 Perform weight re-init for embedding table in sparse_lookup.py (#22348)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22348

This is the last step of LRU hash eviction weight re-init. This diff checks if there's evicted values in sparse_lookup, if so call op created in D15709866 to re-init the values for indicies in evicted_values. Also created gradient op for the operator. The gradient op just passes the output gradient as input gradient.

Reviewed By: itomatik

Differential Revision: D16044736

fbshipit-source-id: 9afb85209b0de1038c5153bcb7dfc5f52e0b2abb
2019-07-03 10:33:40 -07:00
Duke Vijitbenjaronk
d684112ec9 Output sequence probability with CTC beam search, optional multiple output sequences (#21927)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21927

Add `OUTPUT_PROB` output to CTCBeamSearchDecoderOp to return a probability for each sequence.

Add argument to output top-k instead of top-1 decoded sequences.

Reviewed By: SuperIRabbit

Differential Revision: D15797371

fbshipit-source-id: 737ca5cc4f90a0bcc3660ac9f58519a175977b69
2019-07-02 17:29:13 -07:00
Alyssa Wang
34f950c800 Create C2 operator to replace values in embedding table (#22279)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22279

This new operator is used for embedding table weight re-init. After we get the evicted indices, they will be the rows need reseting in embedding table. Then we can create a 1d tensor with default values, and apply this operator to copy the tensor to all evicted rows in embedding table

Will add gradient op in next diff

Reviewed By: itomatik

Differential Revision: D15709866

fbshipit-source-id: 2297b70a7326591524d0be09c73a588da245cc08
2019-07-02 15:26:22 -07:00
Alyssa Wang
bb07f2d063 Pass LRU hash output evicted_values to SparseLookup (#21389)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21389

As titled. To do weight re-init on evicted rows in embedding table, we need to pass the info of the evicted hashed values to SparseLookup, which is the layer model responsible for constructing the embedding table and do pooling.

To pass evicted values, we need to adjust the output record of lru_sparse_hash to include the evicted values, and add optional input to all processors that needs to take in sparse segment. For SparseLookup to get the evicted values, its input record needs to be adjusted. Now the input record can have type IdList/IdScoreList/or a struct of feature + evicted values

Reviewed By: itomatik

Differential Revision: D15590307

fbshipit-source-id: e493881909830d5ca5806a743a2a713198c100c2
2019-07-02 11:27:37 -07:00
Xianjie Chen
2dd1323379 Fix the GPU trainer for NoneCalibration and RNN
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/22385

Reviewed By: Wakeupbuddy

Differential Revision: D16053190

fbshipit-source-id: 6304c5c51f33691c201c78d4c921a9c250d9b4f5
2019-07-01 22:55:18 -07:00
Lu Fang
dfa6fca1c6 Supporting Manifold DB in Predictor Exporter (#22334)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22334

Improve the function signatures of save_to_db and load_from_db in predictor_exporter.

Reviewed By: akyrola

Differential Revision: D16047208

fbshipit-source-id: a4e947f86e00ef3b3dd32c57efe58f76a38fcec7
2019-07-01 16:17:02 -07:00
Xiaomeng Yang
10e4137396 Optimize InstanceNormGradientOp (#22288)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22288

Optimize InstanceNormGradientOp

Benchmarks:

CPU with [N, C, H, W] = [128, 256, 56, 56],
NCHW order: 616ms -> 128ms
NHWC order: 1612ms -> 174ms

GPU with [N, C, H, W] = [128, 256, 112, 112],
NCHW order: 6450ms -> 37ms
NHWC order: 1419ms -> 82ms

Reviewed By: houseroad

Differential Revision: D16023630

fbshipit-source-id: 5af9bf1103cde2fc2bcb5cd5a057d039732f052e
2019-07-01 15:10:17 -07:00
Xiaomeng Yang
29b53b0259 Fix bug in caffe2 transpose on GPU (#22233)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22233

Fix bug in caffe2 transpose on GPU

Reviewed By: hl475

Differential Revision: D15994973

fbshipit-source-id: 542dc8757b51a6322fffa55826c1d4e32927398d
2019-06-26 11:33:25 -07:00
Cheng,Penghui
7ee82d48a8 Removed work around for convolution transpose op since the bug has be… (#22184)
Summary:
…en fixed in v0.18
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22184

Differential Revision: D15982627

Pulled By: bddppq

fbshipit-source-id: 8725d5b5e5b68e029ffb08af12b416bd310c9638
2019-06-25 14:34:34 -07:00
Zachary DeVito
5b87049c66 remove uses of std::shared_ptr<Module> (#21934)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21934
ghimport-source-id: e64ab9096f43749ead3ac5567675b815da295664

Test Plan: Imported from OSS

Differential Revision: D15892401

Pulled By: zdevito

fbshipit-source-id: 6424139206593ff944556c69d8a54723884eacaf
2019-06-25 13:24:38 -07:00
Le Fang
ac4913ee62 support both regularizable and sofmax re-weighting on sparse features in dot product (#22176)
Summary:
In order to select more important features in dot product among a list of candidate sparse features, we can assign one learnable weight on each feature, reweight each feature by multiplying the weight onto its embedding before dot product. We finally select features based on the weight magnitude after training.

We can perform L1 and/or L2 regularization on the weights. To summarize, the weights tend to shrink their values (avoiding overfitting) due to L2 regularization, and some weights will vanish to zero as L1. To avoid sparse feature embedding being ignored due to early collapse of weights, a piece lr warm up policy is used in optimizing regularization term, such that regularization is weak at first stage and gets stronger afterwards (a small lr constant in iters less than threshold 1, a medium lr constant in stage 2, and a final reasonable large lr constant in all iters after threshold 2). The features with nonzero and relatively large weights (in absolute value) will be selected for the module.

We can also apply softmax on the original weights to make it sum to 1. We can even boosting the softmaxed weights by multiply the number of softmax components, which essentially make them sum to the number of softmax components and avergae to 1. In this idea, all the weights are positive and sum to a constant. Regularization is not a must since we can count on the competition between softmax weights themselves to achieve reasonable re-weighting. We expect those weights be more dense, comparing with sparse ones from L1 regularization and we can select features based on top K weights.

Overall, we aim to demonstrate the selected feature set outperform current v0 feature set in experiments. Special acknowledgement goes to Shouyuan Chen, who initiated the work of regularizable weighting.

 ---

Pull Request resolved: https://github.com/pytorch/pytorch/pull/22176

The diff will export updates to Github repository, as stated below.

{F162787228}

Basically, the updates on the files are summarized as below:

- adding logger messages
`caffe2/python/layer_model_helper.py`
- add ElasticNet regularizer, which combines both L1 and L2 regularization
`caffe2/python/regularizer.py`
- implement piecewarmup, specifically warm up with three constant pieces
`caffe2/sgd/learning_rate_functors.h, caffe2/sgd/learning_rate_op.cc, caffe2/sgd/learning_rate_op.h`

Differential Revision: D15923430

fbshipit-source-id: ee18902cb88c23b1b7b367cc727d690a21e4cda9
2019-06-24 21:27:33 -07:00
Frank Jiang
84a2d5d7aa Add hashing to bucket-weighted pooling (#20673)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/20673

Add option to bucket-weighted pooling to hash the bucket so that any cardinality score can be used.

Reviewed By: huginhuangfb

Differential Revision: D15003509

fbshipit-source-id: 575a149de395f18fd7759f3edb485619f8aa5363
2019-06-20 15:12:36 -07:00
Zhanibek Datbayev
4fee532de6 Pass loop_over optional parameter for cached reader properly. (#21929)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21929

Just need to pass `loop_over` argument properly.

Reviewed By: noname01

Differential Revision: D15885401

fbshipit-source-id: f1928277262a80e5b41f4c4f3945c2f378a4e233
2019-06-19 18:15:32 -07:00
hexiaoting
34536e207a Fix: convert Onnx DynamicSlice operator with 4 inputs to caffe2 fa… (#20846)
Summary:
I reported an issue [https://github.com/pytorch/pytorch/issues/20743](url)
and make this pull request for it
Pull Request resolved: https://github.com/pytorch/pytorch/pull/20846

Reviewed By: zrphercule

Differential Revision: D15569135

Pulled By: houseroad

fbshipit-source-id: 96a2c818ef666a7d79b96decfa347d7154b34d5c
2019-06-19 00:09:15 -07:00
Hong Xu
3bdde56907 Fix incorrect usage of __HIP_PLATFORM_HCC__ (#21757)
Summary:
This avoid using `__HIP_PLATFORM_HCC__` in case it changes in the future.

Following up https://github.com/pytorch/pytorch/issues/21718
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21757

Reviewed By: xw285cornell

Differential Revision: D15891867

Pulled By: bddppq

fbshipit-source-id: 5de55687ab1c86eddf6b4d8d25fee48d96ec72ad
2019-06-18 18:56:32 -07:00
Hongyu Xiong
76a250d590 Add new regression loss function type to FBLearner (#21080)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21080

Add Huber loss as a new option for regression training (refer to TensorFlow implementation: https://fburl.com/9va71wwo)
  # huber loss
  def huber(true, pred, delta):
    error = abs(true-pred)
    loss = 0.5 * min(error, delta)^2 + delta * max(error - delta, 0)
    return mean(loss)

As a combination of MSE loss (`x < delta`) and MAE loss (`x >= delta`), the advantage of Huber loss is to reduce the training dependence on outlier.

One thing worth to note is that Huber loss is not 2nd differential at `x = delta`. To further address this problem, one could consider adopt the loss of `LOG(cosh(x))`.

Reviewed By: chintak

Differential Revision: D15524377

fbshipit-source-id: 73acbe2728ce160c075f9acc65a1c21e3eb64e84
2019-06-17 17:43:00 -07:00
Benny Chen
1e7bd7586d Query caffe2 operator stats for detailed execution info (#20924)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/20924

I found a python3 bug for deserializing caffe2 code. The exception thrown is Unicode related error instead of just decode error, and we need to catch that as well

Reviewed By: ipiszy

Differential Revision: D15293221

fbshipit-source-id: 29820800d1b4cbe5bf3f5a189fe2023e655d0508
2019-06-13 23:41:04 -07:00
Sungmann Cho
f59581218f Fix spelling errors (#21665)
Summary:
alloctor -> allocator
excutable -> executable
excution -> execution
foward -> forward
initiaize -> initialize
paralell -> parallel
preprocesor -> preprocessor
tranpose -> transpose
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21665

Differential Revision: D15806155

Pulled By: soumith

fbshipit-source-id: d92b21ec8650a2b32f05faf9af0b7d2b073e992c
2019-06-13 15:21:55 -07:00
Natalia Lunova
63a7c7bb2a Add event and event_counter columns to caffe2_usage_tracer table (#21739)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21739

Added event and event_counter columns for PyTorch/Caffe2 API usage metrics

Reviewed By: dzhulgakov

Differential Revision: D15119119

fbshipit-source-id: a71010bd659109a8e4f3a8bad84b22c1d15dc528
2019-06-13 12:06:02 -07:00
Xiaodong Wang
5a7e2ccc0b Add use_rocm flag to detect AMD build in the runtime (#21718)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21718

adding a detection method on whether the package is built for AMD.

Reviewed By: bddppq

Differential Revision: D15795893

fbshipit-source-id: 91a21ee76b2273b1032507bdebe57e016717181d
2019-06-13 09:30:49 -07:00
Jiyan Yang
2c91ba3bbc Add div hashing
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/21422

Reviewed By: xianjiec

Differential Revision: D15589181

fbshipit-source-id: f6ff0726164f88da45e4b090b4d5ad05305b3225
2019-06-12 11:27:37 -07:00
Lu Fang
c2a08d339b Automatic update of fbcode/onnx to dd599b05f424eb161a31f3e059566a33310dbe5e (#21641)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21641

Previous import was 5160f3ac3380302224998f1c95e111cd961c4bc5

Included changes:
- **[dd599b05](https://github.com/onnx/onnx/commit/dd599b05)**: Fix type s/depracted/deprecated/ (#2092) <Takeshi Watanabe>
- **[abb1702a](https://github.com/onnx/onnx/commit/abb1702a)**: Add shape inference for Tile op (#2076) <Hariharan Seshadri>
- **[67638d9c](https://github.com/onnx/onnx/commit/67638d9c)**: [New Operator] Round (#2053) <Jeff Saremi>
- **[584e4477](https://github.com/onnx/onnx/commit/584e4477)**: Add dilations support in ConvTranspose shape inference and update docs (#2068) <daquexian>

Reviewed By: zrphercule

Differential Revision: D15762382

fbshipit-source-id: 590f25fb733e1565eb90fcdeb797b0ba34e2d2c3
2019-06-11 16:54:47 -07:00
Jinghui
29c849ff34 implement transpose operator for MKLDNN (#19955)
Summary:
implement transpose operator for MKLDNN
1. upgrade mkldnn-bridge to support ND transpose
2. implement transpose operator in caffe2.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19955

Differential Revision: D15701832

Pulled By: bddppq

fbshipit-source-id: e4337cd0ba6f8180a35c8c70cbb6830a0a84182f
2019-06-11 01:55:13 -07:00
Cheng,Penghui
74f6c55f0f support negative axis in concat and split operators
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/17955

Differential Revision: D14476031

Pulled By: ezyang

fbshipit-source-id: e0e57e8595ed2005ded9e923572a40fe62aca5a7
2019-06-10 15:26:29 -07:00
Haixin Liu
4bdbd30b96 Add python binding to deserialize blob (#21532)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21532

Add python binding to deserialize blob

Reviewed By: yinghai

Differential Revision: D15706816

fbshipit-source-id: f498c7e0f7392f055b13810bbf81cba59f25e1d2
2019-06-10 10:49:21 -07:00
Xing Wang
c4e0d61646 Regularization is not supported in FP16 (#21319)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21319

Add assertion to raise Exception when Regularization is applied on FP16.

Reviewed By: bddppq

Differential Revision: D15528486

fbshipit-source-id: c887c90d1d9ccfdaded3b5fa16816c6f29910e2e
2019-06-09 23:59:48 -07:00
David Zhang
696b2c89b4 Adding gradient to Boolean Mask operator (#21423)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21423

- add gradient for boolean mask
- add test for gradient checking

Reviewed By: BIT-silence

Differential Revision: D15640036

fbshipit-source-id: 79f40c6901e805bf1b8e9b01b57903e30b00f654
2019-06-06 20:48:47 -07:00
David Zhang
cb2ec07fa2 ReshapeOp supports empty tensor (#21230)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21230

tsia; we support empty tensor with this diff for reshape operator

Reviewed By: jerryzh168

Differential Revision: D15583356

fbshipit-source-id: 6d44c04e95ca3546509bfb12102e29c878f9a7c7
2019-06-06 15:02:11 -07:00
Hong Xu
da4f3629c5 Add missing shebangs to Python files with executable permissions.
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/21305

Differential Revision: D15613078

Pulled By: ezyang

fbshipit-source-id: 1fedf4368d65db406b617a51402ee8a20968aff7
2019-06-06 10:53:40 -07:00
Spandan Tiwari
22865d4ce1 Add ONNX export support for torch.rand. (#20559)
Summary:
This PR adds support for torch.rand export in the PyTorch ONNX exporter. There are other generator ops that need to be supported for export and they will added in subsequent PRs. This op is needed with priority for a model on our end.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/20559

Differential Revision: D15379653

Pulled By: houseroad

fbshipit-source-id: d590db04a4cbb256c966f4010a9361ab8eb3ade3
2019-06-03 16:09:01 -07:00
Xing Wang
7d84ca6e06 clean code to unify the logic to use fp16 by the optimizer engine (#20915)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/20915

Clean the unary processor code. Some question are added into the comments to seek suggestions.

Reviewed By: pjh5

Differential Revision: D15448502

fbshipit-source-id: ef0c45718c1a06187e3fe2e4e59b7f20c641d9c5
2019-06-03 15:03:35 -07:00
Lu Fang
07ac00d21a Automatic update of fbcode/onnx to 9005291283e943f1a91da5f0acf218bc4e8eb2ca (#21057)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21057

Previous import was cc2333a3f929caca7223b98699237f19388dd585

Included changes:
- **[90052912](https://github.com/onnx/onnx/commit/90052912)**: Fix wrong condition and add --user in update_doc.sh (#2050) <daquexian>
- **[a4f44a20](https://github.com/onnx/onnx/commit/a4f44a20)**: Add bit-shift operators for supporting hashing (#1931) <Wei-Sheng Chin>
- **[0098752c](https://github.com/onnx/onnx/commit/0098752c)**: Add shape inference logic for Expand op (#2041) <Hariharan Seshadri>
- **[fbe8addb](https://github.com/onnx/onnx/commit/fbe8addb)**: update qops tests (#2040) <Ashwini Khade>
- **[874fb37c](https://github.com/onnx/onnx/commit/874fb37c)**: Fix torchvision installation (#2054) <bddppq>
- **[1f5f6582](https://github.com/onnx/onnx/commit/1f5f6582)**: Fix bug that kernel_shape rather than effective_kernel_shape is used in dilated conv (#2043) <daquexian>
- **[38b6c44e](https://github.com/onnx/onnx/commit/38b6c44e)**: Changes done internally at Facebook (#2035) <Lu Fang>
- **[5c51f0db](https://github.com/onnx/onnx/commit/5c51f0db)**: Explicitly specify type of integers in the input tensor. (#2034) <Dmitri Smirnov>

Reviewed By: benoitsteiner

Differential Revision: D15534241

fbshipit-source-id: 8d2b78a986e5b7fbeb248f2d7b80c1a07230654e
2019-05-30 17:33:18 -07:00