Commit Graph

48004 Commits

Author SHA1 Message Date
Linbin Yu
b62d39eda0 Consolidate all python targets in the tools folder (#80408)
Summary:
All buck targets that points to caffe2/tools folder are now moved to tools/BUCK.
This also eliminates all python library/binary import in pt_defs.bzl, which caused T124308913.

Test Plan: CI

Differential Revision: D37468313

Pull Request resolved: https://github.com/pytorch/pytorch/pull/80408
Approved by: https://github.com/seemethere, https://github.com/malfet
2022-06-29 23:27:47 +00:00
Jagadish Krishnamoorthy
70e86b4562 [test_shape_ops] Increase system memory requirement (#80369)
Increase system memory requirement for TestShapeOpsCUDA.test_flip_large_tensor_cuda

Signed-off-by: Jagadish Krishnamoorthy <jagdish.krishna@gmail.com>

Fixes https://github.com/pytorch/pytorch/issues/80373

Pull Request resolved: https://github.com/pytorch/pytorch/pull/80369
Approved by: https://github.com/soulitzer
2022-06-29 23:11:12 +00:00
Andrew Or
c44317704a [Quant][fx] Add default configs for fixed qparams ops (#80184)
Summary: This commit adds qconfigs with special observers for fixed
qparams ops in get_default_qconfig_mapping and
get_default_qat_qconfig_mapping. For correctness, we also require
users to use these special observers if we detect these fixed
qparams ops in prepare.

Test Plan:
python test/test_quantization.py TestQuantizeFx
python test/test_quantization.py TestQuantizeFxOps

Reviewers: jerryzh168, vkuzo

Subscribers: jerryzh168, vkuzo

Differential Revision: [D37396379](https://our.internmc.facebook.com/intern/diff/D37396379)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80184
Approved by: https://github.com/jerryzh168
2022-06-29 23:07:26 +00:00
Jane Xu
6dc32a93e9 [GHA] Remove new lines from PR_BODY too to appease batch env var copying (#80548)
https://github.com/pytorch/pytorch/pull/80543 doesn't work in preventing batch from interpreting the multiline env vars. We will remove the lines from these env vars instead, since PR_BODY and COMMIT_MESSAGES are both used to determine what disabled tests to not skip.

Test plan is using the following below and making sure tests still pass, which they do.

Summary: previous versions of sparsity utils either allowed for a leading '.' for fqns, or would only allow for that.
Per discussion with ao team about

fqns don't have a leading '.'
fqn of root module is ''
these utilities have been updated to align with these definitions.
module_to_fqn was changed to not generate a leading '.' and output ''
for root module

fqn_to_module was changed to output the root rather than None for
path=''

get_arg_info_from_tensor_fqn had explicit handling for a leading '.'
that was removed. The previous implementation overwrote the tensor_fqn
if it had a leading '.' which resulted in undesirable behavior of
rewriting arguments provided by the user.

Also refactored utils to be simpler and added comments, formatting and
test

Test Plan:
python test/test_ao_sparsity.py
python test/test_ao_sparsity.py TestSparsityUtilFunctions

Reviewers:

Subscribers:

Tasks:

Tags:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80548
Approved by: https://github.com/mehtanirav
2022-06-29 23:06:30 +00:00
Gael Le Lan
cfe8dce814 [Bootcamp] Use Apple's Accelerate framework for blas acceleration (#80449)
Summary: Add Apple Accelerate specific method calls for BLAS acceleration

Differential Revision: D37438092

Pull Request resolved: https://github.com/pytorch/pytorch/pull/80449
Approved by: https://github.com/kimishpatel
2022-06-29 23:05:44 +00:00
Nirav Mehta
4a1309035e [AutoAccept][Codemod][FBSourceBuckFormatLinter] Daily arc lint --take BUCKFORMAT (#80468)
Summary:
Meta:
**If you take no action, this diff will be automatically accepted on 2022-06-28.**
(To remove yourself from auto-accept diffs and just let them all land, add yourself to [this Butterfly rule](https://www.internalfb.com/butterfly/rule/904302247110220))

Produced by `tools/arcanist/lint/codemods/buckformat-fbsource`.

#nocancel

Rules run:
- CodemodTransformerSimpleShell

Config Oncall: [lint](https://our.intern.facebook.com/intern/oncall3/?shortname=lint)
CodemodConfig: [CodemodConfigFBSourceBuckFormatLinter](https://www.internalfb.com/code/www/flib/intern/codemod_service/config/fbsource_arc_f/CodemodConfigFBSourceBuckFormatLinter.php)
ConfigType: php
Sandcastle URL: https://www.internalfb.com/intern/sandcastle/job/9007199961796985/
This diff was automatically created with CodemodService.
To learn more about CodemodService, check out the [CodemodService wiki](https://fburl.com/CodemodService).

_____

## Questions / Comments / Feedback?

**[Click here to give feedback about this diff](https://www.internalfb.com/codemod_service/feedback?sandcastle_job_id=9007199961796985).**

* Returning back to author or abandoning this diff will only cause the diff to be regenerated in the future.
* Do **NOT** post in the CodemodService Feedback group about this specific diff.

drop-conflicts

Test Plan:
Meta:
No commands were run for this Codemod

Reviewed By: strulovich

Differential Revision: D37482777

Pull Request resolved: https://github.com/pytorch/pytorch/pull/80468
Approved by: https://github.com/osalpekar
2022-06-29 23:03:23 +00:00
Andrew Or
17104d3d7f [Quant][fx][bc-breaking] Replace is_reference with convert_to_reference (#80091)
Summary: This PR removes the is_reference flag from the  existing
convert_fx API and replaces it with a new convert_to_reference
function. This separates (1) converting the prepared model to a
reference model from (2) lowering the reference model to a quantized
model, enabling users to call their custom lowering function for
custom backends. For the native fbgemm backend, for example, the
following are equivalent:

```
from torch.ao.quantization.quantize_fx import prepare_fx, convert_fx

prepared = prepare_fx(model, ...)
quantized = convert_fx(prepared, ...)
```

```
from torch.ao.quantization.fx import lower_to_fbgemm
from torch.ao.quantization.quantize_fx import (
    prepare_fx,
    convert_to_reference
)

prepared = prepare_fx(model, ...)
reference = convert_to_reference(prepared, ...)
quantized = lower_to_fbgemm(reference, ...)
```

Note that currently `lower_to_fbgemm` takes in two other arguments
that are difficult for users to provide. A future commit will remove
these arguments to make the helper function more user friendly.

Test Plan:
python test/test_quantization.py TestQuantizeFx
python test/test_quantization.py TestQuantizeFxOps

Reviewers: jerryzh168, vkuzo

Subscribers: jerryzh168, vkuzo

Differential Revision: [D37359946](https://our.internmc.facebook.com/intern/diff/D37359946)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80091
Approved by: https://github.com/jerryzh168
2022-06-29 23:01:27 +00:00
Riley Dulin
d579838eb5 [torch][fx] Add ignore_parameters_and_buffers kwarg to FxGraphDrawer (#79982)
Summary:
Add an `ignore_parameters_and_buffers` parameter which will tell the graph drawer
to leave off adding parameter and buffer nodes in the dot graph.

This is useful for large networks, where we want to view the graph to get an idea of
the topology and the shapes without needing to see every detail. Removing these buffers
de-clutters the graph significantly without detracting much information.

Reviewed By: jfix71

Differential Revision: D37317917

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79982
Approved by: https://github.com/jfix71
2022-06-29 22:48:43 +00:00
Linbin Yu
edf76cd9c2 Move qnnpack to shared BUCK build (#80260)
Differential Revision: D37434340

Pull Request resolved: https://github.com/pytorch/pytorch/pull/80260
Approved by: https://github.com/larryliu0820, https://github.com/malfet
2022-06-29 22:40:37 +00:00
Weiwen Xia
c1fa9fdff9 Add fast path of qmean/qstd for quantized CPU (#70172)
Add fast path of qmean and qstd when computation is done in innermost dimensions for quantized CPU. The fast path supports inputs in contiguous memory format.
For example:
```python
X = torch.randn((2,3,4,5), dtype=torch.float)
qX = torch.quantize_per_tensor(X, scale, zero_point, torch_type)

# dim can be: -1, (-1, -2), (-1, -2, -3), (-1, -2, -3, -4), 3, (3, 2), (3, 2, 1), (3, 2, 1, 0) or None
dim = -1
qY = torch.mean(qX, dim) # qY = torch.std(qX, dim)
```

**Performance test results**
Test Env:
- Intel® Xeon® CLX-8260
- 1 instance, 4 cores
- Using Jemalloc

Test method:
Create 4d contiguous tensors as inputs, set `dim` to the innermost two dimensions `(-1, -2)`, then do the following tests
- Quantize inputs and use the fast path
- Quantize inputs and use the reference path
- Use fp32 kernel (no quantization)

Mean: exec time (us) vs. shape
![image](https://user-images.githubusercontent.com/12522207/148152617-604f2841-cfcd-495c-ae88-c27d9165b46a.png)

Std: exec time (us) vs. shape
![image](https://user-images.githubusercontent.com/12522207/148152632-3a8dceb1-0057-42c9-af65-1e26d697ff0c.png)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/70172
Approved by: https://github.com/malfet
2022-06-29 22:39:52 +00:00
Sherlock Huang
ac5a94789f Refactor lift_subgraph_as_module as a fx.passes.util function (#80292)
lift_subgraph_as_module can be shared between fuser_utils.py and spliter_utils.py
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80292
Approved by: https://github.com/jjsjann123, https://github.com/842974287
2022-06-29 22:35:39 +00:00
Linbin Yu
da61ec2a4a [CI] imporve ios simulator test (#80459)
update fastlane version and parameters to improve test reliability

Pull Request resolved: https://github.com/pytorch/pytorch/pull/80459
Approved by: https://github.com/malfet, https://github.com/seemethere
2022-06-29 21:23:56 +00:00
David Berard
00f651811a Interpreter for decomposing aten -> prims (#79989)
If an aten -> prim decomposition is needed *after* the initial trace
with make_fx, this interpreter can be used to perform the decomposition.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79989
Approved by: https://github.com/SherlockNoMad
2022-06-29 21:16:28 +00:00
Ivan Yashchuk
92e1710dc0 Add ComplexDouble scalar creation bindings to nvFuser's Python API (#80522)
There is a problem that pybind11 silently converts Python's complex scalar to `bool` and uses `define_constant<bool>` overload. It was unnoticed because `0j` corresponds to `False` and tests passed, with `2j` scalar tests for `_refs.where` would fail without proper bindings.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80522
Approved by: https://github.com/ngimel
2022-06-29 21:12:13 +00:00
PyTorch MergeBot
d7847ed23e Add integer support to scatter_reduce (#80324)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80324
Approved by: https://github.com/cpuhrsch
2022-06-29 21:10:26 +00:00
Brian Hirsh
dc7d3fd4bb functionalization: fix _unsafe_view debug asserts (#80526)
Fixes `_unsafe_view` for functionalization - previously, autograd debug-asserts were failing in `test/test_functionalization.py`, but this should fix them (PS: looking forward to when we run a debug-build test in our CI infra)

In a previous PR, I tried to fix `_unsafe_view` by "fixing" its alias annotations in native_functions.yaml to reflect the fact that it's a view, and adding new operators for `_unsafe_view_copy` and `_unsafe_view_copy.out`

That broke some torchscript tests. It also feels too heavy-weight, since the whole point of `_unsafe_view` is that we shouldn't actually have to worry about treating it like a real view: we don't need to worry about having to propagate mutations between the input and the output, because the input is meant to be a temporary tensor that gets thrown away.

So instead, I just wrote a one-off kernel for `_unsafe_view` for functionalization - it does the same thing as the old (boxed fallback) kernel would do, but also correctly aliases the storages together, to appease autograd asserts.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80526
Approved by: https://github.com/ezyang
2022-06-29 20:27:59 +00:00
Vitaly Fedyunin
331c0c1803 [DataLoader] Close open in DataPipe streams on best effort basis (#78952)
Adding ability to:
- Track open StreamWrappers with `StreamWrapper.session_streams`
- Automatically close parent StreamWrapper (ex. torchdata tar is the parent and extracted file streams are children)
- Close streams in discarded by filtering structures

Differential Revision: [D37489935](https://our.internmc.facebook.com/intern/diff/D37489935)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78952
Approved by: https://github.com/ejguan
2022-06-29 20:11:23 +00:00
Peter Bell
2f146f1d39 [jiterator] De-template launch_jitted_reduce_kernel (#80138)
As with `jitted_gpu_kernel_impl`, this
1. Hoists static variables out and into a parent funciton
2. Moves template arguments into the `jit::KernelDescriptor` struct,
   as well as changing `vt0` to just be a runtime argument
3. Changes the types of pass-through arguments to `void*`

On my build I see a 0.5 MB decrease in binary size for `libtorch_cuda.so`.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80138
Approved by: https://github.com/ngimel
2022-06-29 20:03:35 +00:00
Aidyn-A
74fb6ee4c5 [primTorch] support one tensor and two scalars in _prims.where (#80146)
Fixes an issue of supporting two scalar arguments for `where` and other functions with similar set of arguments:

```
refs.where(a, 1, 0)
```

I had to skip `test_python_ref_executor` because the test causes a `Segmentation fault` when running with two scalars.
The issue https://github.com/csarofeen/pytorch/issues/1770 has been fixed https://github.com/csarofeen/pytorch/pull/1774, so we can lift the skip when its merged to the upstream.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80146
Approved by: https://github.com/ngimel
2022-06-29 19:58:31 +00:00
Peter Bell
66f66faccf [jiterator] Reduce templating in jitted_gpu_kernel_impl (#80103)
Previously, a new `jitted_gpu_kernel_impl` was instantiated for every
combination of kernel and data types. This adds a new intermediate,
`jitted_gpu_kernel_generic`, which is only templated on the arity of
the input function. So, the compiler is free to re-use this code
between different kernels. `UnaryOperators.cu` as an example will
only need to compile one version.

This is achieved by:
1. Hoisting static variables out of the `launch_` functions and into
   `JittedKernelVariantCache`, stored in `jitted_gpu_kernel_impl`,
   which is templated on the kernel name and dtypes.
2. Moving arguments describing the kernel's static properties
   (e.g. `name` and `f_inputs_type`) into runtime variables
   which are packaged into a new `jit::KernelDescriptor` struct.
3. changing `extra_args` from a tuple to `c10::ArrayRef<void*>`

We can expect benefits in both binary size and compile times. On my
build, I see an 11 MB reduction in binary size for `libtorch_cuda.so`
and this saving scales linearly with the number of jiterated kernels.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80103
Approved by: https://github.com/ngimel
2022-06-29 19:51:51 +00:00
PyTorch MergeBot
e3599b0344 Revert "Add objective-c language support in CMake (#80432)"
This reverts commit 182870f4a7.

Reverted https://github.com/pytorch/pytorch/pull/80432 on behalf of https://github.com/malfet due to Broke  ios-12-5-1-x86-64-coreml builds, see https://github.com/pytorch/pytorch/runs/7105704349?check_suite_focus=true
2022-06-29 19:41:12 +00:00
Saketh Are
725de4fb94 Increase atol for test_noncontiguous_samples_nn_functional_conv_transpose3d_cuda_float32 (#80518)
This test is currently flaky due to randomly generated inputs sometimes producing results very slightly outside the specified tolerance. For example:

```
Mismatched elements: 1 / 2744 (0.0%)
Greatest absolute difference: 0.0001068115234375 at index (0, 7, 2, 3, 4) (up to 0.0001 allowed)
Greatest relative difference: 3.0445612311553214e-05 at index (0, 7, 2, 3, 4) (up to 1.3e-06 allowed)
```

Fixes #79509

Pull Request resolved: https://github.com/pytorch/pytorch/pull/80518
Approved by: https://github.com/jbschlosser
2022-06-29 18:43:16 +00:00
PyTorch MergeBot
de0150d898 Revert "Extract setting up ec2 linux and checkout to be composite actions (#80462)"
This reverts commit fe8bfef8a6.

Reverted https://github.com/pytorch/pytorch/pull/80462 on behalf of https://github.com/malfet due to Broke binary builds, see fe8bfef8a6
2022-06-29 18:11:08 +00:00
Jane Xu
655fc51f07 [GH1] Relanding #80064 to erase double messaging as it was overwritten by mistake (#80550)
https://github.com/pytorch/pytorch/pull/77943 accidentally overwrote #80064. We can revert that PR and reland it later or we can land this fix PR as it is one line.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80550
Approved by: https://github.com/suo
2022-06-29 17:55:05 +00:00
Zain Rizvi
fe8bfef8a6 Extract setting up ec2 linux and checkout to be composite actions (#80462)
Step 1 to gradually change our generated workflow scripts to be more compatible with reusable workflows.

This PR extracts three pieces of functionality into composite actions:
- Checking out the branch
- Setting up EC2 linux
- Building the linux binary

It also regenerates the workflows to use these new composite actions

This is not a complete list of things we'd like to extract. Keeping this PR small to get early feedback
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80462
Approved by: https://github.com/seemethere
2022-06-29 17:51:51 +00:00
Mikayla Gawarecki
a34301064a Add integer support for gpuAtomicMin/Max/Mul (#80320)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80320
Approved by: https://github.com/cpuhrsch
2022-06-29 17:07:14 +00:00
Justin Chu
d1d2687d34 [ONNX] Fix potentially unbound variables (#79789)
Pylint alerts that some variables may be unbound. This PR fixes the errors.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79789
Approved by: https://github.com/garymm
2022-06-29 17:01:49 +00:00
Michael Suo
35d97f7b03 [ci] temporarily disable ROCm distributed tests (#80530)
They are timing out so disabling to restore CI as it is investigated.
see: https://github.com/pytorch/pytorch/issues/80529
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80530
Approved by: https://github.com/malfet
2022-06-29 16:30:01 +00:00
PyTorch MergeBot
58532256e9 Revert "Add __all__ for torch.distributed and fx modules (#80460)"
This reverts commit 5d40c3d5c8.

Reverted https://github.com/pytorch/pytorch/pull/80460 on behalf of https://github.com/malfet due to Broke MacOS testing, see https://github.com/pytorch/pytorch/runs/7105579664?check_suite_focus=true
2022-06-29 16:20:55 +00:00
Rodrigo Kumpera
08795f9afc Add _reduce_scatter_base to ProcessGroupWrapper. (#79633)
Fixes #66329

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79633
Approved by: https://github.com/fduwjj, https://github.com/rohan-varma
2022-06-29 15:32:42 +00:00
Allen Goodman
63ef2a03e5 torch.special.scaled_modified_bessel_k0 (#78900)
```Python
scaled_modified_bessel_k0(input, *, out=None) -> Tensor
```

Scaled modified Bessel function of the second kind of order $0$.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78900
Approved by: https://github.com/mruberry
2022-06-29 14:53:37 +00:00
jjsjann123
c28315eab8 [primtorch] add reference for clamp_min/clamp_max (#79821)
Added reference implementation for the two ops;
Added opinfo tests for aten clamp_min/clamp_max;
Added opinfo reference test.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79821
Approved by: https://github.com/mruberry
2022-06-29 14:12:23 +00:00
Milad Mohammadi
0922cc024e Added support for expand in LazyTensor shape inference (#77830)
Added support for `expand` in LazyTensor shape inference
Fixes #77831

---

**Blockers:**

- [x] https://github.com/pytorch/pytorch/issues/77880
- [x] https://github.com/pytorch/pytorch/issues/77882
Pull Request resolved: https://github.com/pytorch/pytorch/pull/77830
Approved by: https://github.com/Krovatkin
2022-06-29 05:27:06 +00:00
PyTorch MergeBot
853247e585 [torchdynamo hash update] update the pinned torchdynamo hash (#80485)
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 torchdynamo hash.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80485
Approved by: https://github.com/pytorchbot
2022-06-29 04:27:58 +00:00
zilinzhu
3d9cef8c98 Clone tensor to write in ShardedTensor checkpoint (#79400)
The `torch.save` api will save the origin tensor of a view, which will results in saving a much larger checkpoint when parameters are fused, e.g. in torchrec.

Relates to #79016

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79400
Approved by: https://github.com/kumpera
2022-06-29 03:47:24 +00:00
Edward Z. Yang
57f001f35a Don't error if _warned_capturable_if_run_uncaptured not set (#80345)
This can happen if an optimizer was pickled.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80345
Approved by: https://github.com/malfet, https://github.com/albanD
2022-06-29 03:46:22 +00:00
anjali411
5d40c3d5c8 Add __all__ for torch.distributed and fx modules (#80460)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80460
Approved by: https://github.com/albanD, https://github.com/rohan-varma
2022-06-29 02:53:56 +00:00
qqaatw
5943aaa0c4 [MPS] Add logical ops (#80216)
This PR adds `logical_not`, `logical_and`, `logical_or`, `logical_xor`.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80216
Approved by: https://github.com/albanD, https://github.com/kulinseth
2022-06-29 02:44:35 +00:00
qqaatw
182870f4a7 Add objective-c language support in CMake (#80432)
Fixes #80018

Local build on my machine looks fine.

cc @albanD @peterbell10

Pull Request resolved: https://github.com/pytorch/pytorch/pull/80432
Approved by: https://github.com/albanD
2022-06-29 02:38:40 +00:00
Linbin Yu
d32ab80c32 Update buck_setup.sh (#80467)
Add a parameter for proxy setup when running this script in devserver

Pull Request resolved: https://github.com/pytorch/pytorch/pull/80467
Approved by: https://github.com/malfet
2022-06-29 01:39:37 +00:00
Rohan Varma
5fc2d45a3a Remove unneeded TODO (#80453)
This TODO is no longer needed, as we use `_register_fused_optim` to register the overlapped optimizer in DDP.  Also, remove comment about API being experimental, as this API is no longer going to be used by end user.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80453
Approved by: https://github.com/awgu
2022-06-29 01:19:48 +00:00
Nikolay Korovaiko
7e34edf12d adding sym_size override (#80357)
Fixes #ISSUE_NUMBER

Pull Request resolved: https://github.com/pytorch/pytorch/pull/80357
Approved by: https://github.com/ezyang
2022-06-29 00:53:45 +00:00
Akshay Parashar
7f8e852dff [Static Runtime] Support Futures in Static Runtime Engine (#80162)
Summary: - Static Runtime now exports runAsync() API which returns an intrusive_ptr to c10:Future type

Differential Revision: D37385849

Pull Request resolved: https://github.com/pytorch/pytorch/pull/80162
Approved by: https://github.com/mikeiovine
2022-06-28 23:57:26 +00:00
Riley Dulin
11f7463309 [torch] Add more functions to __init__.pyi.in for torch._C for Node and Value (#79654)
Summary:
https://github.com/pytorch/pytorch/pull/78757 recently added
a lot of functions to the type stub, but it missed a few of them.

This change will make sure every function is included, by making
sure this list is up-to-date with: `torch/csrc/jit/python/python_ir.cpp`.

This change only does this for Node and Value.

Differential Revision: D37189713

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79654
Approved by: https://github.com/ezyang
2022-06-28 23:57:09 +00:00
John Detloff
e487ba7333 Add nlohmann/json submodule (#80322)
Summary: Introduce nlohmann/json as a submodule within pytorch/third_party. This library is already a transitive dependency and is included in our licenses file. Adding it directly to third_party will enable its use by the CoreML backend.

Test Plan: There are no code changes, so submodule sync and perform the steps outline in the building from source section of the pytorch readme.

Differential Revision: D37449817

Pull Request resolved: https://github.com/pytorch/pytorch/pull/80322
Approved by: https://github.com/mcr229
2022-06-28 23:54:33 +00:00
atalman
33fecf057f [IOS] Update Cocoapods for 1.12 release (#80472)
[IOS] Update Cocoapods for 1.12 release

Pull Request resolved: https://github.com/pytorch/pytorch/pull/80472
Approved by: https://github.com/mthrok, https://github.com/malfet
2022-06-28 23:49:50 +00:00
Scott Wolchok
b9d516138b [PyTorch] Add test_modules test for TransformerEncoderLayer fast path (#78268)
Extend the existing TransformerEncoderLayer test to cover the fast path.

Differential Revision: [D36564009](https://our.internmc.facebook.com/intern/diff/D36564009/)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78268
Approved by: https://github.com/zrphercule
2022-06-28 21:07:54 +00:00
qqaatw
3dec9fd09f [ONNX] Fix hardshrink and softshrink output's shape (#79695)
Part of #79263

Before: When the shape of the two functions is `[]`, the reduced output has `[1]` shape.
After: The shape of the two functions is now `[]` as PyTorch's behavior.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79695
Approved by: https://github.com/justinchuby, https://github.com/BowenBao
2022-06-28 20:00:10 +00:00
qqaatw
c4da23ed1b [MPS] Add flip (#80214)
Fixes #ISSUE_NUMBER

Pull Request resolved: https://github.com/pytorch/pytorch/pull/80214
Approved by: https://github.com/DenisVieriu97, https://github.com/albanD
2022-06-28 19:51:45 +00:00
Olga Andreeva
a48f3059b7 Corrected comments in fsdp (#80456)
Currently,  pre- and post-division steps in `FullyShardedDataParallel._post_backward_hook` state the following:
>  Average grad by world_size for consistency with PyTorch DDP.

This is not matching what is actually going on, i.e. pre-divide factor may be equal to `world_size` and may not.
For example, for `world_size = 3 `, `predivide_factor=2`

This PR clarifies pre- and post-division in the code

Pull Request resolved: https://github.com/pytorch/pytorch/pull/80456
Approved by: https://github.com/rohan-varma
2022-06-28 18:46:05 +00:00