Commit Graph

26 Commits

Author SHA1 Message Date
5e33085f27 Make it possible for users for select /Zi or /ZI over /Z7 when using MSVC (#18790)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/18701.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18790

Differential Revision: D14748195

Pulled By: ezyang

fbshipit-source-id: e50df1b5ca199a88d7b5ea3ea45d25d23cd31a27
2019-04-03 08:24:52 -07:00
84a9694ed0 Fix windows msbuild bug (#18748)
Summary:
Fix the bug introduced by #18681 where an undefined variable was being used to limit max cpu count when building for Windows without Ninja.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18748

Differential Revision: D14733209

Pulled By: soumith

fbshipit-source-id: 52fc0dd4dde99da75a6956b63f02da2e647eed4f
2019-04-02 14:35:40 -07:00
929258a680 Some fixes for the build script on Windows (#18681)
Summary:
Fixes https://discuss.pytorch.org/t/pytorch-build-from-source-on-windows/40288/13?u=peterjc123.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18681

Differential Revision: D14711039

Pulled By: soumith

fbshipit-source-id: f7e1a94b163064c055670b2925cd4502e7773599
2019-04-01 12:42:51 -07:00
173f224570 Turn on F401: Unused import warning. (#18598)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18598
ghimport-source-id: c74597e5e7437e94a43c163cee0639b20d0d0c6a

Stack from [ghstack](https://github.com/ezyang/ghstack):
* **#18598 Turn on F401: Unused import warning.**

This was requested by someone at Facebook; this lint is turned
on for Facebook by default.  "Sure, why not."

I had to noqa a number of imports in __init__.  Hypothetically
we're supposed to use __all__ in this case, but I was too lazy
to fix it.  Left for future work.

Be careful!  flake8-2 and flake8-3 behave differently with
respect to import resolution for # type: comments.  flake8-3 will
report an import unused; flake8-2 will not.  For now, I just
noqa'd all these sites.

All the changes were done by hand.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

Differential Revision: D14687478

fbshipit-source-id: 30d532381e914091aadfa0d2a5a89404819663e3
2019-03-30 09:01:17 -07:00
2a6cbfaccf Enable 32 bit CPU build on Windows
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/18176

Differential Revision: D14539884

Pulled By: ezyang

fbshipit-source-id: 0e4bd9c1ef1830cd9bcc40df36b87534f61def08
2019-03-20 09:26:50 -07:00
19c13eee39 Correct cmake flags passing (#18217)
Summary:
Fixes #18214.

According to the CMake manual, we should pass the arguments first, and put the directory as the last element. Otherwise, these flags may not be passed correctly.

Reference:
1. https://cmake.org/cmake/help/latest/manual/cmake.1.html#synopsis
2. https://stackoverflow.com/a/27169347
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18217

Differential Revision: D14540588

Pulled By: ezyang

fbshipit-source-id: a027f585dde66c5da7bbbe584fa42c3e56027d59
2019-03-20 09:21:31 -07:00
cd6a6c54c6 do not throw when unicode is seen in pull request info (#18195)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18195
ghimport-source-id: 05102cb115c6bd6d141f51905e20155bcd79a908

Stack from [ghstack](https://github.com/ezyang/ghstack):
* **#18195 [build] do not throw when unicode is seen in pull request info**

Differential Revision: D14529707

fbshipit-source-id: 2f6a31b01b3a9b044fd24be466cc5325b70929ad
2019-03-19 14:45:47 -07:00
4480aa31c2 Automatic update of fbcode/onnx to 96c58ceeacf0f2b73d752e413e4fd78787a12da3 (#17676)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17676

Previous import was e18bb41d255a23daf368ffd62a2645db55db4c72

Included changes:
- **[96c58ce](https://github.com/onnx/onnx/commit/96c58ce)**: Fix shape inference when auto_pad is notset again (#1830) <Li-Wen Chang>
- **[873ddbb](https://github.com/onnx/onnx/commit/873ddbb)**: More extendable Runner (#1809) <Michał Karzyński>

Reviewed By: zrphercule

Differential Revision: D14321241

fbshipit-source-id: 12de9021afc61f5435f1b719cccf7b0f4ad73a84
2019-03-07 11:10:31 -08:00
5106918656 Enable MAX_JOBS for using Ninja on Windows
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/17341

Differential Revision: D14164740

Pulled By: soumith

fbshipit-source-id: 7a1c3db0a7c590f72a777fcd32e1c740bb0c6257
2019-02-21 04:40:17 -08:00
36ddad3bfe Allow PyTorch to be built without NCCL (#17295)
Summary:
With this patch you can use USE_DISTRIBUTED=OFF (possibly in combination with USE_NCCL=OFF (?))

The significance is partly because the NCCL doesn't build with CUDA 8.
This is written under the assumption that NCCL is required for distributed if not, the USE_DISTRIBUTED check in nccl.py should be replaced by a check for the USE_NCCL environment variable.

Fixes: #17274
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17295

Differential Revision: D14155080

Pulled By: ezyang

fbshipit-source-id: 0d133f7c5b4d118849f041bd4d4cbbd7ffc3c7b4
2019-02-20 13:35:16 -08:00
d73e6cb59d Automatic update of fbcode/onnx to 4c091e048ca42682d63ccd3c1811560bc12b732d (#17264)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17264

Previous import was 822d8df0a2a32233c6022f50a158817a0f19bdc7

Included changes:
- **[4c091e0](https://github.com/onnx/onnx/commit/4c091e0)**: Support defined ONNX_ML in parent cmake files (#1821) <Lu Fang>
- **[57372f3](https://github.com/onnx/onnx/commit/57372f3)**: Delete OpsetVersionConverter.md which is a duplicate of VersionConverter.md (#1818) <Prasanth Pulavarthi>
- **[ab1c57e](https://github.com/onnx/onnx/commit/ab1c57e)**: [ONNXIFI]Add extension to be implementable (#1796) <Rui Zhu>
- **[b92eee8](https://github.com/onnx/onnx/commit/b92eee8)**: Revert "Implement Op Annotation's for ONNX (#1648)" (#1812) <Ke Zhang>
- **[61f1e9e](https://github.com/onnx/onnx/commit/61f1e9e)**: Enable ONNX_ML by default (#1810) <Shinichiro Hamaji>
- **[4f064a1](https://github.com/onnx/onnx/commit/4f064a1)**: fix Greater and Less doc (#1811) <Guoliang Hua>
- **[0628582](https://github.com/onnx/onnx/commit/0628582)**: Implement Op Annotation's for ONNX (#1648) <Armen>
- **[ad9d2f7](https://github.com/onnx/onnx/commit/ad9d2f7)**: Versioning doc update for Opset 9 (#1805) <Vinitra Swamy>
- **[e71e3be](https://github.com/onnx/onnx/commit/e71e3be)**: add dilation case for ConvTranspose op (#1797) <Randy>

Reviewed By: yinghai

Differential Revision: D14135024

fbshipit-source-id: 1e4f9dda89abf48994798d080dd5d58207a6e4b6
2019-02-19 14:54:34 -08:00
41dddfd55f Make mkldnn Stream object thread_local and enable mkldnn thread-safe (#17022)
Summary:
This PR fixes following issue: https://github.com/pytorch/pytorch/issues/16828

It is a combination of two things:
1) MKLDNN streams are not thread-safe but are currently shared between different threads. This change makes them thread_local
2) By default MKLDNN primitives can share global memory and can't be invoked from multiple threads. This PR enables the MKLDNN_ENABLE_CONCURRENT_EXEC cmake configuration option that makes them thread-safe.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17022

Differential Revision: D14069052

Pulled By: ezyang

fbshipit-source-id: f8f7fcb86c40f5d751fb35dfccc2f802b6e137c6
2019-02-13 16:04:53 -08:00
7139410b72 Allow USE_NINJA to be toggled by an env variable
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/16665

Differential Revision: D13930021

Pulled By: pjh5

fbshipit-source-id: 4b490f952a56e8561329ab8898be2bf779b46b9d
2019-02-01 15:33:06 -08:00
536f647bae respect MAX_JOBS (#16641)
Summary:
We inadvertently switch the OSX build over to ninja on CI. It then fails to respect MAX_JOBS and hits the same scache deadlock bug, this makes the ninja build respect MAX_JOBS.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16641

Differential Revision: D13910751

Pulled By: zdevito

fbshipit-source-id: 61bec500539519b019b74421a13cd87fc1d86090
2019-01-31 20:55:37 -08:00
13422fca32 Add torch.backends.openmp.is_available(); fix some cmake messages (#16425)
Summary:
1. add `torch.backends.openmp.is_available()`
2. Improve various `cmake` outputs
3. Fix LDFLAGS not respected by `caffe2_pybind11_state_*` targets
4. Fix `MKL` warning message, and QUIET flag.
5. Fix various typos
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16425

Differential Revision: D13903395

Pulled By: soumith

fbshipit-source-id: d15c5d46f53e1ff1c27fca2887b9d23d0bd85b4d
2019-01-31 16:15:46 -08:00
0b29bd82f6 use distutils to discover msvc compiler paths (#16540)
Summary:
This simplifies the process for building on windows, since users no longer have to find and run the vcvarsall.bat file.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16540

Differential Revision: D13893596

Pulled By: zdevito

fbshipit-source-id: 79b7ad55c3251b3f573fd8464931138f8a52dd1d
2019-01-31 13:25:33 -08:00
4b7e70067c Enable USE_NINJA in build_pytorch_libs.py if it is in PATH (#16545)
Summary:
It is required to fix the nightly conda builds.
cc zdevito ezyang soumith
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16545

Differential Revision: D13900610

Pulled By: soumith

fbshipit-source-id: 676f903a082f6f083e07245a1df38175bb82b2f7
2019-01-31 11:57:11 -08:00
fc2d8c6889 Eliminate PYCMD in favor of PYTHON_EXECUTABLE in CMake.
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/16522

Differential Revision: D13867376

Pulled By: resistor

fbshipit-source-id: 6bce68facea83c5161a31fcdfafe08827999eb2b
2019-01-30 17:13:43 -08:00
21193bf123 try to get rid of tmp_install (#16414)
Summary:
Rehash of previous attempts. This tries a different approach where we accept the install as specified in cmake (leaving bin/ include/ and lib/ alone), and then try to adjust the rest of the files to this more standard layout.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16414

Differential Revision: D13863635

Pulled By: zdevito

fbshipit-source-id: 23725f5c64d7509bf3ca8f472dcdcad074de9828
2019-01-29 17:29:40 -08:00
3ab620926f More windows fixes towards the code refactor (#16451)
Summary:
Fixes #16446.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16451

Differential Revision: D13864388

Pulled By: soumith

fbshipit-source-id: 6cb173eafbd3da33c479c56c85aff75e8be4bf35
2019-01-29 13:15:36 -08:00
f204e3e624 Pass WERROR to CMake as an explicit parameter rather than an env var.
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/16465

Differential Revision: D13853949

Pulled By: resistor

fbshipit-source-id: 71ccf90a2824ad21c9f26dd753b186f30435d82a
2019-01-28 20:57:18 -08:00
4eceb7a055 Fix cmake byte version issue in build_pytorch_libs.
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/16457

Differential Revision: D13846408

Pulled By: gchanan

fbshipit-source-id: 26962bc12d7d9fdad71f9dd7526f6d32e6008295
2019-01-28 16:00:28 -08:00
fb17be1368 Clear cmake cache when --cmake (#16426)
Summary:
Also, because sometimes we have `CMakeCache.txt` but cmake errored out so I'm adding the existence of `'build.ninja'` as another criterion of rerunning cmake.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16426

Differential Revision: D13843801

Pulled By: ezyang

fbshipit-source-id: ea1efb201062f23b7608f8d061997d8a8e293445
2019-01-28 13:43:17 -08:00
952a03ccea Fix issues on Windows brought by #16289 (#16412)
Summary:
This one needs to be merged ASAP because the CUDA build for Windows is skipped at this time.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16412

Differential Revision: D13833889

Pulled By: soumith

fbshipit-source-id: 95a401a01fb0f9c1045df0bfd72d8206b8a6f3fd
2019-01-27 15:02:31 -08:00
6944461a76 CI Fix: restore MAX_JOBS variable (#16415)
Summary:
Restores a CI workaround (https://github.com/pytorch/pytorch/pull/7361) that got dropped with build_pytorch_libs.sh.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16415

Differential Revision: D13833092

Pulled By: zdevito

fbshipit-source-id: f78b60cafd8da945790dba28de373b8faf46e9f5
2019-01-27 01:27:50 -08:00
9477a5d9c8 Remove bash from build (#16289)
Summary:
This commit removes the dependency on `build_pytorch_libs.sh` by moving the remaining functionality that is not expressible in cmake into python. Removing the indirection through bash also removes over 300 lines of environment munging code that is incredibly hard to understand because it passes a lot of secret parameters through `os.env`.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16289

Reviewed By: ezyang

Differential Revision: D13821662

Pulled By: zdevito

fbshipit-source-id: d658d26925e3b1169ac1e3d44a159cf8a1f0d9b1
2019-01-25 16:03:53 -08:00