Commit Graph

47378 Commits

Author SHA1 Message Date
Linbin Yu
bfaa187fb0 move substitute lib to open source (#79093)
Summary: as title

Test Plan: buck build //xplat/caffe2:generated_aten_config_header

Reviewed By: kit1980

Differential Revision: D36989348

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79093
Approved by: https://github.com/malfet
2022-06-08 23:00:47 +00:00
Elias Ellison
d6ecdf1605 refactor op handling to use register pattern
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78523

Approved by: https://github.com/ezyang
2022-06-08 22:37:50 +00:00
Elias Ellison
fe7a13496e Add CPU Fallback
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78522

Approved by: https://github.com/ezyang
2022-06-08 22:35:13 +00:00
Elias Ellison
290d0979f1 Migrate FakeTensors to always call into FakeTensorMode and have them hold a reference
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78677

Approved by: https://github.com/ezyang
2022-06-08 22:30:34 +00:00
Linbin Yu
430955b3a8 [Test] create shared targets for xplat aten (#78345)
Differential Revision: D36694963

Pull Request resolved: https://github.com/pytorch/pytorch/pull/78345
Approved by: https://github.com/kit1980
2022-06-08 22:20:03 +00:00
Edward Z. Yang
50f2af84da Add embedding_bag meta functions
Signed-off-by: Edward Z. Yang <ezyangfb.com>

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

Approved by: https://github.com/Chillee, https://github.com/Lezcano
2022-06-08 22:03:27 +00:00
Eddie Yan
7710d872fc [DDP] Fix broadcast for channels-last tensors (#79060)
#79043

CC @pritamdamania87 @ptrblck
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79060
Approved by: https://github.com/pritamdamania87
2022-06-08 21:52:58 +00:00
lezcano
a8ea58afee Add randomness case to the autograd notes
I also took this chance to clean a bit the sphinx formatting and
reworded a few minor things.

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

Approved by: https://github.com/soulitzer, https://github.com/albanD
2022-06-08 21:27:03 +00:00
Linbin Yu
7cb4a76844 Add detailed error message for iOS test (#79140)
As title.
Tested locally.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79140
Approved by: https://github.com/kit1980
2022-06-08 21:07:08 +00:00
YifanShenSZ
6ad51c9422 Support indexing of the underlying tensors for nested tensors (#78934)
Fixes #76843

Pull Request resolved: https://github.com/pytorch/pytorch/pull/78934
Approved by: https://github.com/cpuhrsch, https://github.com/jbschlosser
2022-06-08 21:05:04 +00:00
Kshiteej K
e85f3b58ab [fix] composite compliance: margin_ranking_loss, hinge_embedding_loss (#78935)
Ref: #69991

Cause of failure is similar to the one discussed for fixing forward_ad of `nn.functional.linear`: https://github.com/pytorch/pytorch/pull/77950#discussion_r878328822
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78935
Approved by: https://github.com/zou3519
2022-06-08 20:58:35 +00:00
Manuel Candales
abe55562cc [Vulkan] Replace Conv2dOpContext by VulkanOpContext (#78818)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78818

ghstack-source-id: 158143558

Reviewed By: SS-JIA

Differential Revision: D36674287

fbshipit-source-id: e6b5886468ea405d150aeaf117e4072a52e1bab2
2022-06-08 13:36:19 -07:00
Manuel Candales
95806fce8e [Vulkan] Replace TransposeConvolution2dContext by VulkanOpContext (#78817)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78817

ghstack-source-id: 158143557

Reviewed By: SS-JIA

Differential Revision: D36674288

fbshipit-source-id: 92db11edbded078133792d9ed965925148be5743
2022-06-08 13:36:19 -07:00
Manuel Candales
65ecc02a39 [Vulkan] Replace GruOpContext by VulkanOpContext (#78816)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78816

ghstack-source-id: 158143559

Reviewed By: SS-JIA

Differential Revision: D36605274

fbshipit-source-id: e83a1dc0518dac5a576a51e7c2c3d82871904cec
2022-06-08 13:36:19 -07:00
Manuel Candales
96445b907e [Vulkan] Replace LinearOpContext by VulkanOpContext (#78815)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78815

ghstack-source-id: 158143561

Reviewed By: SS-JIA

Differential Revision: D36605273

fbshipit-source-id: 8deb0e6f857117ab3753cf73ca67598315b8651e
2022-06-08 13:36:19 -07:00
PyTorch MergeBot
4b82ef7928 Revert "Port index.Tensor to structured kernels."
This reverts commit cfd84125bd.

Reverted https://github.com/pytorch/pytorch/pull/69607 on behalf of https://github.com/zengk95 due to This is breaking mac trunk tests cfd84125bd
2022-06-08 20:16:10 +00:00
titaiwang
c19cf34f81 Move test/jit/test_onnx_export.py to test/onnx (#78116)
Fixes #75627
merged test/jit/test_onnx_export.py into test/onnx/test_pytorch_onnx_no_runtime.py

Pull Request resolved: https://github.com/pytorch/pytorch/pull/78116
Approved by: https://github.com/garymm, https://github.com/justinchuby, https://github.com/malfet
2022-06-08 19:21:42 +00:00
Wei Wei
79ee0c0dd5 Swap fx2trt_oss to torch_tensorrt (#950) (#79115)
Summary:
X-link: https://github.com/pytorch/benchmark/pull/950

X-link: https://github.com/pytorch/fx2trt/pull/91

Reviewed By: yinghai

Differential Revision: D36958046

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79115
Approved by: https://github.com/yinghai, https://github.com/842974287, https://github.com/malfet
2022-06-08 19:02:43 +00:00
Brian Hirsh
cfd84125bd Port index.Tensor to structured kernels.
Tracking issue: #55070

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

Approved by: https://github.com/bdhirsh
2022-06-08 18:17:52 +00:00
dzdang
b12d951f86 [quant][core][improvement] Added earlier termination and improved error message for calling min and max ops on per channel quantized tensors.
Summary:
Fixes #42598

Max and min operators for quantized tensors only supports per tensor
quantized tensors. Previously, an exception is thrown further down the
stack of involved operator calls. This PR adds an earlier termination
with a clearer  error message.

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

Approved by: https://github.com/vkuzo
2022-06-08 17:49:52 +00:00
shubhambhokare1
d26c575ff5 [ONNX] Enable script tests based on recent exporter changes (#77254)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/77254
Approved by: https://github.com/justinchuby, https://github.com/BowenBao
2022-06-08 17:18:49 +00:00
Li-Huai (Allan) Lin
b45d303dac Add onnx support for torch.lerp (#78891)
Fixes #68384

Pull Request resolved: https://github.com/pytorch/pytorch/pull/78891
Approved by: https://github.com/BowenBao
2022-06-08 17:16:45 +00:00
Tristan Rice
5f7b92024f torch/package: add fix for implicit numpy dependency (#78979)
Summary:
This adds a workaround so that you can call `.numpy()` on models loaded via torch.package. Torch implicitly imports numpy when you make that call and it can't be tracked by normal dependencies since it's from C++.

https://github.com/pytorch/MultiPy/issues/46

Test Plan: CI

Reviewed By: PaliC

Differential Revision: D36915129

Pull Request resolved: https://github.com/pytorch/pytorch/pull/78979
Approved by: https://github.com/PaliC
2022-06-08 17:07:00 +00:00
PyTorch MergeBot
68ef29b4ca Revert "[hot fix] Disable MPS tests as machines are down (#79119)"
This reverts commit f2d67c547f.

Reverted https://github.com/pytorch/pytorch/pull/79119 on behalf of https://github.com/malfet due to Runners are back online
2022-06-08 16:49:25 +00:00
ErjiaGuan
5158a6b41a Foward fix sharding bug for DL (#79124)
This PR solves a bug introduced by #79041

`torch.utils.data.graph_settings.apply_sharding` changes the datapipe in-place and returns `None`

It would resolve the Error in TorchData. See: https://github.com/pytorch/data/actions/runs/2461030312
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79124
Approved by: https://github.com/VitalyFedyunin
2022-06-08 16:16:58 +00:00
dzdang
541b9d2593 [quant][improvement] Added quantized fill test case for quantized cuda tensors
Summary:
`test_qtensor_fill` previously only tested the quantized fill op for CPU
tensors with a comment saying that "copy_" only works for CPU tensors.
quantized CUDA tensors are currently supported, so the test case is
amended to include cuda tensors.

Test Plan:
```
python test/test_quantization.py -k test_qtensor_fill_per_tensor
```

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

Approved by: https://github.com/vkuzo
2022-06-08 15:48:30 +00:00
Shawn Zhong
c1516e0c8d Fix LeakyReLU spelling (#79102)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79102
Approved by: https://github.com/albanD
2022-06-08 15:39:21 +00:00
Vasiliy Kuznetsov
d4aa204f11 ns for fx: further fixes for kwargs-only
Summary:

This is a follow-up to https://github.com/pytorch/pytorch/pull/78181,
apparently that PR did not fix all errors in a Meta model using
the NS shadow APIs.

We do not have an OSS repro, so putting the PR up so we can test in fbcode.

Test plan:

```
python test/test_quantization.py -k FXNumericSuite -f
```

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

Approved by: https://github.com/dzdang
2022-06-08 15:29:48 +00:00
Khushi Agrawal
5b32c34450 [reland][complex32, jiterator] cos, sinh, cosh, tanh (#78718)
Ref: #78458
Follows: #74537 and #74748

cc @kshitij12345 @anjali411 :)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/78718
Approved by: https://github.com/anjali411, https://github.com/kshitij12345
2022-06-08 15:00:41 +00:00
Ivan Yashchuk
ff39e3493a Test torch._refs with aten and nvfuser executors (#78926)
This PR adds testing of references with "aten" and "nvfuser" executors using `torch._prims.executor.make_traced`.

Many tests are skipped even for "aten" executor because of https://github.com/pytorch/pytorch/issues/78923.

I limited the dtypes for the nvfuser executor tests because it's slow due to compilation overhead (it took about 30 mins in total). With `float32` and `int32` types nvfuser tests take 5 minutes.
```
58 passed, 2507 skipped, 28162 deselected, 79 xfailed, 5 warnings in 297.58s (0:04:57)
```
58 tests passed means that 29 references work correctly with nvfuser executor now.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/78926
Approved by: https://github.com/mruberry
2022-06-08 12:45:27 +00:00
Manuel Candales
446d5bae93 [Vulkan] Add generic VulkanOpContext
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78814

Differential Revision: [D36605275](https://our.internmc.facebook.com/intern/diff/D36605275/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D36605275/)!

Approved by: https://github.com/SS-JIA
2022-06-08 12:29:54 +00:00
Jane Xu
f2d67c547f [hot fix] Disable MPS tests as machines are down (#79119)
Trunk CI is suffering and not running these tests as the runner is unavailable. https://hud.pytorch.org/minihud?name_filter=trunk%20/%20macos-12.3-py3.8-arm64-test%20/%20Run%20MPS%20tests

https://github.com/pytorch/pytorch/runs/6789461040?check_suite_focus=true
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79119
Approved by: https://github.com/atalman
2022-06-08 12:01:53 +00:00
Philip Meier
32593ef2dd move MPS compat into common comparison machinery (#77836)
Addresses https://github.com/pytorch/pytorch/issues/77144#issuecomment-1128168082.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/77836
Approved by: https://github.com/albanD
2022-06-08 08:09:18 +00:00
PyTorch MergeBot
496e294e31 Revert "add some instructions for ios test (#79097)"
This reverts commit e1534e3fe7.

Reverted https://github.com/pytorch/pytorch/pull/79097 on behalf of https://github.com/kit1980 due to ios tests failed on both PR and trunk, see e1534e3fe7
2022-06-08 07:39:20 +00:00
qqaatw
e4c3e98a48 Add onnx support for torch.tensor_split (#77437)
Fixes #73454

Pull Request resolved: https://github.com/pytorch/pytorch/pull/77437
Approved by: https://github.com/garymm
2022-06-08 06:06:34 +00:00
Manuel Candales
9a0bb4b646 [Vulkan] Fix bug in GRU op (#78945)
Summary:
All of the current Vulkan API Tests of the GRU op, use the same H_in and H_out sizes (H_in = 384 and H_out = 384). Which means, these tests don't test the behavior when H_in != H_out.

There is indeed a bug: H_in is used at some point to split the weights/biases when it should have been H_out (the hidden_size).

Differential Revision: D36895889

Pull Request resolved: https://github.com/pytorch/pytorch/pull/78945
Approved by: https://github.com/SS-JIA
2022-06-08 05:14:37 +00:00
PyTorch MergeBot
272bdb1442 [mobile] Fix lightweight dispatch OOM error by introducing selective build
This PR introduces selective build to lightweight dispatch CI job. By doing so we can't run the `test_lite_intepreter_runtime` test suite anymore because it requires some other operators.

From now on, if we are adding a new unit test in `test_codegen_unboxing`, we will have to export the operators for the unit test model and add them into `lightweight_dispatch_ops.yaml`. This can be automated by introducing tracing based selective build, but that's for next PR to do.

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

Approved by: https://github.com/kit1980
2022-06-08 04:29:35 +00:00
soulitzer
99ffeff949 [forward ad] Sync conj for between primal and tangent on set forward grad
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78358

Approved by: https://github.com/Lezcano, https://github.com/zou3519
2022-06-08 04:20:17 +00:00
Scott Wolchok
cf3ce329b5 [PyTorch] Avoid initializing storage for empty Optionals
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78947

We don't need to initialize for the non-constexpr case ever, or in the constexpr case after C++20.

Differential Revision: [D36519379](https://our.internmc.facebook.com/intern/diff/D36519379/)

Approved by: https://github.com/ezyang, https://github.com/malfet
2022-06-08 03:56:24 +00:00
Edward Z. Yang
65fd0cdddb Install torchdynamo as part of most CI jobs
Signed-off-by: Edward Z. Yang <ezyangfb.com>

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

Approved by: https://github.com/seemethere, https://github.com/anijain2305
2022-06-08 03:41:26 +00:00
Edward Z. Yang
bbd49bcaec Generalize update-xla-commit-hash and setup torchdynamo hash
The hash isn't used for anything yet.

Signed-off-by: Edward Z. Yang <ezyangfb.com>

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

Approved by: https://github.com/seemethere, https://github.com/anijain2305
2022-06-08 03:41:26 +00:00
Linbin Yu
e1534e3fe7 add some instructions for ios test (#79097)
as title

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79097
Approved by: https://github.com/kit1980
2022-06-08 03:31:50 +00:00
Nikita Shulga
530ee1c383 [GHF] Workaround GH GQL limitation (#79090)
One can not use pagination to fetch more than 250 commits on PR

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79090
Approved by: https://github.com/osalpekar
2022-06-08 02:42:21 +00:00
PyTorch MergeBot
4305f8e9bd Revert "[Profiler] Move python tracing to unified event type (Part 2)"
This reverts commit c2a3c8186c.

Reverted https://github.com/pytorch/pytorch/pull/78164 on behalf of https://github.com/malfet due to Broke cuda-on-cpu tests, see c2a3c8186c
2022-06-08 02:21:16 +00:00
Edward Z. Yang
acecd4acc1 Make torch.library decorators return function
This allows for chaining.

Signed-off-by: Edward Z. Yang <ezyangfb.com>

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

Approved by: https://github.com/Lezcano, https://github.com/Chillee
2022-06-08 01:57:00 +00:00
Edward Z. Yang
41bd5b85fd cdist meta function
Signed-off-by: Edward Z. Yang <ezyangfb.com>

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

Approved by: https://github.com/Lezcano, https://github.com/Chillee
2022-06-08 01:57:00 +00:00
Min Si
8d9e5d0b5f [pytorch] Update Gloo submodule to include rocm fixes (#77207)
Summary: Update gloo submodule commit to include recent rocm-related fixes in gloo.

Test Plan: OSS pytorch CI/CD

Differential Revision: D36298978

Pull Request resolved: https://github.com/pytorch/pytorch/pull/77207
Approved by: https://github.com/kwen2501
2022-06-08 01:49:07 +00:00
PyTorch MergeBot
8ce310b943 Revert "Revert "moved logit to use torch ops instead of refs + added …a couple more decompositions"" (#79082)
cc: @osalpekar
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79082
Approved by: https://github.com/eellison
2022-06-08 01:44:53 +00:00
jjsjann123
9e52ad28c9 [nvfuser_upstream_push] nvfuser code base bump 052422 (#78244)
Syncing nvfuser devel branch to upstream master. https://github.com/csarofeen/pytorch/

A few bigger updates:
1. Initial support of cp.async and cp.async.wait: https://github.com/csarofeen/pytorch/pull/1619
2. Emulate ampere's mma 16816 with Turing's mma 1688, for a unified interface: https://github.com/csarofeen/pytorch/pull/1643
3. Extending the infrastructure to support mma operators on turing and ampere arch: https://github.com/csarofeen/pytorch/pull/1440

Commits that's actually in this PR from the csarofeen branch
```
* dd2325294e236c5082c642819a1103bcfe4561a3 (csarofeen/devel) Fusion Segmenter: Unify single kernel and multi-kernel runtime path (#1710)
* b3d1c3f446355a2d276bac8272e7aa8b5bb6b1f0 Fix missing cooperative launch (#1726)
* dc670a226cbe52be46cecef47001f38bf9a09433 Async gmem copy support on sm80+ (#1619)
* 5e6a8dab5a71aefe0548bbfa15d1a93c556d23fe Add turing mma support and test (#1643)
* d6d6b7d3f10dd91dafa4cdbd5e460bbb38173af4 Fix rFactor when there are indirect root domain(s), and refactor (#1723)
* 7093e39150c6d80e0f9f767d56654714a2e8a927 Mma op integration on ampere (#1440)
* fade8da55e60a118c5595378896d34b862b2fcc3 patch python test for bfloat16 (#1724)
* 8fbd0b18743a72ac10478857c3d2351204375685 Fine-grained kernel profiling (#1720)
* 77c1b4fa633f9e631d267923f4537336fa328939 Adding dry run mode to skip arch dependent checks (#1702)
* 151d95b97bebefc94199bb4a53423ede32b55451 More precise concretization analysis (#1719)
* f4d3630ed54d7069dd377a64be1f91013b285b66 Enable complex python tests (#1667)
* 4ceeee509774cc2ce6c834a4dc1e313f71d94503 Minor bugfix in transform_rfactor.cpp (#1715)
* 3675c70faf218e86d2c78dbd3874b175a3b0a203 Separate root domain and rfactor domain in TransformPrinter (#1716)
* f68b830d5def65dadfe29d4edf52fc703369c84a Fix scheduling with polymorphic broadcast (#1714)
* 4ab5ef7ae2cfd8fffad1e1d882ae7c50631211dc updating_ci_machine (#1718)
* 56585c58b1ff338704cafb0cd6be2b3d536bed5a Merge pull request #1711 from csarofeen/upstream_master_bump_0517
* 174d453d3be0c11a5acb0fff3b3f36e19cfdaf81 Allow using nvFuser on CUDA extension (#1701)
* 18bee67495454b9a79625799776e746bd5e81c4c Validate LOOP concrete IDs have complete IterDomains (#1676)
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78244
Approved by: https://github.com/csarofeen, https://github.com/malfet
2022-06-07 17:30:51 -07:00
Taylor Robie
c2a3c8186c [Profiler] Move python tracing to unified event type (Part 2)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78164

This PR finishes moving over the python tracer to use the unified event type. Things that changed:

1) The hacky after-the-fact splicing of python events in profiler_kineto.cpp is gone and python events now simply fold into the rest. (Yay!!!) This is a major BE win.
2) Added `ExtraFields<EventType::PyCall>` and `ExtraFields<EventType::PyCCall>`
3) The enter events (time + TraceKey) are now handled by RecordQueue for performance.
4) Python tracing now uses TSC for lower overhead.

Simplifications in profiler_python WRT part 1:
1) Rather than ValueCache emitting an intermediate value_t that gets further converted, load methods can now directly emit ExtraFields<...>
2) The complicated replay in profiler_python.cpp is replaced with a much simpler (and safer) pass to just pair start and end times.
3) During post processing we can now use `CallTypeHelper::map` to automatically pull in all events instead of having to loop over each the entries for each type manually. This will make it simpler to add new types of Python event later.

Differential Revision: [D36515869](https://our.internmc.facebook.com/intern/diff/D36515869/)

Approved by: https://github.com/aaronenyeshi
2022-06-07 23:42:00 +00:00