Commit Graph

13729 Commits

Author SHA1 Message Date
Gregory Chanan
705d80b51e Remove some Type.tensor usages and remove native_tensor without size. (#12355)
Summary:
This is to move us along the path to removing Type from the public API.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12355

Reviewed By: ezyang

Differential Revision: D10212616

Pulled By: gchanan

fbshipit-source-id: c9cd128d1111ab219cb0b2f3bf5b632502ab97c0
2018-10-05 11:12:07 -07:00
David Riazati
9ebac3d7fe Improve type kind error message (#12344)
Summary:
Address #12326
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12344

Differential Revision: D10210681

Pulled By: driazati

fbshipit-source-id: fcc2e26b79dd2d7d5f9e7ef930e2bf434f2a7e08
2018-10-05 10:57:16 -07:00
Devashish Tyagi
0ebbfc25f3 Add utility function make_tensor (#12288)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12288

Current implementation of Tensor takes an intrusive_ptr as an argument for storing data. But instead of requiring users to explicitly pass an intrusive_ptr we want them to pass args for intrusive ptr directly which are forwarded internally through new helper function called make_tensor

Reviewed By: ezyang

Differential Revision: D10152661

fbshipit-source-id: bfa72de161ace3fd1c4573427abcd1bfbd12e29e
2018-10-05 10:40:28 -07:00
Edward Yang
dd2c487ab0 Enforce invariant that storage_ is always non-null (#12328)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12328

- Delete reset() from Storage, as it makes it easy to accidentally
  create a null storage.
- Immediately reject a storage if it is null when passed in

Reviewed By: dzhulgakov

Differential Revision: D10200448

fbshipit-source-id: 14bfa45f8f59859cc350bd9e20e3ef8692e3991d
2018-10-05 09:43:34 -07:00
Yangqing Jia
7788ec9dd1 Remove dangling cmake check for long typemeta (#12356)
Summary:
TSIA
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12356

Differential Revision: D10212726

Pulled By: Yangqing

fbshipit-source-id: b9c2c778fb496278477ef323ecfefd5d19d1af3c
2018-10-05 09:43:32 -07:00
Edward Yang
1e7050072b Make TensorOptions contain optional fields, optimize struct size (#12103)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12103

This defers lookup of defaults to the site where we read
out of TensorOptions. THIS IS A BC-BREAKING BEHAVIOR CHANGE,
but we expect the bulk of uses of OptionsGuard don't allocate TensorOptions
inside the OptionsGuard region, and then use it outside of the region
(the situation where behavior could change.)

I also optimize the size of TensorOptions by rearranging fields, so that we
always fit in two 64-bit words.

Reviewed By: goldsborough

Differential Revision: D10052523

fbshipit-source-id: f454a15b4dbf8cd17bc902ab7d2016f2f689ed13
2018-10-05 09:24:53 -07:00
ohlr
b3cdaee6db Update README.md of ATen Documentation (#12367)
Summary:
The changes are made to clarify how the parsing between the yaml files and header files of THNN and THCUNN works. As issue #12320 shows it is not that easy to understand the existing code without a hint to the important files.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12367

Differential Revision: D10217459

Pulled By: ezyang

fbshipit-source-id: 9b3e64dea4f156843814840e736dc3230332060c
2018-10-05 08:39:55 -07:00
Bram Wasti
5cb2b2358c Move interned_strings and get build working (#12039)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12039

Refactoring out this diff D9819906

Reviewed By: ezyang

Differential Revision: D10024844

fbshipit-source-id: 75b6c93526dc1490299f8b5e564e029146338178
2018-10-05 00:41:18 -07:00
Roy Li
f494f004b7 Fix unintended casting to long (and fix Half overloads)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/12357

Reviewed By: Yangqing

Differential Revision: D10213037

Pulled By: li-roy

fbshipit-source-id: 98f7f5ee2b51a3fab378faf65482919caf008957
2018-10-05 00:28:00 -07:00
Tongzhou Wang
d4c58216d7 Stop warnings on AT_DECLARE_TENSOR_TYPE(.); (#12348)
Summary:
e.g.,
```
│../aten/src/ATen/core/TensorTypeIdRegistration.h:101:43: warning: extra ‘;’ [-Wpedantic]
│ AT_DECLARE_TENSOR_TYPE(SparseCUDATensorId);
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12348

Differential Revision: D10210072

Pulled By: SsnL

fbshipit-source-id: 90eacc97ef490148c0ac1357cf28f1326a791dfa
2018-10-04 23:16:47 -07:00
Yinghai Lu
d9ba2b6894 Add Pytorch domain specifc ONNX schema for SparseNN ops (#12338)
Summary:
as the tile said
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12338

Differential Revision: D10204691

Pulled By: yinghai

fbshipit-source-id: fe6bb8c715a54372508672fc0651841bbc4b8656
2018-10-04 23:16:45 -07:00
Edward Yang
bd8980e8c0 Enable CUDA 10 in CI. (#12343)
Summary:
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12343

Differential Revision: D10215274

Pulled By: ezyang

fbshipit-source-id: ab14e0cadd4100d7cfc3c7e924dd92742da3c29e
2018-10-04 23:16:42 -07:00
Edward Yang
6544cd4590 Revert D10205876: Fix unintended casting to long
Differential Revision:
D10205876

Original commit changeset: b0678b019b19

fbshipit-source-id: ebd3acc017fd10cf293e1de281ea294da86747be
2018-10-04 21:10:52 -07:00
Dong Shi
8e5ac43b4e Fix unintended casting to long
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/12341

Reviewed By: ezyang

Differential Revision: D10205876

fbshipit-source-id: b0678b019b196ac9ee52969f80819ee9ee442bf2
2018-10-04 17:41:40 -07:00
David Reiss
16e21e14e3 Fix Caffe2 build on 64-bit Android (#12340)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12340

`long` and `int64_t` are the same type on 64-bit Android.

Reviewed By: Yangqing

Differential Revision: D10204892

fbshipit-source-id: 2d5bf707bf87b99fc597c9292b59f032e9004620
2018-10-04 15:14:53 -07:00
David Riazati
f0b73ff790 Pretty printer improvements (#12179)
Summary:
* Replaces `prim::PythonOp` with the name of the function being called
* Delays printing values used in `prim::Return` nodes until the return
node itself if that is the only place the value is used to remove some
useless assigns

zdevito apaszke ezyang
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12179

Differential Revision: D10132661

Pulled By: driazati

fbshipit-source-id: cbc4ac34137ed5872049082e25d19eb1ebc71208
2018-10-04 15:14:51 -07:00
Orion Reblitz-Richardson
895994a7c3 Back out "[pytorch][PR] [Build] Use open-source NCCL2 in PyTorch"
Reviewed By: The controller you requested could not be found.

fbshipit-source-id: a13075339d3a7b970e81be0b1a32a7c4c3a6c68d
2018-10-04 14:12:04 -07:00
iotamudelta
a98489747d Enable sparse functionality and tests (#12323)
Summary:
* Enable sparse functions for ROCm

* Reenable test_sparse unit tests that are now passing in ROCm

ezyang bddppq
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12323

Differential Revision: D10203540

Pulled By: bddppq

fbshipit-source-id: 33ffcfbda32875676c27b33ad1e7cd96fbadc790
2018-10-04 13:43:12 -07:00
vishwakftw
39bd73ae51 Guard NumPy usage using USE_NUMPY (#11798)
Summary:
All usages of the `ndarray` construct have now been guarded with `USE_NUMPY`. This eliminates the requirement of NumPy while building PyTorch from source.

Fixes #11757

Reviewed By: Yangqing

Differential Revision: D10031862

Pulled By: SsnL

fbshipit-source-id: 32d84fd770a7714d544e2ca1895a3d7c75b3d712
2018-10-04 12:11:02 -07:00
Gu, Jinghui
c064f8a89d Fix build error mkldnn due to corruptted CMAKE_REQUIRED_LIBRARIES (#12195)
Summary:
This is to fix cmake-time compilation error.

 When we change script to build Caffe2 with mkldnn, we run into some cmake-time compilation support check (like in libsleef) failed due to incorrect setting of CMAKE_REQUIRED_LIBRARIES.  It is a global setting which can interfere camke compilation if it is not clean up properly.  FindBLAS.cmake and FindLAPACK.cmake didn't clean this flag, and causes incorrect building of libsleef.so.

yinghai gujinghui
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12195

Differential Revision: D10159314

Pulled By: yinghai

fbshipit-source-id: 04908738f7d005579605b9c2a58d54f035d3baf4
2018-10-04 11:56:06 -07:00
Teng Li
ae7a7fb398 Use open-source NCCL2 in PyTorch (#12312)
Summary:
- Removed the old nccl file
- Make open-source NCCL a submodule
- CMake to make NCCL itself

NCCL2 now is in the default build.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12312

Differential Revision: D10190845

Pulled By: teng-li

fbshipit-source-id: 08d42253b774149a66919d194f88b34628c39bae
2018-10-04 11:42:17 -07:00
Yangqing Jia
6b79e16d6d revert test/expect files (#12332)
Summary:
Linter added newline to the expect files in #12144 . This reverts it.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12332

Reviewed By: SsnL

Differential Revision: D10201790

Pulled By: Yangqing

fbshipit-source-id: 29f87c013c3522675a765a81a92520fbaea10057
2018-10-04 11:12:57 -07:00
Yangqing Jia
83de6f0dac hip minor fix for c10 (#12329)
Summary:
TSIA
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12329

Differential Revision: D10201437

Pulled By: Yangqing

fbshipit-source-id: 4e62f5870ad269d7a4f936393d2b3e646d0a6b2c
2018-10-04 11:12:54 -07:00
Peter Goldsborough
bcb62cb525 Lazily create tensors in optim_baseline (#12301)
Summary:
Tensors cannot be created globally because of static initialization order issues. So tensors for the optim_baseline test must be created lazily instead. This is fine because these functions will only be called once (in the respective test).

ezyang
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12301

Differential Revision: D10201008

Pulled By: goldsborough

fbshipit-source-id: 59a041f437354e7c6600e5655b3e2d0647dbde9e
2018-10-04 10:55:53 -07:00
Yangqing Jia
1962646d0f Remove CAFFE2_UNIQUE_LONG_TYPEMETA (#12311)
Summary:
CAFFE2_UNIQUE_LONG_TYPEMETA has been a tricky variable defined only from cmake - this is an experiment to remove it and see what exact compilers need that one set.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12311

Reviewed By: dzhulgakov

Differential Revision: D10187777

Pulled By: Yangqing

fbshipit-source-id: 03e4ede4eafc291e947e0449382bc557cb624b34
2018-10-04 10:12:13 -07:00
Yangqing Jia
38f3d1fc40 move flags to c10 (#12144)
Summary:
still influx.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12144

Reviewed By: smessmer

Differential Revision: D10140176

Pulled By: Yangqing

fbshipit-source-id: 1a313abed022039333e3925d19f8b3ef2d95306c
2018-10-04 02:09:56 -07:00
Johannes M Dieterich
c9f7d7b506 mark unit tests as working, skip failing unit test (#12313)
Summary:
* enabled fp16 tests for test_torch

* enable fp16 tests for test_nn

* enabled multilabelmargin loss for fp16

* removed skip for test_pdist_empty_col

* Enable test_nn tests that pass with compiler fixes etc.

* Enable test_legacy_nn tests that pass with compiler fixes etc.

ezyang bddppq
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12313

Differential Revision: D10189922

Pulled By: bddppq

fbshipit-source-id: a5592817c04b14e355cb062d42ebea406f0c92b6
2018-10-03 23:56:26 -07:00
Bram Wasti
8c64655460 Open source distributed code (#12254)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12254

Move distributed_* code to oss folders

This unblocks adding python bindings

Reviewed By: duc0

Differential Revision: D10141400

fbshipit-source-id: 04d6654b73b6757c4dc4a1ddd9dfa2ce23c8c91d
2018-10-03 21:41:14 -07:00
Qinqing Zheng
15367ba9bc Deserialize offset of TreeCursor only when it is not empty (#11465)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/11465

It happened in one of my testing workflow run that deserialization of dataset_cursor failed. The reason it fails is due to the offset vector is serialized only when it's non-empty, but deserialization always process offset_blob whenever it is called. Though I'm still checking the reason why the offset of dataset_cursor is empty, I think it's good to remove this discrepancy.

Reviewed By: aazzolini, Tianshu-Bao

Differential Revision: D9737636

fbshipit-source-id: bb111933f534b092f29469680ff29e59617655f0
2018-10-03 20:38:59 -07:00
Jongsoo Park
07bb79bd8b Use caffe2::int8::Int8TensorCPU when input type is uint8_t (#12274)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12274

We use caffe2::int8::Int8TensorCPU for quantized tensor with uint8_t element type.

Reviewed By: llyfacebook

Differential Revision: D10156452

fbshipit-source-id: 52cf2bedc9dbb433cd5d03f0b76723f7df6a7361
2018-10-03 19:26:16 -07:00
Jerry Zhang
faab6ea922 Split Allocator (#12105)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12105

Split CUDA/OpenCL/xxx Allocator from xxxStaticContext::New and rewrite it under at::Allocator interface.

Reviewed By: dzhulgakov

Differential Revision: D10001033

fbshipit-source-id: e1ffbc04c18d1dcb1f8d4ef2cbbb321967de5ccc
2018-10-03 19:10:10 -07:00
Jerry Zhang
74dc4460eb New in StaticContext returns at::DataPtr (#12029)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12029

In order to remove New() function in StaticContext(to remove StaticContext) and converge to the Allocator design, we'll first change the return type of New to at::DataPtr.

Reviewed By: ezyang

Differential Revision: D9889990

fbshipit-source-id: 3257c763530b987025f428741bdd2e089d11bad4
2018-10-03 19:10:07 -07:00
Peter Goldsborough
bcc2a0599b Enable clang-tidy in CI (#12213)
Summary:
At long last, we will have clang-tidy enabled in CI. For a while I thought I could clean up the project enough to enable clang-tidy with all checks enabled, but I figure it's smarter to set up the minimal checks and at least have those in CI. We can fix more going forward.

ezyang apaszke
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12213

Differential Revision: D10183069

Pulled By: goldsborough

fbshipit-source-id: 7ecd2d368258f46efe23a2449c0a206d10f3a769
2018-10-03 17:25:06 -07:00
David Riazati
c9f9df002d Properly catch errors in PythonOps (#12243)
Summary:
If a PythonOp throws an error it raises an exception to the interpreter and also releases the GIL which causes [pybind to segfault](https://github.com/potassco/clingo/issues/42)

This fix catches pybind errors while the GIL is still held and throws a `python_error` to re-capture the GIL

Fixes #12118

apaszke
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12243

Differential Revision: D10182787

Pulled By: driazati

fbshipit-source-id: 719d4a7c3294af201e061cf7141bec3ca0fb1f04
2018-10-03 17:25:03 -07:00
Jongsoo Park
557015fd93 wipe cache with writes (#12279)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12279

By some reason if we don't write to the wipe buffer, it doesn't really wipe out everything from caches in x86.
We also need to wipe out cache after initializing input blobs.

Reviewed By: Maratyszcza

Differential Revision: D10161211

fbshipit-source-id: c34414dd8b83947805010d7d57e4134d56de1430
2018-10-03 17:12:23 -07:00
rohithkrn
6b9afc894b pyHipify Fixes (#12292)
Summary:
This PR makes the following changes:
* stores cuda_to_hip mappings in python OrderedDicts
* Replace cudaError with cudaError_t and remove cudaError mapping

bddppq petrex
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12292

Differential Revision: D10184399

Pulled By: bddppq

fbshipit-source-id: b20a4661ba534e4fb12aa738e1ed74dba84f30fc
2018-10-03 17:12:17 -07:00
Wanchao Liang
fe10f3d0c6 Fix up onnxwhile op (#12124)
Summary:
Fix things in onnxwhile op to support nested loops, correctly track loop carried deps. Nested loops should be fully supported together with https://github.com/onnx/onnx/pull/1453
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12124

Differential Revision: D10108817

Pulled By: wanchaol

fbshipit-source-id: 51b948024da857c9962833213ee792f47f054e48
2018-10-03 15:55:58 -07:00
Wanchao Liang
8aa23907e8 Make if block also take control_inputs, preserve SSA (#12224)
Summary:
If block is missing control inputs when do caffe2 net execution, this PR add them back and remove the un-SSA semantics

jamesr66a
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12224

Differential Revision: D10135408

Pulled By: wanchaol

fbshipit-source-id: 746c870bde54ed4ca627167361db1b3f36cd235c
2018-10-03 14:29:01 -07:00
Edward Yang
b548f8320d Reduce size of TensorImpl from 160 bytes to 128 bytes (#12266)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12266

- Put all byte-size fields together (booleans and TensorTypeId),
  so they can be coalesced into a single word.
- Replace std::vector<int64_t> strides with
  std::unique_ptr<int64_t[]>, saving two words.

Reviewed By: dzhulgakov

Differential Revision: D10150834

fbshipit-source-id: f54f38eec34732f3ff7e52e00b1371d7b5b210eb
2018-10-03 14:28:59 -07:00
Lu Fang
2217c0b408 create the onnx_root in local, and link it
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/12294

Reviewed By: BIT-silence

Differential Revision: D10178208

Pulled By: houseroad

fbshipit-source-id: 6105b88ea5f3ce9164961cf13b356d85178c374d
2018-10-03 13:55:56 -07:00
Wanchao Liang
3db9738b30 add torch factory methods (zeros/ones) to onnx symbolic
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/11477

Differential Revision: D9761637

Pulled By: wanchaol

fbshipit-source-id: 401f8d43a831685a444e88509bace94ce5b94e52
2018-10-03 13:55:54 -07:00
Junjie Bai
01d835c9b2 Revert D10128131: [nomnigraph] Add move{Node,Edge,Subgraph} for Graph move-like semantics
Differential Revision:
D10128131

Original commit changeset: b0e17ec2802c

fbshipit-source-id: c4a922c10ce8eddc965447b3cc4b6b01dd26dabb
2018-10-03 13:11:23 -07:00
David Riazati
d1ac1eba3b Add bool type to IR (#11834)
Summary:
This PR adds a bool type to `IValue` and puts it into place.

* changes conds for `prim::If` and `prim::Loop` to use `bool` type
* changes operators that take `bool`s to match their native ops
* fixes ambiguous `aten` ops `aten::std` and `aten::var`
	* fixes tests in `test_jit.py TestJitGenerated`
		```
		'test_std_dim',
		'test_std_dim_1d',
		'test_std_dim_1d_neg0',
		'test_std_dim_neg0',
		'test_var_dim',
		'test_var_dim_1d',
		'test_var_dim_1d_neg0',
		'test_var_dim_neg0'
		```
* adds `prim::BoolToTensor` and `prim::TensorToBool`

apaszke zdevito
Pull Request resolved: https://github.com/pytorch/pytorch/pull/11834

Differential Revision: D9928570

Pulled By: driazati

fbshipit-source-id: 373c53df2f1a8ffa9e33d9a517002fbeef25f3eb
2018-10-03 12:40:03 -07:00
Ashish
c029c839a1 MIOpen 1.5 group conv API integration (#12273)
Summary:
This PR contains changes for:
1. Group convolutions introduced in MIOpen 1.5
2. Checks to initialize MIOpen conv operator descriptors only when needed (inputs or weights changed)

Differential Revision: D10174611

Pulled By: bddppq

fbshipit-source-id: cd3d61fae350c4a5e540ce1a6e08012e0e2689fe
2018-10-03 12:26:58 -07:00
Bram Wasti
a839ec805a Add move{Node,Edge,Subgraph} for Graph move-like semantics
Summary: Adding back import{Node,Edge} as move{Node,Edge} and adding a new function moveSubgraph

Reviewed By: duc0, yyetim

Differential Revision: D10128131

fbshipit-source-id: b0e17ec2802cb211b6455578fdb17dab2a7a425b
2018-10-03 12:26:55 -07:00
Ir1dXD
b911ca9b0d docs: change links to https (#12258)
Summary:
Hi, I think it might be better to use https instead of http in the README.md.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12258

Differential Revision: D10162279

Pulled By: soumith

fbshipit-source-id: 4658aa75175909b4fea6972b437765d8b49c749f
2018-10-03 06:33:09 -07:00
Sven-Hendrik Haase
080266e79c Document CUDAHOSTCXX environment variable (#12265)
Summary:
This variable is already being used so this just serves to document that. I think it's an important variable, too, so it should definitely be documented there somewhere.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12265

Differential Revision: D10162261

Pulled By: soumith

fbshipit-source-id: e0d01e012c2fedea63372de9967a8eaa3745fe94
2018-10-03 06:33:06 -07:00
daquexian
1fb8925efe Fix typo LMBD->LMDB in docs of setup.py (#12282)
Summary:
`setup.py` reads `USE_LMDB` rather than `USE_LMBD`
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12282

Differential Revision: D10162025

Pulled By: soumith

fbshipit-source-id: 6295a777be10509ca49516ad7c10061d26b6f9c9
2018-10-03 06:14:19 -07:00
Fei Sun
c0ed48a57e Add support to the accuracy metric (#12211)
Summary:
The code that reads a blob from input files are broken. Fixing them. Also, add a binary that converts input files to blobs that can be used by Caffe2 directly.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12211

Reviewed By: llyfacebook

Differential Revision: D10121845

Pulled By: sf-wind

fbshipit-source-id: 6e48bb594680bcb3186d8d43276b602041c30d3e
2018-10-03 02:10:51 -07:00
Alexander Mazukabzov
06360c3050 Back out "Deduplicate canonical_axis_index_ with maybe_wrap_dim"
Summary: Original commit changeset: 13c98fff0880

Reviewed By: ezyang

Differential Revision: D10153342

fbshipit-source-id: c74c56e61662e9c747206e812b1da22170cbf742
2018-10-02 16:40:21 -07:00