Commit Graph

431 Commits

Author SHA1 Message Date
ad6799537e Support stateful dataset (#15096)
Summary:
Currently re-implements the dataloader for stateful datasets. Outstanding work:
- Refactor DataLoader and DataLoader2 to have common base classes and only differ in specifi pieces of logic,
- Figure out how to not duplicate the `MapDataset` logic for stateful vs. non-stateful
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15096

Differential Revision: D13522043

Pulled By: goldsborough

fbshipit-source-id: 08e461ca51783047f11facc4d27dfa2e4f1e4c2a
2018-12-24 06:26:40 -08:00
d71fac20eb Refactor hotpatch_vars and apply it to libtorch (#14976)
Summary:
Fixes #14801.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14976

Differential Revision: D13485381

Pulled By: soumith

fbshipit-source-id: 0af3c2e1b90988d56f6f85632328d1e4b788ffd2
2018-12-16 21:53:31 -08:00
bdfff2f8c2 Add missing caffe2_hip extension in setup.py
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/15189

Reviewed By: orionr

Differential Revision: D13457644

Pulled By: bddppq

fbshipit-source-id: c2363e9b8fd21709b62777e5b2199f01ec1c65f8
2018-12-13 15:59:51 -08:00
92314c83fa re-enable copy of python files, but be careful that the copy is only … (#14982)
Summary:
…done once

This allow no-op build to work correctly even when BUILD_CAFFE2_OPS is on.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14982

Differential Revision: D13413960

Pulled By: zdevito

fbshipit-source-id: 6e5412a8c375af8a47c76f548cdd31cff15f3853
2018-12-11 16:54:08 -08:00
687834dcb4 Install cpp tests when built (#15000)
Summary:
This is broken out of https://github.com/pytorch/pytorch/pull/13733/

We want to install cpp tests so they can ultimately be runnable from that location for Caffe2 tests run from PyTorch builds.

cc pjh5 yf225 anderspapitto
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15000

Reviewed By: pjh5

Differential Revision: D13416253

Pulled By: orionr

fbshipit-source-id: 51280be0a22557a742f90c9f303c58c35cbd4a38
2018-12-11 10:07:48 -08:00
5222a1b190 Fixing reading of FBGEMM from env variables
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/15023

Reviewed By: orionr

Differential Revision: D13406778

Pulled By: pjh5

fbshipit-source-id: 2265f01170fb7969cbdf4e44ca6ef183f5d8017d
2018-12-10 18:18:38 -08:00
e747acbebb Respect -q of setup.py (#14972)
Summary:
1. Changes the prints along the 'rebuild' pathway to respect the '-q' flag of setup.py
A clean rebuild now only prints:

    [zdevito@devgpu172.prn2 /data/users/zdevito/pytorch] python setup.py -q rebuild develop
    [0/1] Install the project...
    -- Install configuration: "RelWithDebInfo"
    ninja: no work to do.
    ninja: no work to do.
    ninja: no work to do.
    ninja: no work to do.
    ninja: no work to do.
    ninja: no work to do.

2. Deletes apparently dead calls to `generate_code`. Now that CMake builds these files,
it appears that it is getting called twice and the second version is never used.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14972

Reviewed By: soumith

Differential Revision: D13396330

Pulled By: zdevito

fbshipit-source-id: 83c45143bbc6a6d2c1cfee929291ec059f2b5dc3
2018-12-09 22:47:49 -08:00
a0ee3a279c USE_TENSORRT support and TensorRT 5 compatibility
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/13945

Differential Revision: D13317525

Pulled By: yinghai

fbshipit-source-id: 8630dfec1bbc5aac19539e344e7c38a7fd8b051d
2018-12-07 14:01:11 -08:00
5e307bd1be use "Extension" instead of the unimported "setuptools.Extension" (#14475)
Summary:
use "Extension" instead of the unimported "setuptools.Extension"
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14475

Differential Revision: D13356219

Pulled By: ezyang

fbshipit-source-id: 5a3e7eb73a32d6bf09676efd9eddded5586435cd
2018-12-05 22:18:47 -08:00
aa842fe101 clean up linkage options (#14609)
Summary: minor code cleanup

Differential Revision: D13277803

Pulled By: soumith

fbshipit-source-id: 5ef925fe95037cab540b329054d7070c1ea7031e
2018-11-30 09:36:59 -08:00
fb7e40b7eb nccl fixes (#14195)
Summary:
This has 4 changes

1) propagate USE_SYSTEM_NCCL. Previously it was ignored and cmake always did a FindPackage
2) respect SCCACHE_DISABLE in our caffe2 sccache wrapper for circleci
3) use SCCACHE_DISABLE when building nccl, because it triggers the same bug as when using CCACHE (already tracked in https://github.com/pytorch/pytorch/issues/13362). This was hidden because we weren't respecting USE_SYSTEM_NCCL, and were never building nccl ourselves in CI
4) In one particular CI configuration (caffe2, cuda 8, cudnn 7), force USE_SYSTEM_NCCL=1. Building the bundled nccl triggers a bug in nvlink. I've done some investigation, but this looks like a tricky, preexisting bug, so rather than hold up this diff I'm tracking it separately in https://github.com/pytorch/pytorch/issues/14486
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14195

Differential Revision: D13237502

Pulled By: anderspapitto

fbshipit-source-id: 1100ac1269c7cd39e2e0b3ba12a56a3ce8977c55
2018-11-28 14:43:06 -08:00
50e9c56830 Move Scalar and ScalarType to c10/core
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/14022

Reviewed By: ezyang

Differential Revision: D13015236

fbshipit-source-id: 92aac4e342d85f75a31837b2943fa5b80f0c35c9
2018-11-27 12:59:36 -08:00
788d2e87bd Address jittering issues in python_print (#14064)
Summary:
export - print a method with python_print
import - import a method with import_method

We want to ensure:

    export(g) == export(import(export(g)))

That is after after exporting/importing once, the graph will stay exactly
the same. This is less strict that g == import(export(g)) which would
require us to maintain a lot more information about the structure of the
IR and about the names of debug symbols.

This PR addresses this with the following fixes:
* print out double-precision numbers with high enough precision such
  that they always parse in the same way
* when creating loop-carried dependencies, sort them
  by variable name, ensuring a consistent order
* parse nan correctly
* DCE: remove unused outputs of if statements, and loop-carried dependencies
  in loops that are dead both after the loop and inside the body of the
  loop.
* Do not set uniqueName for variables whose names are _[0-9]+, these
  are probably rare in user code, and we need a way to communicate
  that we do not care about a variable name when re-parsing the graph.
  Otherwise temporary variable names will jitter around.
* Expand the definition of a constant in printing code to None,
  and family.
* Allow re-treeing to work as long as the only thing in its way is a
  constant node. These do not have side effects but are sometimes
  inserted in a different order when tracing compared to how we print them.
* Print all constant nodes out first in the order in which they are used_val
 (or, if they are inlined, ensure they get assigned CONSTANT.cX number
  in a consistent order). Cleanup tuples (this is done in the compiler,
  but not in the tracer, leading to some tuple indexing jitter if not
  done).
* use strtod_l, not std::stod which can throw exceptions

Other:
* Add REL_WITH_DEB_INFO to setup.py. It already existed for the
  cmake files. Threading it into setup.py allows us to turn on
  debug symbols with optimization everywhere.
* enable round trip testing for all generated graphs. This only adds
  ~6 seconds to total build time but tests printing for every graph.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14064

Differential Revision: D13094637

Pulled By: zdevito

fbshipit-source-id: 0a1c6912194d965f15d6b0c6cf838ccc551f161d
2018-11-21 06:38:29 -08:00
48099c23b4 Move AT_CUDA_CHECK to c10
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/13910

Reviewed By: smessmer

Differential Revision: D13046201

fbshipit-source-id: 8d360a0e4d6c2edf070d130e600c6b04f0ee0058
2018-11-19 08:20:10 -08:00
2983998bb3 add torch-python target (#12742)
Summary:
This is the next minimal step towards moving _C into cmake. For now,
leave _C in setup.py, but reduce it to an empty stub file. All of its
sources are now part of the new torch-python cmake target.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12742

Reviewed By: soumith

Differential Revision: D13089691

Pulled By: anderspapitto

fbshipit-source-id: 1c746fda33cfebb26e02a7f0781fefa8b0d86385
2018-11-16 11:43:48 -08:00
fbabe5bf62 Rename c10::detail to c10::impl (#13838)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13838

According to Sebastian, the detail convention is specifically for header-private
functionality.  That's not what c10/detail is; it's general, library private headers
which may be used in multiple places within PyTorch.  Rename it to impl to avoid
the confusion in nomenclature.

Reviewed By: smessmer

Differential Revision: D13024368

fbshipit-source-id: 050f2632d83a69e3ae53ded88e8f938c5d61f0ef
2018-11-14 07:39:37 -08:00
0bedaf9cf6 Update setup.py to support Nvidia TX2 (#13939)
Summary:
add platform.machine() == 'aarch64' for supporting Nvidia TX2
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13939

Differential Revision: D13055834

Pulled By: soumith

fbshipit-source-id: 0fadc87adf9e6b796978ce743e824eb98b006856
2018-11-13 20:10:35 -08:00
f1a2bc4eae Corrected python lib path on windows to be consistent with Linux (#13848)
Summary:
The python lib path on Windows was set to an incorrect path. This fixes it to be consistent with Linux.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13848

Differential Revision: D13030945

Pulled By: soumith

fbshipit-source-id: 7fb9013ffe66cff98018aea25fdb5cda03cbceb1
2018-11-12 14:39:55 -08:00
53a3c46950 Switch to packaged Thrust on Ubuntu, enable CentOS 7.5 as a CI target (#12899)
Summary:
1) Use the hip-thrust version of Thrust as opposed to the GH master. (ROCm 267)

2) CentOS 7.5 docker (ROCm 279)

* Always install the libraries at docker creation for ubuntu.
* Add Dockerfile for CentOS ROCm
* Enable the centos build
* Source devtoolset in bashrc
* Set locales correctly depending on whether we are on Ubuntu or CentOS
* Install a newer cmake for CentOS
* Checkout thrust as there is no package for CentOS yet.

PyTorch/Caffe2 on ROCm passed tests: https://github.com/ROCmSoftwarePlatform/pytorch/pull/280

For attention: bddppq ezyang

Docker rebuild for Ubuntu not urgent (getting rid of Thrust checkout and package install is mainly cosmetic). If docker for CentOS 7.5 is wanted, build is necessary. Build of PyTorch tested by me in CentOS docker. PyTorch unit tests work mostly, however, a test in test_jit causes a python recursion error that seems to be due to the python2 on CentOS as we haven't ever seen this on Ubuntu - hence please do not enable unit tests.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12899

Differential Revision: D13029424

Pulled By: bddppq

fbshipit-source-id: 1ca8f4337ec6a603f2742fc81046d5b8f8717c76
2018-11-12 14:39:54 -08:00
75bf877534 Preventing error where ninja build files are overwritten when invokin… (#13698)
Summary:
…g clean and build together
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13698

Differential Revision: D13030905

Pulled By: soumith

fbshipit-source-id: 234576ac92e0aa8c2d2409958d3cf85eb29ed1f3
2018-11-12 14:39:48 -08:00
e35418b3be New implementations of DeviceGuard, StreamGuard and MultiStreamGuard (with CUDA specializations) (#13342)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13342

This PR introduces a few new concepts:

- DeviceGuardImplInterface, and implementations for CPU and CUDA, which
  provide a generic interface for interfacing with device and stream state,
  without requiring a direct dependency on the code in question.
- InlineDeviceGuard, a general template for generating both specialized
  and dynamically dispatched device guard implementations.  Dynamic
  dispatch is done by specializing it on a VirtualGuardImpl.
- Provide a device-independent DeviceGuard class, which can be used even
  from CPU code. It uses the aforementioned dynamic dispatch.
- CUDA-specialized CUDAGuard class, which doesn't have a dynamic dispatch
  but can only be used from CUDA.
- StreamGuard, which is the same as above, but for streams rather than
  devices.
- Optional variants of all the aforementioned guards, which are a no-op if
  no device/stream is specified
- CUDAMultiStreamGuard, specifically for the case when we want to set
  a device on every guard.

There are some subtle semantic changes, which have been thoroughly documented
in the class definition.

BC-breaking changes:

- Move constructor/assignment have been removed from all device guard
  implementations.
- In some cases where you previously wrote 'set_device' (or 'set_stream'), you now must write
  'reset_device', because if you switch devices/device types, the stream/device on the
  previous device is unset.  This is different from previous behavior.
- CUDAGuard no longer handles streams, or multiple streams.  Use CUDAStreamGuard
  or CUDAMultiStreamGuard as appropriate for your use case.

Reviewed By: dzhulgakov

Differential Revision: D12849620

fbshipit-source-id: f61956256f0b12be754b3234fcc73c2abc1be04e
2018-11-11 12:11:10 -08:00
a63ef1d605 Suggest git submodule update --init --recursive (#13769)
Summary:
We now have submodules that have submodules
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13769

Reviewed By: soumith

Differential Revision: D13000203

Pulled By: SsnL

fbshipit-source-id: 63c0c19c6c9d25ae3bf255a2421a82ca68278866
2018-11-09 08:41:44 -08:00
a8e303dc46 change USE_MKLDNN default from ON (from #13303) to OFF for ppc64le (#13759)
Summary:
MKLDNN is not supported on ppc64le change USE_MKLDNN to OFF for ppc64le
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13759

Differential Revision: D12993121

Pulled By: soumith

fbshipit-source-id: 539d5cfcff2c03b59fa71e10b52fac333a64c381
2018-11-08 19:33:39 -08:00
d01cb70497 build with mkl-dnn by default (#13303)
Summary:
build with mkl-dnn by default
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13303

Reviewed By: yinghai

Differential Revision: D12979633

Pulled By: orionr

fbshipit-source-id: 00d23fa27c0d13e82f7e5acb3ebd00ed7ba1d5dc
2018-11-08 11:18:27 -08:00
d4f9dbfa66 Remove catch check
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/13677

Differential Revision: D12961992

Pulled By: goldsborough

fbshipit-source-id: 1f0207704d05ac67ed1ec1502bec617c845d9f79
2018-11-07 12:27:15 -08:00
18de330e86 CMake integration for int8 server operators
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/13558

Reviewed By: Maratyszcza

Differential Revision: D12945460

Pulled By: dskhudia

fbshipit-source-id: 1a91027b305fd6af77eebd9a4fad092a12f54712
2018-11-06 15:45:15 -08:00
a7ee632dff Various Test and build fixes (#13556)
Summary:
- fixes weights-contiguous requirement for THCUNN Convolutions
- Add tests that conv backward pass works for non-contiguous weights
- fix RNN tests / error messages to be consistent and pass
- relax weight grad precision for fp16 for a particular test
- fix regression of CMAKE_PREFIX_PATH not passing through
- add missing skipIfNoLapack annotations where needed

Differential Revision: D12918456

Pulled By: soumith

fbshipit-source-id: 8642d36bffcc6f2957800d6afa1e10bef2a91d05
2018-11-06 07:13:47 -08:00
9e432b593d Include caffe2 proto headers in pytorch package data (#13217)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13217

Caffe2 proto headers are not included in pytorch package data (https://github.com/pytorch/pytorch/blob/master/setup.py#L1180). However, they are required for building custom Caffe2 ops living outside PyTorch/Caffe2 repo (e.g. custom Detectron ops).

Reviewed By: pjh5

Differential Revision: D12815881

fbshipit-source-id: 4d1aaa6a69a2193247586e85e4244fbbdb3e8192
2018-11-03 16:19:39 -07:00
24839aac59 Link libgloo.a after libc10d.a to resolve remaining symbols (#13462)
Summary:
libcaffe2.so depends on libgloo.a for the ops in caffe2/contrib/gloo.
Symbols in libgloo.a that are not used are ignored and don't end up in
libcaffe2.so. libc10d.a depends on the caffe2 target, which in turn
depends on the gloo target, and it expects all libgloo.a symbols to be
part of libcaffe2.so. Symbols from libgloo.a that are not used in
libcaffe2.so remain undefined in libc10d.a.

To fix this, we link to libgloo.a when linking _C.so, such that any
gloo symbols in libc10d.a are resolved when linking _C.so.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13462

Differential Revision: D12892830

Pulled By: pietern

fbshipit-source-id: 7560b3899b62f76081b394498480e513a84cefab
2018-11-01 16:03:33 -07:00
50a8f8531b Updated for for arbitrary command line arg ordering
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/13253

Differential Revision: D12829884

Pulled By: soumith

fbshipit-source-id: 9d8abcdf635e2daffce80ddf1e0e418a1e4c337d
2018-10-29 15:52:03 -07:00
380d2dfb27 absorb nccl (#13150)
Summary:
always build nccl from within the main cmake build, rather than via a separate invocation in build_pytorch_libs.sh. Use the existing caffe2 codepaths
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13150

Differential Revision: D12815674

Pulled By: anderspapitto

fbshipit-source-id: a710b6f242d159b9816911a25ee2c4b8c3f855aa
2018-10-29 12:04:32 -07:00
dbab9b73b6 seperate mkl, mklml, and mkldnn (#12170)
Summary:
1. Remove avx2 support in mkldnn
2. Seperate mkl, mklml, and mkldnn
3. Fix convfusion test case
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12170

Reviewed By: yinghai

Differential Revision: D10207126

Pulled By: orionr

fbshipit-source-id: 1e62eb47943f426a89d57e2d2606439f2b04fd51
2018-10-29 10:52:55 -07:00
e6ce9f303f Check that QNNPACK directory exists in setup.py
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/13174

Differential Revision: D12808599

Pulled By: colesbury

fbshipit-source-id: 2548a024043f32ee570378dfead8880b00608478
2018-10-26 14:37:11 -07:00
5e73b828bd CMake integration for Int8 ops
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/13145

Differential Revision: D10860849

Pulled By: Maratyszcza

fbshipit-source-id: fdbcc23ff9beaeaedfd561176df6cfe87685c1f5
2018-10-25 22:25:10 -07:00
e07e63f0b3 Absorb shm
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/13088

Differential Revision: D10856067

Pulled By: anderspapitto

fbshipit-source-id: cfbf0f6cad3953e1ee1c55482c00a3db9f140594
2018-10-25 13:55:23 -07:00
b883afc928 Absorb c10d into the main cmake build
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/12953

Differential Revision: D10850274

Pulled By: anderspapitto

fbshipit-source-id: 42296e6e49ad8c1845040e031eab95ddbaf58ae4
2018-10-24 22:34:00 -07:00
69906afaee absorb THD into main cmake build (#12775)
Summary:
We want to move _C into the same cmake invocation that builds
libcaffe2 and libtorch. However, _C depends on THD and c10d, which in
turn depend on libcaffe2. That means that we can't move _C into that
cmake file unless we do these two first. This change does so.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12775

Differential Revision: D10457374

Pulled By: anderspapitto

fbshipit-source-id: 2c1aa3b8a418a73d2112e93c7da53a2e70cf7bba
2018-10-24 21:28:37 -07:00
2dacf28b66 link libgloo_cuda.a explictly from setup.py (#12951)
Summary:
rather than pass a list through a text file
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12951

Differential Revision: D10528309

Pulled By: anderspapitto

fbshipit-source-id: d94befcd61b6304815859694b623046f256462df
2018-10-24 13:19:46 -07:00
52beb338ab Add Modules_CUDA_Fix folder to installed folder (#13013)
Summary:
This is used to patch our cmake cuda scripts - should be in the installation script.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13013

Reviewed By: ir413

Differential Revision: D10519104

Pulled By: Yangqing

fbshipit-source-id: 542049224ea41068f32d4c0f6399c7e8b684f764
2018-10-24 10:16:18 -07:00
8f51c513a6 gloo: build once, share between pytorch/caffe2
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/12885

Differential Revision: D10492244

Pulled By: anderspapitto

fbshipit-source-id: 79af1ceb9bb0dab4585a728e64554ff4f38d6c32
2018-10-22 11:06:14 -07:00
a022fd2d6b Implement DataLoader (#11918)
Summary:
This PR implements a DataLoader API for the C++ frontend.

The components present in this API largely match the Python API. It consists of:
- `Dataset`s: Conceptually a function from a set of indices to a batch of examples;
- `Transform`s: A functional transformation of a dataset. A `Map<D, T>` for Dataset `D` and transform `T` is itself a dataset;
- `Sampler`s: Specify a strategy for generating indices for a new batch;
- A `DataLoader`, with the ability to automatically parallelize fetching of samples across multiple worker threads;

Note that collation functions fall naturally out of the `Map<Dataset, Transform>` abstraction.

Things that are missing right now that maybe should be added:
- Memory pinning for CUDA tensors

The API was designed to be generalizable to almost any kind of dataset, transform or sampling strategy, while providing a convenient API out of the box. To achieve this, it is quite heavily templatized on various possible input types.

There are many parts to this PR! Right now, I would like feedback on:
- Your impression of the general usability of the API;
- Your impression of which parts seem too complex or overthought;
- The implementation of the parallelization aspects of the DataLoader. I've followed the Python implementation in some matters, but also differ in others. I think my implementation is a little cleaner and decouples components slightly better than the Python dataloader.

I haven't added too many comments yet, as this is fresh out of the oven. Let me know if anything is unclear from the code itself.

There also aren't any tests yet. I will write a comprehensive test suite once we agree on the API and implementation.

apaszke ezyang The controller you requested could not be found. pietern
Pull Request resolved: https://github.com/pytorch/pytorch/pull/11918

Reviewed By: ezyang

Differential Revision: D9998881

Pulled By: goldsborough

fbshipit-source-id: 22cf357b63692bea42ddb1cc2abc71dae5030aea
2018-10-22 10:22:41 -07:00
0fa69c0276 Remove the protobuf library in pytorch linking list. (#12451)
Summary:
There will be a link error when the caffe2 doesn't use its protobuf under third_party. The pytorch will always link that protobuf. The pytorch doesn't use the protobuf directly. We could remove it from
the list.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12451

Differential Revision: D10262676

Pulled By: ezyang

fbshipit-source-id: c2ff3fdf757fc21ed689e7f663c082064b1a0bca
2018-10-18 18:31:51 -07:00
bbe6ef3864 torch.finfo and torch.iinfo to mimic the numpy equivalent (#12472)
Summary:
This pull request intends to provide the functionality requested in https://github.com/pytorch/pytorch/issues/10742 by adding a new torch.finfo and torch.iinfo API.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12472

Differential Revision: D10250829

Pulled By: benoitsteiner

fbshipit-source-id: eb22ca55d5b0064bef381fa7f1eb75989977df30
2018-10-15 13:43:52 -07:00
713e706618 Move exception to C10 (#12354)
Summary:
There are still a few work to be done:

- Move logging and unify AT_WARN with LOG(ERROR).
- A few header files are still being plumbed through, need cleaning.
- caffe2::EnforceNotMet aliasing is not done yet.
- need to unify the macros. See c10/util/Exception.h

This is mainly a codemod and not causing functional changes. If you find your job failing and trace back to this diff, usually it can be fixed by the following approaches:

(1) add //caffe2/c10:c10 to your dependency (or transitive dependency).
(2) change objects such as at::Error, at::Optional to the c10 namespace.
(3) change functions to the c10 namespace. Especially, caffe2::MakeString is not overridden by the unified c10::str function. Nothing else changes.

Please kindly consider not reverting this diff - it involves multiple rounds of rebasing and the fix is usually simple. Contact jiayq@ or AI Platform Dev for details.

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

Reviewed By: orionr

Differential Revision: D10238910

Pulled By: Yangqing

fbshipit-source-id: 7794d5bf2797ab0ca6ebaccaa2f7ebbd50ff8f32
2018-10-15 13:33:18 -07:00
b57fdf1db5 Properly set cmake python library and include_dirs (#12569)
Summary:
Properly set cmake python_library and include_dirs hints, so that systems with multiple version of python can still find the correct libraries and header files.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12569

Differential Revision: D10359910

Pulled By: soumith

fbshipit-source-id: 2238dcbed7aac8a818c9435e6bba46cda5f81cad
2018-10-12 08:11:21 -07:00
25bd7fe488 Add USE_FFMPEG flag for setup.py and R2Plus1D (#12543)
Summary:
Needed for https://github.com/facebookresearch/R2Plus1D/pull/46
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12543

Differential Revision: D10320147

Pulled By: orionr

fbshipit-source-id: a7dcbf7c0d4b405b9e89b28ef75a0ed1cf2a3e6a
2018-10-10 18:09:48 -07:00
c5d7494ca1 Use open-source NCCL2 in PyTorch (#12359)
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/12359

Reviewed By: orionr, yns88

Differential Revision: D10219665

Pulled By: teng-li

fbshipit-source-id: 134ff47057512ba617b48bf390c1c816fff3f881
2018-10-08 15:39:07 -07:00
f9fb37ca79 Guard Denormals-Are-Zero with runtime CPU check (#12386)
Summary:
Previously, we were only enabling Flush-To-Zero (FTZ) and
Denormals-Are-Zero (DAZ) when compiling with SSE3 enabled. After,
Christian's patch (https://github.com/pytorch/pytorch/pull/12109) we
won't be compiling core files with SSE3 or SSE4 enabled, to better
support older AMD processors.

This moves the FTZ and DAZ code behind a runtime CPU check in
preparation for that change.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12386

Differential Revision: D10222237

Pulled By: colesbury

fbshipit-source-id: 7ffe32561ab965e1e5f9eb6e679602bbf4775538
2018-10-05 14:54:54 -07:00
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
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