Parichay Kapoor [Tue, 15 Sep 2020 04:30:51 +0000 (13:30 +0900)]
[dist/debian] Disable QNNPACK/XNNPACK for all arch
Disable QNNPACK/XNNPACK for all architectures
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Change-Id: If2bce982c366864f245a671c34662cce4cefb4d2
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Mon, 14 Sep 2020 04:47:40 +0000 (13:47 +0900)]
[dist/debian] Disable python version check
Disable python version check as the variable is not found on xenial
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Change-Id: I49bfd534e93b0216053a8704cc21eac763e24bc6
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Mon, 14 Sep 2020 02:42:47 +0000 (11:42 +0900)]
[dist/debian] Remove unnecessary dependencies
Remove unnecessary dependencies of git, asio and blas
pytorch uses its own eigen over blas in the current build setup
git and asio are not used with the current version either
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Change-Id: Ia9331bce25367071d0dbc42d43ce9181219598c0
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Mon, 14 Sep 2020 02:41:50 +0000 (11:41 +0900)]
[dist/debian] Disable QNNPACK for armhf
Disable QNNPACK for armhf as well as it causes build timeouts, and file too large error
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Change-Id: Ib99f73d65facf0675f914a841e6be24ac6a68dc2
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Thu, 10 Sep 2020 04:56:09 +0000 (13:56 +0900)]
[dist/debian] Added packaging support for ubuntu <18.04
This patch adds support for ubuntu <18.04 (tested with 16.04)
For these ubuntu versions, python3.6 or higher is needed as an additional requirement
And then the version 3.6 is passed to the pybuild in gencontrol, auto_configure
and auto_install as they use the default system python3
The reason to do all of this is pytorch build requires minimum python version 3.6
Python 3.8 is not used as it requires python3-distutils which isnt backported to xenial
There is also a bug fix in the debian/control file for the python3 dependency
Python3 version dependency was specified as "python3 (>= 3.6)"
However, python3 is just virtual metapackage pointing to python3.* package
Rather python3.* must be specified as a build-dependency which is also done
by this patch
**Self evaluation:**
1. Build test: Passed on xenial, bionic and focal for amd64 architecture
Note that for xenial, extra PPA was added as a dependency in the build environment which
provided python3.6
Change-Id: Iebfd6e50969807256cdeee958e7121a5216ee427
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Mon, 20 Jul 2020 01:53:06 +0000 (10:53 +0900)]
[dist/debian] Disable QNNPACK for arm64
Disable QNNPACK for arm64 as it fails sometimes for arm64 build on launchpad
Change-Id: I4e344f973be86f60f39936388b411771c10d992e
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Mon, 20 Jul 2020 00:51:03 +0000 (09:51 +0900)]
[Dist/Debian] Limit number of threads for arm64
Limit number of build threads to 1 for arm64 to limit ram usage in launchpad build
Change-Id: I98352597128532ecc08827e7ac947afd7cf157a1
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Fri, 17 Jul 2020 10:51:42 +0000 (19:51 +0900)]
[Dist/debian] Turn off MKLDNN for arm64 arch
Turn off building with MKLDNN for arm64 arch
Change-Id: I1f914fbb5765369d664b413dacca53a51f599350
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Thu, 16 Jul 2020 09:01:46 +0000 (18:01 +0900)]
[Dist/Tizen/Debian] Update packaging with version update
Updated packaging based on update in version of the pytorch to 1.6.0-rc1
Change-Id: I1efdc90ce07cb647a0a7d91ab112b44e222d33c5
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Thu, 16 Jul 2020 09:18:26 +0000 (18:18 +0900)]
[pytorch] Update to version 1.6.0-rc1
Update to vesion 1.6.0-rc1
Change-Id: I53e568f805ea7d787c7cc013ed6b858e031160f9
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Sangjung Woo [Tue, 26 May 2020 11:30:13 +0000 (20:30 +0900)]
Revert "[Packaging] Use protobuf v3.8"
This reverts commit
de9097a1c079b7625e43fbac3fbb52b01705a155.
Change-Id: I159edcb8f55c1dc52e2d9bb2abb95ef3525c9dff
Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
Sangjung Woo [Fri, 22 May 2020 11:19:37 +0000 (20:19 +0900)]
[Packaging] Use protobuf v3.8
This patch uses protobuf v3.8 instead of previous v3.6.1.
Change-Id: I4003d08595a235fb26d435784ec5a022a32f2078
Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
MyungJoo Ham [Mon, 13 Jan 2020 09:37:23 +0000 (18:37 +0900)]
[Dist/Tizen] PyTorch/Caffe2 Pacakging.
This requires updates on python-PyYaml to support
Python3-yaml in Tizen.
With this, we can build pytorch/caffe2 in Tizen.
However, it is not run-tested.
Change-Id: I616446c57833c59a1d7c74cf3f0348244bb16448
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Parichay Kapoor [Thu, 13 Jun 2019 05:16:31 +0000 (14:16 +0900)]
Merge pull request #1 from helloahn/caffe2_headers
[Caffe2] add the missed header files
Hyoung Joo Ahn [Thu, 13 Jun 2019 04:40:23 +0000 (13:40 +0900)]
[Caffe2] add the missed header files
add the missed header files when caffe2 is installed
Signed-off-by: Hyoung Joo Ahn <hello.ahn@samsung.com>
Parichay Kapoor [Wed, 12 Jun 2019 06:26:22 +0000 (15:26 +0900)]
Added source to ignore files when making package tar
Renamed install file for the package
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Mon, 20 May 2019 10:59:12 +0000 (19:59 +0900)]
Updated rules for all python3 versions
Added caffe2 pkg config
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Fri, 17 May 2019 07:30:31 +0000 (16:30 +0900)]
Adding a copy of .gitignore, which will be present with launchpad built
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Fri, 17 May 2019 07:00:39 +0000 (16:00 +0900)]
added submodules in package for offline build
removed gitmodules
updated version number to 1.1.0
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Wed, 15 May 2019 00:20:13 +0000 (09:20 +0900)]
Added pytorch debian packaging
- Add debian rules and install for installing pytorch and caffe2
- Add pkgconfig for pytorch
- Add copyright, control, compat and corresponding change log
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Elias Ellison [Wed, 24 Apr 2019 07:45:19 +0000 (00:45 -0700)]
fix rocm test (#19663)
Summary:
for some reason exec in python fails on rocm build alone
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19663
Differential Revision:
D15061382
Pulled By: eellison
fbshipit-source-id:
d6e1776e88c22de973796e5080147e6d31aba477
efaust [Wed, 24 Apr 2019 06:26:04 +0000 (23:26 -0700)]
Enforce consistent dict iteration order for trace inputs. (#19528)
Summary:
Stack:
:black_circle: **#19528 [pytorch] Enforce consistent dict iteration order for trace inputs.** [:yellow_heart:](https://our.intern.facebook.com/intern/diff/
D15023656/)
Don't iterate down unordered_maps and expect ordering. Should fix test flakiness.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19528
Differential Revision:
D15023656
Pulled By: efaust
fbshipit-source-id:
91c9a31a8652fcf93ae0e942bea4cec67bb490c9
Jerry Zhang [Wed, 24 Apr 2019 04:24:40 +0000 (21:24 -0700)]
Enable assignment for QTensor in pytorch frontend (#19530)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19530
Make copy work with QTensor, enable assignment of QTensor in pytorch frontend.
Differential Revision:
D15008160
fbshipit-source-id:
5f1166246d768b23f009cde1fa03e8952368a332
eellison [Wed, 24 Apr 2019 03:31:36 +0000 (20:31 -0700)]
Dont introduce aliasing in CSE or Constant Pooling (#19576)
Summary:
We can't introduce aliasing to a graph output, since they may be mutated after.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19576
Differential Revision:
D15057734
Pulled By: eellison
fbshipit-source-id:
33594c05d985a0c58edebd6252e1ee2c0efb6f0e
Jerry Zhang [Wed, 24 Apr 2019 03:31:19 +0000 (20:31 -0700)]
Remove QTensor alias (#19635)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19635
att
Differential Revision:
D15053349
fbshipit-source-id:
7cd0e6c9ff567d05b051527410f452b059458af2
Dmytro Dzhulgakov [Wed, 24 Apr 2019 02:42:15 +0000 (19:42 -0700)]
Commit explicit libtorch_python sources (#19607)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19607
Explicit is better than implicit - it's pretty hard to debug where particular file is if it's not greppable.
As a follow up step - we should look whether we can just include build_variables.py in CMake directly to share setups of two build systems
Reviewed By: ezyang
Differential Revision:
D15023348
fbshipit-source-id:
600ef2d1871bc28530c6a02681b284f7499904df
Elias Ellison [Tue, 23 Apr 2019 23:30:49 +0000 (16:30 -0700)]
builtin ivalues sort (#19572)
Summary:
Add sorting to all the lists which we specialize on (Tensor, int, float, bool).
First part of https://github.com/pytorch/pytorch/issues/19372
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19572
Differential Revision:
D15052677
Pulled By: eellison
fbshipit-source-id:
301e8e0e3e29e04aca1311410db0a474fd833cff
James Reed [Tue, 23 Apr 2019 22:24:41 +0000 (15:24 -0700)]
Guard {set,rebase}_history on grad_fn check (#19623)
Summary:
We would previously have statements like
```
set_history(flatten_tensor_args( result ), grad_fn);
```
Internally, {set,rebase}_history would check grad_fn and short circuit if it is nullptr. However, this means that we are executing the expression `flatten_tensor_args( result )` and immediately throwing away the results. This was causing unnecessary allocations + overhead.
My JIT overhead benchmark script (with custom benchmark method):
```
import torch, time
torch.jit.script
def add(x, y):
return x + y
a = torch.rand([])
b = torch.rand([])
niter = 1000000
with torch.no_grad():
s = time.time()
add.__getattr__('forward').benchmark(niter, a, b)
e = time.time() - s
print('overhead per call (us)', e / niter * 1e6)
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19623
Differential Revision:
D15053399
Pulled By: jamesr66a
fbshipit-source-id:
8777e1a2b5c5a5bbd3a035b7247c8154c5fc4aa6
Xiaomeng Yang [Tue, 23 Apr 2019 22:24:03 +0000 (15:24 -0700)]
optimize BatchMatmulOp (#18612)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18612
optimize BatchMatmulOp
Reviewed By: houseroad
Differential Revision:
D14681665
fbshipit-source-id:
cf5ea4909ace58fd44fe6fa634531102ac84e851
Jerry Zhang [Tue, 23 Apr 2019 22:15:04 +0000 (15:15 -0700)]
fix lint (#19632)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19632
at
Differential Revision:
D15052952
fbshipit-source-id:
7c38fad99799e5ac914685c36eadf932afe52b74
Phúc Lê [Tue, 23 Apr 2019 21:49:50 +0000 (14:49 -0700)]
Add base support to torch.logspace, default base=10 (#19542)
Summary:
Add base support for torch.logspace. See #19220 for details.
SsnL can you feedback? Thanks a lot.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19542
Differential Revision:
D15028484
Pulled By: soumith
fbshipit-source-id:
fe5a58a203b279103abbc192c754c25d5031498e
Michael Suo [Tue, 23 Apr 2019 21:48:18 +0000 (14:48 -0700)]
disable flake8 E302 (two blank lines) (#19634)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19634
ghimport-source-id:
68b11ac3c19daf8df3bbf11e6181e9450899e90a
Differential Revision:
D15053466
Pulled By: suo
fbshipit-source-id:
09d7859aa2059fc9eb3b47fa62467537bab40e05
Tongzhou Wang [Tue, 23 Apr 2019 21:47:56 +0000 (14:47 -0700)]
fix nn.Sequential doc
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/19597
Differential Revision:
D15042383
Pulled By: soumith
fbshipit-source-id:
f912ed2a726a17fcc25795ff66b73ae4caacd247
Oleg Bogdanov [Tue, 23 Apr 2019 21:23:26 +0000 (14:23 -0700)]
caffe2 | Windows compat fixes
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/19531
Reviewed By: hlu1
Differential Revision:
D15024541
fbshipit-source-id:
cd8249a6d529afb65fa8afd74a05dbfe73eb1fb0
Sebastian Messmer [Tue, 23 Apr 2019 20:41:34 +0000 (13:41 -0700)]
Remove fixed TODO (#19590)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19590
-
Reviewed By: ezyang
Differential Revision:
D15039561
fbshipit-source-id:
246cf4fa91a33cb4c96750b534b8c3d0c312f311
Huamin Li [Tue, 23 Apr 2019 20:05:55 +0000 (13:05 -0700)]
correct comments in group_norm_op (#19621)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19621
Comments for group_norm_op is not accurate (i.e., the math part), this diff will fix it.
Reviewed By: BIT-silence
Differential Revision:
D15048695
fbshipit-source-id:
27d41d3ae21054257967815254134849944d56ca
Sebastian Messmer [Tue, 23 Apr 2019 19:43:24 +0000 (12:43 -0700)]
Simplify argument test cases (#19593)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19593
Removes a lot of duplication
Reviewed By: dzhulgakov
Differential Revision:
D15039887
fbshipit-source-id:
e90fe024b84220dd337fdd314d8f7e3620baec28
Sebastian Messmer [Tue, 23 Apr 2019 19:43:23 +0000 (12:43 -0700)]
Add test cases for optional of list (#19592)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19592
This is already supported but wasn't tested yet
Reviewed By: ezyang
Differential Revision:
D15039888
fbshipit-source-id:
dc8ea724c76dd1719b1d4810a20c8f958e5beecc
Stefan Krah [Tue, 23 Apr 2019 19:43:14 +0000 (12:43 -0700)]
Port adaptive_max_pool3d() to ATen (#19547)
Summary:
This is the second part of #18064.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19547
Differential Revision:
D15046630
Pulled By: ezyang
fbshipit-source-id:
03f80602b94d47bca66bfd0dcab1b7bb99e5b7f1
Elias Ellison [Tue, 23 Apr 2019 19:21:32 +0000 (12:21 -0700)]
add torch.tensor requires grad (#19445)
Summary:
Add setting requires_grad = True within torchscript to torch.Tensor
Within constant propagation, we can't insert any constants that require grad.
Also added shape analysis and requires grad analysis to torch.tensor
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19445
Differential Revision:
D15046211
Pulled By: eellison
fbshipit-source-id:
b4ef7a6b4b6b8dc03e1fa49f87dc415874cd1998
Yinghai Lu [Tue, 23 Apr 2019 19:17:59 +0000 (12:17 -0700)]
Surface the Glow traces to C2 (#19087)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19087
att
Reviewed By: jackm321
Differential Revision:
D14863112
fbshipit-source-id:
2680161b9f05391e73bb8dac4fbbeabb87a82c05
Kaiyu Shi [Tue, 23 Apr 2019 19:15:53 +0000 (12:15 -0700)]
Fix lack of state init for adagrad and add share_memory flag (#17679)
Summary:
The current code initialize the `state` in `__init__` method, but the initialization process is not invoked in `add_parameter_group`.
I followed the same approach in other Optimizers to init the `state`.
```python
import torch
emb = torch.nn.Embedding(10,10)
emb2 = torch.nn.Embedding(10,10)
optim = torch.optim.Adagrad(emb.parameters())
print(optim.state[emb.weight]) # already initialized
optim.add_param_group({'params': emb2.parameters()})
print(optim.state[emb2.weight]) # empty dict
loss = emb2.weight.sum() + emb.weight.sum()
loss.backward()
optim.step() # raised KeyError
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17679
Differential Revision:
D14577575
Pulled By: ezyang
fbshipit-source-id:
12440079ac964b9eedad48e393d47f558babe300
Priya Goyal [Tue, 23 Apr 2019 18:41:44 +0000 (11:41 -0700)]
Allow extracting element-wise loss in softmax (#19579)
Summary:
Often times, we want to experiment with loss per element (image etc.). This changeset allows getting per element loss as well. This output is optional.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19579
Reviewed By: jerryzh168
Differential Revision:
D15035797
Pulled By: prigoyal
fbshipit-source-id:
562dea514f49c1f2f1cbbc083a1938dc019a75c4
Wanchao Liang [Tue, 23 Apr 2019 18:16:28 +0000 (11:16 -0700)]
dispatch max_pools with no indices, expose max_pools to torch namespace (#19449)
Summary:
in functional interfaces we do boolean dispatch, but all to max_pool\*d_with_indices. This change it to emit max_pool\*d op instead when it's not necessary to expose with_indices ops to different backends (for jit).
It also bind max_pool\*d to the torch namespace, which is the same behavior with avg_pool\*d
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19449
Differential Revision:
D15016839
Pulled By: wanchaol
fbshipit-source-id:
f77cd5f0bcd6d8534c1296d89b061023a8288a2c
Jerry Zhang [Tue, 23 Apr 2019 18:03:38 +0000 (11:03 -0700)]
Adds `fakeQuantizePerTensorAffineOp` to pytorch (#19387)
Summary:
Adding fakequant op so that we can use it in pytorch models, the exact implementation might change.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19387
Differential Revision:
D13739657
fbshipit-source-id:
d5cb084e843d236bb1da9827ac1ba3900ed99786
James Reed [Tue, 23 Apr 2019 18:03:31 +0000 (11:03 -0700)]
-fno-math-errno -fno-trapping-math (#19552)
Summary:
As suggested in https://github.com/pytorch/pytorch/pull/19152#discussion_r275925767, this may give the compiler more opportunities for auto-vectorization
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19552
Differential Revision:
D15048358
Pulled By: jamesr66a
fbshipit-source-id:
db2c2c515c3e9f7d22305c039ab0c8a867fc43a2
Bram Wasti [Tue, 23 Apr 2019 17:49:39 +0000 (10:49 -0700)]
Only require python print on certain namespaces (#19383)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19383
ghimport-source-id:
b93c7849a52d11ecbf26b614704740d44a2447f9
Differential Revision:
D15032727
Pulled By: bwasti
fbshipit-source-id:
a19f72abb99e63d87eab13022538f325b2e20526
Zafar Takhirov [Tue, 23 Apr 2019 17:26:23 +0000 (10:26 -0700)]
Use `fbgemm` for quantize/dequantize ops (#19500)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19500
Changes the `quantize_linear` and `dequantize` to `fbgemm`-based implementation.
Reviewed By: jianyuh, jerryzh168
Differential Revision:
D15014561
fbshipit-source-id:
b651e69d336b5b08b4a75a4a4eddf46c040a4934
Jiyan Yang [Tue, 23 Apr 2019 17:05:57 +0000 (10:05 -0700)]
Specify to use Float16UniformFill if necessary in sparse lookup layer (#18499)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18499
If the init op is not fp16 compatible, it should throw.
However, in the special case where the original init op is UniformFill,
we replace it with Float16UniformFill
Reviewed By: kennyhorror
Differential Revision:
D14627209
fbshipit-source-id:
eb427772874a732ca8b3a25d06670d119ce8ac14
Chandler Zuo [Tue, 23 Apr 2019 16:47:37 +0000 (09:47 -0700)]
Fix the Division by Zero Bug of CosineAnnealingLR (#19180)
Summary:
Added the formula for the corner case. Updated unit tests.
Fixes #17913
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19180
Differential Revision:
D14942023
Pulled By: ezyang
fbshipit-source-id:
167c109b97a7830d5b24541dc91e4788d531feec
Vadim Velicodnii [Tue, 23 Apr 2019 16:46:46 +0000 (09:46 -0700)]
Fix the documentation for BCEWithLogitsLoss (#17218, #16804) (#19212)
Summary:
I fixed a mistake in the explanation of `pos_weight` argument in `BCEWithLogitsLoss` and added an example.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19212
Differential Revision:
D14923431
Pulled By: ezyang
fbshipit-source-id:
15696c67d56789102ac72afbe9bdd7b667eae5a0
crcrpar [Tue, 23 Apr 2019 16:45:42 +0000 (09:45 -0700)]
fix the docstring of `RandomSampler` (#19113)
Summary:
fix
- the order of `Arguments` in `RandomSampler` doc
- the meaningless check of `replacement`'s type.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19113
Differential Revision:
D15013081
Pulled By: ezyang
fbshipit-source-id:
39e367f42841de6814b1214eb9df7b75f14f747e
mruberry [Tue, 23 Apr 2019 16:34:23 +0000 (09:34 -0700)]
Avoid (future) cusparse name collision (#19591)
Summary:
A future version of cusparse will define "cusparseGetErrorString." This PR simply updates PyTorch's name for this function to "getCusparseErrorString" to avoid the collision.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19591
Differential Revision:
D15046871
Pulled By: ezyang
fbshipit-source-id:
821304f75fe84c68a26680a93809a18cfdbd540b
jhultman [Tue, 23 Apr 2019 16:23:06 +0000 (09:23 -0700)]
Add docs and test guaranteeing indices from torch.nonzero ordered C-style (#19539)
Summary:
See #17556.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19539
Differential Revision:
D15030151
Pulled By: ezyang
fbshipit-source-id:
d46ee56a66d89b0113f86e3f8693dc1680d0adb9
Tongzhou Wang [Tue, 23 Apr 2019 16:16:05 +0000 (09:16 -0700)]
Remove unnecessary printing from tests
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/19606
Differential Revision:
D15046583
Pulled By: ezyang
fbshipit-source-id:
ea9bb691d23855e7eddbabe68bf112a726641ba4
Bado Lee [Tue, 23 Apr 2019 15:11:24 +0000 (08:11 -0700)]
Fix lr_scheduler's last_epoch value at the time of initialization (BC BREAKING!) (#7889)
Summary:
Hello everyone :) !!
I've found that lr_scheduler was initialized with last_epoch as -1.
This causes that even after the first step (not the one in init but explicit step of scheduler),
learning rate of scheduler's optimizer remains as the previous.
```python
>>> import torch
>>> cc = torch.nn.Conv2d(10,10,3)
>>> myinitial_lr = 0.1
>>> myoptimizer = torch.optim.Adam(cc.parameters(), lr=myinitial_lr)
>>> mylrdecay = 0.5
>>> myscheduler = torch.optim.lr_scheduler.ExponentialLR(myoptimizer,mylrdecay)
>>> myscheduler.get_lr()
[0.2] # this is because of get_lr calculates lr by 0.1 * 0.5^-1
>>> myscheduler.optimizer.param_groups[0]["lr"]
0.1 # this is not consistent with get_lr value
>>> myscheduler.last_epoch
-1
>>> myscheduler.step()
>>> myscheduler.get_lr()
[0.1] # this should be the value right after the init, not after first step
>>> myscheduler.optimizer.param_groups[0]["lr"]
0.1 # since this is after first step, it should have been decayed as 0.05
>>> myscheduler.last_epoch
0
>>> myscheduler.step()
>>> myscheduler.last_epoch
1
>>> myscheduler.get_lr()
[0.05]
>>> myscheduler.optimizer.param_groups[0]["lr"]
0.05
>>> myscheduler.last_epoch
1
```
First problem is, even after the init of lr_scheduler, you get the inconsistent parameter values.
The second problem is, you are stuck with same learning rate in the first 2 epochs if the step function of lr_scheduler is not called in the beginning of the epoch loop.
Of course, you can avoid this by calling lr_scheduler's step in the beginning,
but I don't think this is proper use since, incase of optimizer, step is called in the end of the iteration loop.
I've simply avoided all above issues by setting last_epoch as 0 after the initialization.
This also makes sense when you init with some value of last_epoch which is not -1.
For example, if you want to init with last epoch 10,
lr should not be set with decayed 1 step further. Which is
last_epoch gets +1 in the previous code.
base_lr * self.gamma ** self.last_epoch
Instead, it should be set with step 10 exact value.
I hope this fix find it's way with all your help :)
I'm really looking forward & excited to become a contributor for pytorch!
Pytorch Rocks!!
Pull Request resolved: https://github.com/pytorch/pytorch/pull/7889
Differential Revision:
D15012769
Pulled By: ezyang
fbshipit-source-id:
258fc3009ea7b7390a3cf2e8a3682eafb506b08b
SebFar [Tue, 23 Apr 2019 15:10:00 +0000 (08:10 -0700)]
Removes variable which is assigned but not used (#19194)
Summary:
n was set as self.in_channels, but not used within the scope of the function.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19194
Differential Revision:
D14937764
Pulled By: ezyang
fbshipit-source-id:
55cb599109309503fee897f77d798fd454fcc02d
SsnL [Tue, 23 Apr 2019 14:51:31 +0000 (07:51 -0700)]
add torch.cuda.synchronize(device=None) (#19573)
Summary:
fixes https://github.com/pytorch/pytorch/issues/19509
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19573
Differential Revision:
D15045730
Pulled By: ezyang
fbshipit-source-id:
732721b4b360fc4348ca7c87d4cd1386e7651bdd
Stefan Krah [Tue, 23 Apr 2019 14:34:12 +0000 (07:34 -0700)]
Port adaptive_max_pool2d() to ATen (#19409)
Summary:
This is the first part of #18064.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19409
Differential Revision:
D15037390
Pulled By: ezyang
fbshipit-source-id:
16a3feed2fd9cc66033696da224a7d5fb7208534
zhiqiang [Tue, 23 Apr 2019 14:20:32 +0000 (07:20 -0700)]
Fix math formatting of PairwiseDistance and CosineSimilarity docs and fix math formatting of CTC loss docs.
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/19534
Differential Revision:
D15034011
Pulled By: ezyang
fbshipit-source-id:
60b81c970c919508a57c86fb23edc9f64973117c
Michael Suo [Tue, 23 Apr 2019 06:10:18 +0000 (23:10 -0700)]
Revert
D15039713: [pytorch][PR] add torch.tensor requires grad
Differential Revision:
D15039713
Original commit changeset:
47f1931b6fc4
fbshipit-source-id:
fd91ce8ddd6d2f4e0016054dcdc2541dacc0e191
James Reed [Tue, 23 Apr 2019 03:49:21 +0000 (20:49 -0700)]
Bugfix for fusion device check (#19594)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19594
I missed a callsite
Reviewed By: wanchaol
Differential Revision:
D15041457
fbshipit-source-id:
eef76ad51bee06a56d31b4ab64f19250fe2ad8f0
Elias Ellison [Tue, 23 Apr 2019 00:56:51 +0000 (17:56 -0700)]
add torch.tensor requires grad (#19445)
Summary:
Add setting requires_grad = True within torchscript to torch.Tensor
Within constant propagation, we can't insert any constants that require grad.
Also added shape analysis and requires grad analysis to torch.tensor
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19445
Differential Revision:
D15039713
Pulled By: eellison
fbshipit-source-id:
47f1931b6fc4a1137c13d80110cc404465bfdf06
Vitaly Fedyunin [Tue, 23 Apr 2019 00:48:43 +0000 (17:48 -0700)]
Add onnx support for _unique2 operator
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/19582
Reviewed By: ezyang, jamesr66a
Differential Revision:
D15037375
fbshipit-source-id:
6060476925bf02fa07f852054e06d2107f046e38
Lu Fang [Tue, 23 Apr 2019 00:24:57 +0000 (17:24 -0700)]
update of fbcode/onnx to
0e8d2bc5e51455c70ef790b9f65aa632ed9bc8a7 (#19568)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19568
Previous import was
83dd62659fc07d5b7fa93b5d1c1879f93509c7db
Included changes:
- **[
0e8d2bc5](https://github.com/onnx/onnx/commit/
0e8d2bc5)**: [Minor need to be in 1.5]Fix an issue in NMS test data which introduce wrong shape. (#1953) <Hector Li>
- **[
9346dd5d](https://github.com/onnx/onnx/commit/
9346dd5d)**: adding modulus operator (#1874) <Jeff Saremi>
- **[
414dbc73](https://github.com/onnx/onnx/commit/
414dbc73)**: Fix shape inference for slice (#1950) <Hariharan Seshadri>
- **[
6fb0775d](https://github.com/onnx/onnx/commit/
6fb0775d)**: Fix shape inference for ConstantOfShape op (#1951) <Ashwini Khade>
Reviewed By: bddppq, zrphercule, benoitsteiner
Differential Revision:
D15033070
fbshipit-source-id:
f7eb90b142cbdc9bf1600cfd33e5a8df709045fb
James Reed [Mon, 22 Apr 2019 23:54:19 +0000 (16:54 -0700)]
Don't create FusionGroups for known-CPU producer values (#19342)
Summary:
I believe the existing check in FuseGraph was only `false` if PyTorch was built with NO_CUDA=1. Otherwise, we would create fusion groups even if we're on a CPU-only machine running CPU code. This is confusing. Instead I've made it so that the decision to fuse or not is dependent on if the producer Value is a known CPU tensor. If it is, we skip fusion.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19342
Differential Revision:
D15038351
Pulled By: jamesr66a
fbshipit-source-id:
fce9d83929309a7bf14346833f84b996f3e7f6db
Sebastian Messmer [Mon, 22 Apr 2019 23:16:30 +0000 (16:16 -0700)]
Explicitly define supported types (#19516)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19516
Explicitly define types that are supported in kernel inputs and outputs.
Also, this allows us to show much nicer error messages if a user writes kernels with wrong argument types.
Reviewed By: ezyang
Differential Revision:
D15020306
fbshipit-source-id:
55ebec81e075e874777acd59aa29a5578fc19ef7
Mikhail Zolotukhin [Mon, 22 Apr 2019 23:02:40 +0000 (16:02 -0700)]
IRParser: optionally create name->value map of the parsed IR. (#19551)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19551
ghimport-source-id:
e666e3c00786a3b1c747f2dd6e85a48a63bdd69d
Differential Revision:
D15028056
Pulled By: ZolotukhinM
fbshipit-source-id:
37e08d6df1d43513748ecfdd8549738eac7ec24e
Nikolay Korovaiko [Mon, 22 Apr 2019 22:03:48 +0000 (15:03 -0700)]
Profiling : Adding Profile Op to provide storage for profiling lambdas
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/19365
Differential Revision:
D14998968
Pulled By: Krovatkin
fbshipit-source-id:
a7f7d1529cbe4e8b30638c6eb8e2ff68f6e114c3
Xiang Gao [Mon, 22 Apr 2019 19:32:14 +0000 (12:32 -0700)]
Step 5: remove _unique_dim in favor of unique_dim (#18654)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18654
ghimport-source-id:
63c84cedc3335719fca4a085fa19bdc57d2bc88a
Differential Revision:
D15000635
Pulled By: VitalyFedyunin
fbshipit-source-id:
9e8594622a867a79d8e2b6be96579816aa22ae2d
Yinghai Lu [Mon, 22 Apr 2019 19:23:05 +0000 (12:23 -0700)]
Add back option to not adjust output batch size (#19442)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19442
For cases like CV, some of ops like transpose and tile will mangle the batch size so that we don't know how to adjust output batch size. In this case, the current solution is just fix the input batch statically and do not adjust output batch size.
Reviewed By: zrphercule
Differential Revision:
D15007237
fbshipit-source-id:
a21b943a52ee5462d9d7804dfae44360f579f8cf
Michael Antonov [Mon, 22 Apr 2019 19:04:07 +0000 (12:04 -0700)]
Add debug logic to c2_ref_test and its helpers (#19359)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19359
Even with file IO exception handling, some of the sandcastle c2_ref_tests are still failing in length-check assert, as can be seen here:
https://our.intern.facebook.com/intern/test/
844424932589974?ref_report_id=0
This is an attempt to add printing logic to debug what's going on.
Reviewed By: dzhulgakov
Differential Revision:
D14966274
fbshipit-source-id:
adce6d4780d664c5ef59f9341b6133b0d09324cb
Dehua Cheng [Mon, 22 Apr 2019 18:52:12 +0000 (11:52 -0700)]
fix variable shadowing issus (#19567)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19567
fix variable shadowing
Reviewed By: bddppq, wx1988
Differential Revision:
D15032114
fbshipit-source-id:
895ea21f22b87db8c7c8684f54fa186d22f24d10
Elias Ellison [Mon, 22 Apr 2019 17:52:28 +0000 (10:52 -0700)]
Add manual_seed in script (#19510)
Summary:
Add manual_seed to torch script.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19510
Reviewed By: suo, driazati
Differential Revision:
D15018823
Pulled By: eellison
fbshipit-source-id:
d7734a8ad05ba254c0d88abf3fb58c4ce6a4e53b
Lu Fang [Mon, 22 Apr 2019 17:37:15 +0000 (10:37 -0700)]
update of fbcode/onnx to
83dd62659fc07d5b7fa93b5d1c1879f93509c7db (#19454)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19454
Previous import was
ad7313470a9119d7e1afda7edf1d654497ee80ab
Included changes:
- **[
83dd6265](https://github.com/onnx/onnx/commit/
83dd6265)**: Add NonMaxSuppression operator (#1703) <Hector Li>
- **[
31ca5d6f](https://github.com/onnx/onnx/commit/
31ca5d6f)**: add node tests for quantized ops (#1944) <Ashwini Khade>
- **[
e6076c1d](https://github.com/onnx/onnx/commit/
e6076c1d)**: Fix test stat coverage script (#1948) <Raymond Yang>
- **[
ad036405](https://github.com/onnx/onnx/commit/
ad036405)**: Add IsInf to detect infinity values (#1884) <Wei-Sheng Chin>
Reviewed By: benoitsteiner
Differential Revision:
D15010015
fbshipit-source-id:
4b29de21de60f8e6a2db75309809a4e619c92532
Gregory Chanan [Mon, 22 Apr 2019 17:19:17 +0000 (10:19 -0700)]
Get rid of unnecessary matches_jit_signature: True specifications. (#19549)
Summary:
Unstacked version of https://github.com/pytorch/pytorch/pull/19431.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19549
Reviewed By: ezyang
Differential Revision:
D15027965
Pulled By: gchanan
fbshipit-source-id:
a4456326a999d77d6baeb0edbb1bb5db5208a8f8
vishwakftw [Mon, 22 Apr 2019 15:14:49 +0000 (08:14 -0700)]
Rename potri to cholesky_inverse (#19498)
Summary:
Changelog:
- Rename `potri` to `cholesky_inverse` to remain consistent with names of `cholesky` methods (`cholesky`, `cholesky_solve`)
- Fix all callsites
- Rename all tests
- Create a tentative alias for `cholesky_inverse` under the name `potri` and add a deprecation warning to not promote usage
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19498
Differential Revision:
D15029901
Pulled By: ezyang
fbshipit-source-id:
2074286dc93d8744cdc9a45d54644fe57df3a57a
Jiyan Yang [Mon, 22 Apr 2019 06:40:24 +0000 (23:40 -0700)]
Add assertion to make sure init op is always fp16 compatible in fp16 training
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/18498
Reviewed By: kennyhorror
Differential Revision:
D14626755
fbshipit-source-id:
d8a0b3c02920ab3835911a21bf05e8956853fcd7
Roy Li [Mon, 22 Apr 2019 04:12:21 +0000 (21:12 -0700)]
Generate only one Type class per backend (#19295)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19295
ghimport-source-id:
9345110f91f044a449804ddd5116cc9179444a00
Differential Revision:
D14948581
Pulled By: li-roy
fbshipit-source-id:
a317b03d58d621e8df162918038f7543bfb13ba2
Roy Li [Mon, 22 Apr 2019 04:12:21 +0000 (21:12 -0700)]
Make complex its own backend (#19275)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19275
ghimport-source-id:
73fd40b02152aed6f24225a88d7ffde7f700899e
Differential Revision:
D14948582
Pulled By: li-roy
fbshipit-source-id:
a1be6e57057defc74a007c5351c5edb2b9dcaf30
Roy Li [Mon, 22 Apr 2019 04:12:21 +0000 (21:12 -0700)]
Add ScalarType argument to Type::options() (#19270)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19270
ghimport-source-id:
a5ade6131f3260066c5750ea1fa9ed5c998bb791
Differential Revision:
D14938707
Pulled By: li-roy
fbshipit-source-id:
018fb3f01706531a06515d6d861e5683a455a705
Roy Li [Mon, 22 Apr 2019 04:12:21 +0000 (21:12 -0700)]
Generate cases for all ScalarTypes in Type functions that call to TH (#19230)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19230
ghimport-source-id:
81f360f2ebd137b8e7d8e885b85246cc219761aa
Differential Revision:
D14927991
Pulled By: li-roy
fbshipit-source-id:
1b6a57918ecdc9c87858d3e50578edef0b6e7ad5
Mikhail Zolotukhin [Mon, 22 Apr 2019 03:28:15 +0000 (20:28 -0700)]
Fix clang-format. (#19550)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19550
ghimport-source-id:
980d96762426d3e97c26839edbaf107a3fc18b2f
Differential Revision:
D15028055
Pulled By: ZolotukhinM
fbshipit-source-id:
a50a0aaa74d0f1b9249ad79ab80e4b7747c3bffc
Shen Li [Mon, 22 Apr 2019 02:39:54 +0000 (19:39 -0700)]
Fix some typos in jit README
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/19548
Differential Revision:
D15028275
Pulled By: mrshenli
fbshipit-source-id:
84ff635be3b4681962451b4c301271683174d7a8
Gregory Chanan [Sun, 21 Apr 2019 22:52:37 +0000 (15:52 -0700)]
Match JIT signature with triu_indices / tril_indices. (#19484)
Summary:
This just plugs into the existing mechanism to do a direct translation to TensorOptions in the backend, so no codegen changes.
After this lands, all native_functions will match the JIT signature.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19484
Differential Revision:
D15013051
Pulled By: gchanan
fbshipit-source-id:
6818f868d2f765ca3e56e7e6f75fe4f68492466c
Gregory Chanan [Sun, 21 Apr 2019 21:11:14 +0000 (14:11 -0700)]
Make one_hot non-differentiable. (#19524)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19524
ghimport-source-id:
ceda3ad43471242ebbd272a21de11731c7d8bef6
Differential Revision:
D15021417
Pulled By: gchanan
fbshipit-source-id:
65d1f17a32f81f47dba5e58e343d0b7b828e1d51
Gregory Chanan [Sun, 21 Apr 2019 21:11:14 +0000 (14:11 -0700)]
Remove 'BoolTensor', 'IndexTensor' from frontend specifications. (#19523)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19523
ghimport-source-id:
618a15c2d1d9af9f87b46e32f10ff77111c2e3b7
Differential Revision:
D15021420
Pulled By: gchanan
fbshipit-source-id:
048af8da3128de10bdee5827b6fbc169c3ad25a8
Gregory Chanan [Sun, 21 Apr 2019 21:11:14 +0000 (14:11 -0700)]
Have _embedding_bag_dense_backward match JIT signature. (#19522)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19522
ghimport-source-id:
ad645d87396de645a1aff5fd9d9939cb79cf6558
Differential Revision:
D15021419
Pulled By: gchanan
fbshipit-source-id:
bd7017edadb4ec9d43cefddf0aee8c52c5cca6a4
Gregory Chanan [Sun, 21 Apr 2019 21:11:14 +0000 (14:11 -0700)]
Have embedding_dense_backward match JIT signature. (#19521)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19521
ghimport-source-id:
817d3defb5f4ee98bae1f0488f99cb0e9a5226a2
Differential Revision:
D15021376
Pulled By: gchanan
fbshipit-source-id:
2e29f1d3913f94fab3347dc48676303510d7da46
Gu, Jinghui [Sun, 21 Apr 2019 20:59:26 +0000 (13:59 -0700)]
Update mkldnn-bridge to fix crash issue in DNNLOWP dequantize op (#19159)
Summary:
Remove an useless format checker in mkldnn-bridge to fix the crash issue in DNNLOWP dequantize op.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19159
Differential Revision:
D15027670
Pulled By: yinghai
fbshipit-source-id:
ac97d6ff94de013105108b9596b1bd7621c5aa75
Gregory Chanan [Sun, 21 Apr 2019 20:43:02 +0000 (13:43 -0700)]
Hook up non_differentiability in derivatives.yaml when no autograd function is generated. (#19520)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19520
ghimport-source-id:
a1272aa0b23692fb189974c4daba7b2e4e0dad50
Differential Revision:
D15021380
Pulled By: gchanan
fbshipit-source-id:
ec83efd4bb6d17714c060f13a0527a33a10452db
Gregory Chanan [Sun, 21 Apr 2019 18:03:09 +0000 (11:03 -0700)]
Move non_differentiable_arg_names from autograd functions to differentiability_info. (#19519)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19519
ghimport-source-id:
74e603688b2e4ed33f6c46c7da9d009336140e74
Differential Revision:
D15021378
Pulled By: gchanan
fbshipit-source-id:
e366a914c67a90ba0552b67d0bf5b347edbaf189
Tongzhou Wang [Sun, 21 Apr 2019 04:36:54 +0000 (21:36 -0700)]
Move cuFFT plan cache note outside Best Practices (#19538)
Summary:
I mistakenly put it there.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19538
Differential Revision:
D15026500
Pulled By: soumith
fbshipit-source-id:
0c13499571fdfd789c3bd1c4b58abd870725d422
Michael Suo [Sat, 20 Apr 2019 15:45:22 +0000 (08:45 -0700)]
Revert
D14689639: [pytorch] Allow passing lists as trace inputs.
Differential Revision:
D14689639
Original commit changeset:
6dcec8a64319
fbshipit-source-id:
03a5e7c80e7f2420e33b056b5844a78d7fd41141
Gu, Jinghui [Sat, 20 Apr 2019 09:09:15 +0000 (02:09 -0700)]
Improve optimizations for DNNLOWP support on MKL-DNN (#18843)
Summary:
In this PR, the fusion alogrithms are improved to support DNNLOWP.
1. Enabled conv fusions for DNNLOWP
2. Fused order switch op into following quantize op
3. Improve conv+sum fusion to parse larger scope/window
4. re-org fusion code to fix random crash issue due to changing graph
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18843
Differential Revision:
D15021030
Pulled By: yinghai
fbshipit-source-id:
88d2199d9fc69f392de9bfbe1f291e0ebf78ab08
Nishant Pandit [Sat, 20 Apr 2019 04:39:00 +0000 (21:39 -0700)]
Make Observer class as template Quant class for QuantConfig (#19418)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19418
This change makes Observer class template which always
takes an observer function as argument. Second test-case becomes redundant, hence removing
it.
Reviewed By: jerryzh168
Differential Revision:
D15000594
fbshipit-source-id:
9555fe98a5f2054b8fd01e64e9ac2db72c043bfa
Sam Leeman-Munk [Sat, 20 Apr 2019 04:35:35 +0000 (21:35 -0700)]
Support compilation on gcc-7.4.0 (#19470)
Summary:
There are two corrections in this pull request.
The first is specific to gcc-7.4.0.
compiled with -std=c++14 gcc-7.4.0 has __cplusplus = 201402L
This does not meet the check set in Deprecated.h, which asks for >201402L.
The compiler goes down to the __GNUC__ check, which passes and sets C10_DEPRECATED_MESSAGE to a value that c++14 does not appear to support or even recognize, leading to a compile time error.
My recommended solution, which worked for my case, was to change the = into a >=
The second correction comes in response to this error:
caffe2/operators/crash_op.cc: In member function ‘virtual bool caffe2::CrashOp::RunOnDevice()’:
caffe2/operators/crash_op.cc:14:11: error: ‘SIGABRT’ was not declared in this scope
I am merely committing to the repository the solution suggested here (which worked for me)
https://discuss.pytorch.org/t/building-pytorch-from-source-in-conda-fails-in-pytorch-caffe2-operators-crash-op-cc/42859
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19470
Differential Revision:
D15019529
Pulled By: ailzhang
fbshipit-source-id:
9ce9d713c860ee5fd4266e5c2a7f336a97d7a90d
James Reed [Sat, 20 Apr 2019 02:13:10 +0000 (19:13 -0700)]
Improve embedding_bag add kernel (#19329)
Summary:
This was actually getting pretty poor throughput with respect to memory bandwidth. I used this test to measure the memory bandwidth specifically for the AXPY call: https://gist.github.com/jamesr66a/
b27ff9ecbe036eed5ec310c0a3cc53c5
And I got ~8 GB/s before this change, but ~14 GB/s after this change.
This seems to speed up the operator overall by around 1.3x (benchmark: https://gist.github.com/jamesr66a/
c533817c334d0be432720ef5e54a4166):
== Before ==
time_per_iter 0.
0001298875093460083
GB/s 3.
082544287868467
== After ==
time_per_iter 0.
00010104801654815674
GB/s 3.
9623142905451076
The large difference between the local BW increase and the full-op BW increase likely indicates significant time is being spent elsewhere in the op, so I will investigate that.
EDIT: I updated this PR to include a call into caffe2/perfkernels. This is the progression:
before
time_per_iter 8.
983819484710693e-05
GB/s 4.
456723564864611
After no axpy
time_per_iter 7.
19951868057251e-05
GB/s 5.
56126065872172
AFter perfkernels
time_per_iter 5.
6699180603027346e-05
GB/s 7.
061548257694262
After perfkernels no grad
time_per_iter 4.
388842582702637e-05
GB/s 9.
122769670026413
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19329
Reviewed By: dzhulgakov
Differential Revision:
D14969630
Pulled By: jamesr66a
fbshipit-source-id:
42d1015772c87bedd119e33c0aa2c8105160a738
Pieter Noordhuis [Sat, 20 Apr 2019 00:20:37 +0000 (17:20 -0700)]
Make finding unused model parameters optional (#19515)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19515
This is still done by default, but can now be disabled by specifying
`find_unused_parameters=False`. There are use cases where finding
unused parameters results in erroneous behavior, because a subset of
model parameters is used *outside* the `forward` function. One can
argue that doing this is not a good idea, but we should not break
existing use cases without an escape hatch. This configuration
parameter is that escape hatch.
Reviewed By: bddppq
Differential Revision:
D15016381
fbshipit-source-id:
f2f86b60771b3801ab52776e62b5fd6748ddeed0
Sebastian Messmer [Fri, 19 Apr 2019 23:59:50 +0000 (16:59 -0700)]
Disallow std::vector arguments (#19511)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19511
In the c10 operator registration API, disallow std::vector arguments and show a nice error message
pointing users towards using ArrayRef instead.
Reviewed By: ezyang
Differential Revision:
D15017423
fbshipit-source-id:
157ecc1298bbc598d2e310a16041edf195aaeff5