Commit graph

50742 commits

Author SHA1 Message Date
Rob Zinkov
ff75562cff Adding maximize to rprop (#81864)
Added the maximize flag #68052 to rprop optimizer and updates the respective tests.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/81864
Approved by: https://github.com/albanD
2022-08-16 08:19:46 +00:00
Nikita Shulga
a8941aa996 [BE] Better test stats errors (#83484)
When `BUILD_ENVIRONMENT` is not defined, print sensible error message
Which is better than:
```
Could not download https://raw.githubusercontent.com/pytorch/test-infra/generated-stats/stats/test-times.json because: 'BUILD_ENVIRONMENT'
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/83484
Approved by: https://github.com/huydhn, https://github.com/ZainRizvi
2022-08-16 07:51:12 +00:00
Nikita Shulga
03f9c7922e [FuncTorch] Fix compilation with -Werror (#83463)
- Fixed signed-unsigned compares
 - Get rid of unused variables
 - Typecast to `PyCFunction` via `(void*)`
 - `ssize_t` is not a valid type on Win32

Pull Request resolved: https://github.com/pytorch/pytorch/pull/83463
Approved by: https://github.com/zou3519
2022-08-16 07:50:22 +00:00
Rohan Varma
a5f688ad0a Remove unused var from ProcessGroupGloo (#83286)
This variable was not used since the logic was refactored into `getElapsedTime`.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83286
Approved by: https://github.com/mrshenli, https://github.com/H-Huang
2022-08-16 07:20:58 +00:00
PyTorch MergeBot
43a94daca0 Revert "Add a workflow to cache third party dependencies on S3 (#83306)"
This reverts commit 0961dd6e99.

Reverted https://github.com/pytorch/pytorch/pull/83306 on behalf of https://github.com/huydhn due to The fix in https://github.com/pytorch/pytorch/pull/83489 still doesn't work
2022-08-16 02:47:17 +00:00
PyTorch MergeBot
641d75d0ba Revert "S3 third-party deps sync workflow: specify correct secrets (#83489)"
This reverts commit 7ec49810cc.

Reverted https://github.com/pytorch/pytorch/pull/83489 on behalf of https://github.com/huydhn due to It still doesn't work https://github.com/pytorch/pytorch/runs/7849815716
2022-08-16 02:42:25 +00:00
Ivan Zaitsev
7ec49810cc S3 third-party deps sync workflow: specify correct secrets (#83489)
A followup for: #83306

#83306 used wrong S3 secrets: `AWS_S3_UPDATE_***`, that resulted a failure of the newly added job:
<img width="1228" alt="image" src="https://user-images.githubusercontent.com/108101595/184759049-b4900753-5d29-4352-8704-ce56734be750.png">

The correct secrets to access OSSCI buckets have `AWS_OSSCI_S3_***` prefix.

This PR makes the workflow use the correct secrets.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83489
Approved by: https://github.com/huydhn, https://github.com/malfet
2022-08-16 02:16:12 +00:00
Rohan Varma
794ae64174 [FSDP] Pass kwargs to load_state_dict (#83309)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83309
Approved by: https://github.com/awgu
2022-08-16 00:34:58 +00:00
Ivan Zaitsev
0961dd6e99 Add a workflow to cache third party dependencies on S3 (#83306)
For the context, see #75703, pytorch/builder#1096.

Note: depends on the docker image `pytorch/sync_s3_thirdparty_deps` from pytorch/builder#1096

Summary of additions:
* workflow config (based on pytorch/sync_s3_thirdparty_deps GH action)
* S3 mapping config (sync_s3_cache.yml)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/83306
Approved by: https://github.com/huydhn
2022-08-15 23:58:36 +00:00
John Clow
c177a7124c Adding additional debug logging and documentation for shape functions (#77115)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/77115
Approved by: https://github.com/eellison
2022-08-15 23:39:28 +00:00
Horace He
9e1daf7644 skip flaky tests for now (#83482)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83482
Approved by: https://github.com/huydhn
2022-08-15 22:38:37 +00:00
Edward Z. Yang
cb64b558ee Add spaces so example is flake8 compatible (#83420)
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83420
Approved by: https://github.com/jbschlosser
2022-08-15 21:39:57 +00:00
Huy Do
b75a214b36 Fix windows flaky test env var (#83466)
Reland #83426 and #83436

Pull Request resolved: https://github.com/pytorch/pytorch/pull/83466
Approved by: https://github.com/atalman
2022-08-15 21:25:05 +00:00
PyTorch MergeBot
a234774096 Revert "Fix flaky tests env variable length on Windows (#83426)"
This reverts commit beb83d7419.

Reverted https://github.com/pytorch/pytorch/pull/83426 on behalf of https://github.com/huydhn due to This has a bug which breaks internal builds D38714900 and other OSS test. The bug has been fixed by https://github.com/pytorch/pytorch/pull/83436. But we decide that it is safer to revert both, merge them into one PR, then reland the fix
2022-08-15 21:11:26 +00:00
PyTorch MergeBot
6266003d71 Revert "Check if IMPORT_DISABLED_TESTS is set (#83436)"
This reverts commit 1187dedd33.

Reverted https://github.com/pytorch/pytorch/pull/83436 on behalf of https://github.com/huydhn due to The previous change breaks internal builds D38714900 and other OSS tests. The bug has been fixed by this PR. But we decide that it is safer to revert both, merge them into one PR, then reland the fix
2022-08-15 21:07:45 +00:00
Catherine Lee
dffa5d309a shard trunk / linux-bionic-cuda10.2-py3.9-gcc7 / test (default from 2 -> 4 (#83424)
it takes a long time
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83424
Approved by: https://github.com/huydhn
2022-08-15 20:03:09 +00:00
soulitzer
43f950af20 Manually shard slow-gradcheck CI job to prevent timeout (#83354)
Fixes https://github.com/pytorch/pytorch/issues/83335
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83354
Approved by: https://github.com/malfet, https://github.com/albanD
2022-08-15 20:00:42 +00:00
Milad Mohammadi
13e2a0a048 Add getDynamicValue to dynamic_ir (#82188)
Add `getDynamicValue` to `dynamic_ir`. This is a precondition to support https://github.com/pytorch/xla/issues/3759
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82188
Approved by: https://github.com/Krovatkin
2022-08-15 19:48:26 +00:00
Milad Mohammadi
ca4f353451 Updated the build process for PyTorch/XLA CI testing (#82497)
Updated the build process for PyTorch/XLA CI testing
Related issue https://github.com/pytorch/pytorch/issues/82425
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82497
Approved by: https://github.com/wconstab
2022-08-15 19:47:14 +00:00
Richard Zou
60295e3abd [functorch] Delete functorch_lagging_op_db (#83418)
No need to have a lagging op db because there are no more sync issues
between functorch and pytorch. If someone adds a new OpInfo, then we
should explicitly check if we support it or not.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83418
Approved by: https://github.com/samdow
2022-08-15 19:23:03 +00:00
Nikolay Korovaiko
759c37a4f4 make sure arguments are tuples otherwise they won't be hashable (#83342)
make sure arguments are tuples otherwise they won't be hashable if used in autograd.py or any other places that uses dictionaries for that matter
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83342
Approved by: https://github.com/bdhirsh, https://github.com/albanD
2022-08-15 19:12:15 +00:00
Horace He
a65825116a clear cache in-between each test (#83431)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83431
Approved by: https://github.com/ezyang, https://github.com/malfet
2022-08-15 18:49:24 +00:00
Huy Do
1187dedd33 Check if IMPORT_DISABLED_TESTS is set (#83436)
I just realize that some tests, i.e. MAC MPS https://github.com/pytorch/pytorch/runs/7842997537?check_suite_focus=true, doesn't have this IMPORT_DISABLED_TESTS set. Thus, it can be None
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83436
Approved by: https://github.com/clee2000
2022-08-15 18:40:20 +00:00
Edward Z. Yang
2d8f091f6a Move TorchDispatchModeTLS to c10/core (#83370)
I need to access it directly from TensorImpl to route directly
TensorImpl induced operations to modes (upcoming PR).

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83370
Approved by: https://github.com/zou3519
2022-08-15 17:59:57 +00:00
Huy Do
beb83d7419 Fix flaky tests env variable length on Windows (#83426)
We are currently keeping all flaky tests in a single env variable and this breaks Windows CI because the upper limit of a single variable there is only 32767 chars, i.e. https://github.com/pytorch/pytorch/runs/7840599767

Pull Request resolved: https://github.com/pytorch/pytorch/pull/83426
Approved by: https://github.com/janeyx99
2022-08-15 17:18:55 +00:00
Horace He
0306147276 Fix issue with compiling under with_grad (#83395)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83395
Approved by: https://github.com/jansel
2022-08-15 16:08:39 +00:00
Jeff Daily
ff5fe9e622 [ROCm] enable jiterator (#77982)
### Description
Enables jiterator for ROCm builds.  This includes necessary porting when hiprtc and nvrtc behavior differed.  This also ported ROCm versus CUDA differences w.r.t. MAX_DIMS and NUM_THREADS from the non-jiterator code paths into jiterator.

### Testing
CI with ciflow/trunk label to force running ROCm workflows that are currently trunk-only.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/77982
Approved by: https://github.com/ngimel
2022-08-15 16:04:09 +00:00
Mor Tzur
316cb8a06a embedded_interpreter_hip (#83329)
Summary: Adding embedded_interpreter_hip and deps to enable torch::deploy on AMD.

Test Plan: Sandcastle

Reviewed By: zrphercule

Differential Revision: D38546701

Pull Request resolved: https://github.com/pytorch/pytorch/pull/83329
Approved by: https://github.com/jfix71
2022-08-15 15:08:55 +00:00
chengscott
1bf2371365 Rename path on Windows from lib/x64 to lib\x64 (#83417)
Use `os.path.join` to join path
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83417
Approved by: https://github.com/ezyang
2022-08-15 14:47:19 +00:00
kshitij12345
50b1ecc28f [fix] cat : support different dtype tensor with 0-dim like before (#83391)
Fixes: https://github.com/pytorch/pytorch/issues/82457

TODO:
* [x] Add test (new test also passes on PyTorch version 1.11)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83391
Approved by: https://github.com/ezyang
2022-08-15 14:31:57 +00:00
Jesse Cai
d4bd88b64b [Quant][fx] Remove WEIGHT_INDEX_DICT and BIAS_INDEX_DICT (#83263)
Summary:

This change adds in input_type_to_index mappings to the backend patterns for `nn.functional.linear`, `nn.functional.conv1d`, `nn.functional.conv1d`, and `nn.functional.conv3d`.

This let's us remove `WEIGHT_INDEX_DICT` and `BIAS_INDEX_DICT` from `prepare.py`.
Instead we pass around `backend_config` and check wether an arg is weight/bias agains that config

Test Plan:
```
python test/test_quantization.py TestQuantizeFx
python test/test_quantization.py TestQuantizeFxOps
```
Reviewers:
@andrewor14

Subscribers:

Tasks:

Tags: quant, fx

Differential Revision: [D38705516](https://our.internmc.facebook.com/intern/diff/D38705516)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83263
Approved by: https://github.com/andrewor14
2022-08-15 14:23:22 +00:00
chenlai
684a404def Rename flatbuffer_all to flatbuffers_jit (#82826)
flatbuffer_all is a bit confusing. It's actually for full jit. Rename it accordingly. For the follow up changes, will create a target for mobile only.

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

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

Differential Revision: [D38412158](https://our.internmc.facebook.com/intern/diff/D38412158)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82826
Approved by: https://github.com/qihqi
2022-08-14 22:26:15 +00:00
Horace He
fbe8c77427 Implemented basic version of AOTDispatcher that only chooses between autograd or no autograd (#83248)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83248
Approved by: https://github.com/zou3519, https://github.com/ezyang
2022-08-14 17:36:33 +00:00
Horace He
86de9e7291 Added some additional symbolic tracing tests (#82209)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82209
Approved by: https://github.com/ezyang
2022-08-14 00:47:57 +00:00
Louis Feng
37ef61ccee [PyTorch] Profiler execution graph record tensor device (#82895)
Summary: During execution graph replay, we also want to know where the tensor is allocated to properly model the behavior. The device name is now captured inside the tensor tuple.

Test Plan:
buck build mode/dev-nosan caffe2/test:profiler --show-output
buck-out/gen/caffe2/test/profiler#binary.par test_profiler.TestExecutionGraph

Reviewed By: aaronenyeshi

Differential Revision: D38017717

Pull Request resolved: https://github.com/pytorch/pytorch/pull/82895
Approved by: https://github.com/aaronenyeshi
2022-08-13 20:26:52 +00:00
Horace He
016fcca243 format some aotautograd-related files in functorch with black (#83240)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83240
Approved by: https://github.com/ezyang
2022-08-13 14:28:16 +00:00
Nikita Shulga
408fa38f33 [GHF] Validate graphql output (#83366)
If checkrun nodes are not instance of dictionary, skip them

Should prevent  https://github.com/pytorch/pytorch/pull/83215#issuecomment-1213617665 from happening in the future

Pull Request resolved: https://github.com/pytorch/pytorch/pull/83366
Approved by: https://github.com/kit1980
2022-08-13 13:41:30 +00:00
Horace He
f02f304657 Added nll_loss_forward decomposition + some other minor decomps (#83235)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83235
Approved by: https://github.com/ngimel
2022-08-13 10:24:58 +00:00
PyTorch MergeBot
097951a967 [vision hash update] update the pinned vision hash (#83374)
This PR is auto-generated nightly by [this action](https://github.com/pytorch/pytorch/blob/master/.github/workflows/_update-commit-hash.yml).
Update the pinned vision hash.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83374
Approved by: https://github.com/pytorchbot
2022-08-13 10:24:25 +00:00
Mengwei Liu
d0d6b1f222 [torchgen] Generate out variant for functional operator (#81437)
Summary:
Previously we don't generate out variant (both schema and kernel) for an operator with functional variant only. This adds support for that and adds test.

## Changes on `native_function_generation.py`

We are generating out variant for all functional variants if possible. This PR introduces a lot of newly generated out variants and `native_functions.yaml` needs to incorporate the changes by adding `autogen` keywords.

The logic for determining what operators we should generate an out variant for is the following:

1. No existing out variant for this `NativeFunction`
2. Contains an existing in place, mutable or functional variant
3. Contains at least 1 tensor like return(s)

For operators matching the first two conditions but failing the third, I listed them in `FUNCTIONAL_OPS_THAT_CANNOT_GET_AN_OUT_VARIANT`.

## Special handling

The following operators satisfy all 3 criteria above but we chose to not autogen them, with some reasons.
* `mkldnn_adaptive_avg_pool2d`, the generated out variant `mkldnn_adaptive_avg_pool2d.out` is colliding with the `mkldnn_adaptive_avg_pool2d_out` kernel in `adaptive_avg_pool2d.out` operator. I manually created `mkldnn_adaptive_avg_pool2d.out` and renamed `mkldnn_adaptive_avg_pool2d_out` to `mkldnn_adaptive_avg_pool2d_out_stub`.
* `min`, `max` and `mean`. There already exist `min.out`, `max.out` and `mean.out` but they are having different semantics with the functional ones. I manually created `min.unary_out`, `max.unary_out` and `mean.dtype_out` to disambiguate.

## Autograd Changes

We introduced a logic to not match derivatives info in `derivatives.yaml` to out variant, since we are generating `NOT_IMPLEMENTED` kernels for those out variants anyway. The issue we are seeing with the original logic is that it doesn't handle `TensorOption` arguments really well. For example we have these two operators:

* `_to_copy(Tensor self, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, bool non_blocking=False, MemoryFormat? memory_format=None) -> Tensor`
* `_to_copy.out(Tensor self, *, bool non_blocking=False, MemoryFormat? memory_format=None, Tensor(a!) out) -> Tensor(a!)`

If we uses `_to_copy` derivative info, there will be compilation error since `dtype` is missing from `_to_copy.out` signature.
Test Plan: Rely on unit test

Differential Revision: D37832342

Pull Request resolved: https://github.com/pytorch/pytorch/pull/81437
Approved by: https://github.com/iseeyuan, https://github.com/bdhirsh
2022-08-13 05:44:53 +00:00
Sergii Dymchenko
bb1e3d8008 Enable lint for test_module_interface.py (#83359)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83359
Approved by: https://github.com/huydhn
2022-08-13 03:34:00 +00:00
Horace He
c2808571bf Removed trace_factory_functions=False option (#83215)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83215
Approved by: https://github.com/ezyang
2022-08-13 03:06:45 +00:00
Richard Zou
b99f972e07 [functorch] update functorch lagging db (#83346)
I'm planning on removing functorch lagging op db because it doesn't make
sense in the context of being a part of PyTorch. Before that happens,
this PR updates it, and a future PR will delete it.

Test Plan:
- wait for tests
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83346
Approved by: https://github.com/samdow
2022-08-13 01:56:01 +00:00
George Petterson
a7e7fbab82 Add shape functions for conv_transpose2d.input and convolution (#80860)
As @silvasean requested in [this issue](https://github.com/llvm/torch-mlir/pull/917#discussion_r896154545) here is the shape code from Torch-MLIR for conv_transpose2d.input and convolution (updated for the transposed case).
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80860
Approved by: https://github.com/Gamrix
2022-08-13 01:19:59 +00:00
soulitzer
8d81bfc512 Refactor PyFunctionHooks (#83331)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83331
Approved by: https://github.com/albanD
2022-08-13 01:16:09 +00:00
soulitzer
b567742038 Add ability to register prehooks to grad_fn (#83226)
This simply replicates the implementation of PyFunctionPostHooks

Fixes https://github.com/pytorch/pytorch/issues/83120
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83226
Approved by: https://github.com/albanD
2022-08-13 00:05:07 +00:00
Kulin Seth
02cfefb48c [MPS] Fix for matmul errors in test consistency (#83124)
* Handle empty input with non-empty output
* Remove transpose options from mm op

Pull Request resolved: https://github.com/pytorch/pytorch/pull/83124
Approved by: https://github.com/malfet
2022-08-12 23:28:38 +00:00
BowenBao
cb2cb94074 [ONNX] Look at owningBlock instead of graph when recording autograd subgraph (#82852)
Small adjustment to ensure the node always exists. `graph->nodes()` might not contain
the autograd node, if it resides in additional subgraphs.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82852
Approved by: https://github.com/shubhambhokare1, https://github.com/abock, https://github.com/malfet
2022-08-12 23:25:14 +00:00
Horace He
ea51e87b52 Added list clearing codegen to AOTAutograd (hidden behind config.aot_clear_list (#83137)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83137
Approved by: https://github.com/jansel, https://github.com/albanD
2022-08-12 22:52:16 +00:00
Peter Bell
d8d9ecbfd0 Fix building with Werror (#83275)
PR #82146 made `Block` non-copyable by adding a `unique_ptr` member,
and used this hacky work-around to copy it anyway. However, it
fails under -Werror with this message:
```
../c10/cuda/CUDACachingAllocator.cpp:1411:51: error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct c10::cuda::CUDACachingAllocator::{anonymous}::Block’ with no trivial copy-assignment [-Werror=class-memaccess]
 1411 |     std::memcpy(&key, &p.search_key, sizeof(Block));
 ```

Instead, this constructs a new `Block` with all the relevant
properties copied.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83275
Approved by: https://github.com/malfet
2022-08-12 22:36:15 +00:00