foram-chandra
e19a7165fd
[nn] Remove deprecation warning from nn.functional.{tanh, sigmoid} ( #86905 )
...
Fixes #65909
Pull Request resolved: https://github.com/pytorch/pytorch/pull/86905
Approved by: https://github.com/albanD , https://github.com/kit1980
2022-11-24 00:34:26 +00:00
Nikita Karetnikov
0a1a53083e
[primTorch] Enable regex error testing for some refs ( #87765 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/87765
Approved by: https://github.com/mruberry
2022-11-23 23:36:27 +00:00
David Boetius
b652fbc57a
Fix torch.nn.functional.gelu docstring formatting ( #89061 )
...
The docstring of `torch.nn.functional.gelu` is formatted incorrectly, so that part of the math isn't rendered and there are extra blocks when there shouldn't: https://pytorch.org/docs/stable/generated/torch.nn.functional.gelu.html
I didn't build the docs, so I am not 100% sure that I got the formatting right, but I am confident.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/89061
Approved by: https://github.com/bdhirsh , https://github.com/kit1980
2022-11-18 01:57:41 +00:00
Ryan Spring
534ae6ae47
[primTorch] Implement group norm reference ( #87054 )
...
Add group norm reference
Split from #81191
Pull Request resolved: https://github.com/pytorch/pytorch/pull/87054
Approved by: https://github.com/mruberry
2022-11-11 01:08:20 +00:00
Kazuaki Ishizaki
2ddefbdc3c
Fix typos used in documents under torch directory ( #88300 )
...
This PR fixes typos, in comments of Python files, that are found from a search box at https://pytorch.org/docs/master/search.html
Pull Request resolved: https://github.com/pytorch/pytorch/pull/88300
Approved by: https://github.com/lezcano
2022-11-02 09:38:13 +00:00
Rui Zhu
4b757f4633
Assert if padding mask type is unexpected ( #86353 ) ( #87106 )
...
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/86353
Fix the issue described in
https://github.com/pytorch/pytorch/issues/86120
Test Plan: buck test mode/opt caffe2/test:test_transformers -- test_train_with_long_type_pad
Differential Revision: D40129968
Pull Request resolved: https://github.com/pytorch/pytorch/pull/87106
Approved by: https://github.com/malfet
2022-10-20 16:01:54 +00:00
Andrew M. James
db65909255
[Docs] Update mm family ops and F.linear to note limited sparse support. ( #86220 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/86220
Approved by: https://github.com/cpuhrsch
2022-10-18 19:55:18 +00:00
Nikita Karetnikov
d56017a14f
[primTorch] Add ref for triplet_margin_loss, improve triplet_margin_with_distance_loss ( #85614 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/85614
Approved by: https://github.com/lezcano , https://github.com/mruberry
2022-10-12 18:37:58 +00:00
lezcano
787028cadb
Implement col2im decomposition and fix im2col and add a few preconditions ( #85541 )
...
As per title
Pull Request resolved: https://github.com/pytorch/pytorch/pull/85541
Approved by: https://github.com/jansel
2022-09-30 09:31:53 +00:00
Srikumar Sastry
c8776dca6a
Remove extra with in value error exception statement ( #84713 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/84713
Approved by: https://github.com/ngimel
2022-09-27 18:43:39 +00:00
Driss Guessous
253ffbf28b
Exposing native _scaled_dot_product_attention to torch.nn ( #85044 )
...
# Summary
This exposes the _scaled_dot_product_attention function to python in the nn namespace. It is still underscored because the api for args, and kwargs is still in flux for the next few weeks and will eventually land as a prototype feature.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/85044
Approved by: https://github.com/cpuhrsch
2022-09-22 16:30:16 +00:00
PyTorch MergeBot
a3dc338ee1
Revert "Exposing native _scaled_dot_product_attention to torch.nn ( #85044 )"
...
This reverts commit 9fdd8a8b7f .
Reverted https://github.com/pytorch/pytorch/pull/85044 on behalf of https://github.com/huydhn due to This breaks CUDA 10.2 in trunk. We are deprecating CUDA 10.2, but it is still here in the mean time
2022-09-21 08:34:51 +00:00
Driss Guessous
9fdd8a8b7f
Exposing native _scaled_dot_product_attention to torch.nn ( #85044 )
...
# Summary
This exposes the _scaled_dot_product_attention function to python in the nn namespace. It is still underscored because the api for args, and kwargs is still in flux for the next few weeks and will eventually land as a prototype feature.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/85044
Approved by: https://github.com/cpuhrsch
2022-09-21 03:09:08 +00:00
joncrall
b136f3f310
More doctest refinements. ( #83317 )
...
Follow up to #82797
Now that the doctests themselves are in a better state, we should be able to enable xdoctest on the CI so they stay that way.
@ezyang @vadimkantorov
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83317
Approved by: https://github.com/ezyang
2022-08-22 20:07:26 +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
joncrall
4618371da5
Integrate xdoctest - Rebased ( #82797 )
...
This is a new version of #15648 based on the latest master branch.
Unlike the previous PR where I fixed a lot of the doctests in addition to integrating xdoctest, I'm going to reduce the scope here. I'm simply going to integrate xdoctest, and then I'm going to mark all of the failing tests as "SKIP". This will let xdoctest run on the dashboards, provide some value, and still let the dashboards pass. I'll leave fixing the doctests themselves to another PR.
In my initial commit, I do the bare minimum to get something running with failing dashboards. The few tests that I marked as skip are causing segfaults. Running xdoctest results in 293 failed, 201 passed tests. The next commits will be to disable those tests. (unfortunately I don't have a tool that will insert the `#xdoctest: +SKIP` directive over every failing test, so I'm going to do this mostly manually.)
Fixes https://github.com/pytorch/pytorch/issues/71105
@ezyang
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82797
Approved by: https://github.com/ezyang
2022-08-12 02:08:01 +00:00
Alex Li
1fedd40424
Update cross entropy documentation to metion logits clearly ( #82538 )
...
### Description
Improved the documentation for cross entropy as it is a common point of confusion.
### Issue
#82081
### Testing
I did not test this change as it is tiny and documentation-only
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82538
Approved by: https://github.com/jbschlosser
2022-08-08 22:24:28 +00:00
ProGamerGov
357b7d589c
Fix docstring inconsistencies: string -> str, boolean -> bool ( #82410 )
...
### Description
Throughout the PyTorch docs and codebase, the `string` type in docstrings is referred to by two separate names. This leads to inconsistent docs, like you can see here: https://pytorch.org/docs/stable/generated/torch.nn.Conv3d.html#torch.nn.Conv3d
This PR fixes this issue by ensuring that all mentions of the string type in docstrings, are using the same format that Sphinx generates hyperlinks for.
### Testing
No testing should be required for this change
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82410
Approved by: https://github.com/jbschlosser
2022-07-28 21:29:57 +00:00
kylematoba
66cf1b6459
correct argument name in docs ( #81485 )
...
Recently introduced `average_attn_weights` argument is documented incorrectly.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/81485
Approved by: https://github.com/albanD
2022-07-20 20:07:16 +00:00
soulitzer
bd75b2fea1
Add ref for nn.functional.prelu ( #79768 )
...
TODO:
- not sure if these error-inputs work for all devices (awaiting CI)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79768
Approved by: https://github.com/mruberry
2022-07-07 17:04:47 +00:00
Albert Chung
b4ed13ea0f
Update docstring for scale_factor in torch.nn.functional.interpolate. ( #80807 )
...
Fixes #80786
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80807
Approved by: https://github.com/ezyang
2022-07-04 04:36:16 +00:00
Joel Benjamin Schlosser
5953fd9133
Revert behavior of Dropout2d on 3D inputs to 1D channel-wise dropout behavior & warn
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79549
Approved by: https://github.com/ngimel , https://github.com/albanD
2022-06-15 14:56:43 +00:00
Joel Benjamin Schlosser
2d73c8e6e0
Add Dropout1d module
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79545
Approved by: https://github.com/ngimel , https://github.com/albanD
2022-06-15 14:39:07 +00:00
PyTorch MergeBot
3556457dd2
Revert "kl_div: fix for grads wrt target, double backward, forward-over-reverse AD support. ( #79007 )"
...
This reverts commit 72ad222cff .
Reverted https://github.com/pytorch/pytorch/pull/79007 on behalf of https://github.com/janeyx99 due to Broke test_fn_fwgrad_bwgrad_nn_functional_kl_div_cpu_float64 on trunk https://hud.pytorch.org/minihud?name_filter=pull%20/%20linux-xenial-py3.7-clang7-asan%20/%20test%20(default,%202,%205,%20linux.2xlarge)
2022-06-09 13:07:03 +00:00
Nikita Vedeneev
72ad222cff
kl_div: fix for grads wrt target, double backward, forward-over-reverse AD support. (#79007 )
...
Fixes https://github.com/pytorch/pytorch/issues/78867 ,
fixes https://github.com/pytorch/pytorch/issues/65466 .
Adds forward-over-reverse AD support.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79007
Approved by: https://github.com/soulitzer , https://github.com/jbschlosser
2022-06-09 09:06:52 +00:00
Rohit Goswami
5a95b20d0f
DOC: Harmonize ELU documentation with the module doc ( #78909 )
...
Fixes #77055 by simply referring to the module docs as noted in the issue.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78909
Approved by: https://github.com/albanD
2022-06-06 14:14:11 +00:00
samdow
b7cb4eae6b
Fix embedding jvp support by making embedding_renorm ignore forward mode AD ( #78560 )
...
On functorch, we started seeing [embedding forward mode fail](https://github.com/pytorch/functorch/pull/816 ). From looking at it, we figured out that recently [embedding got forward mode support enabled](369d9f4137 ) and then doing forward mode with embedding and [max_norm doesn't work with gradcheck](https://github.com/pytorch/pytorch/blob/master/torch/testing/_internal/common_methods_invocations.py#L8877-L8881 ), so it's not checked.
What was happening is that `embedding_renorm` was setting `torch.no_grad()` which only turns off the backwards mode AD so functorch's jvp tests were still using forward mode AD during the `embedding_renorm` call. This makes it so that we don't use forward mode during the embedding_renorm call
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78560
Approved by: https://github.com/soulitzer , https://github.com/albanD
2022-06-03 19:14:51 +00:00
PyTorch MergeBot
d578197747
Revert "Fix embedding jvp support by making embedding_renorm ignore forward mode AD ( #78560 )"
...
This reverts commit ce7c7bb2a9 .
Reverted https://github.com/pytorch/pytorch/pull/78560 on behalf of https://github.com/malfet due to broke XLA (on CI and trunk), see ce7c7bb2a9
2022-06-02 17:40:34 +00:00
samdow
ce7c7bb2a9
Fix embedding jvp support by making embedding_renorm ignore forward mode AD ( #78560 )
...
On functorch, we started seeing [embedding forward mode fail](https://github.com/pytorch/functorch/pull/816 ). From looking at it, we figured out that recently [embedding got forward mode support enabled](369d9f4137 ) and then doing forward mode with embedding and [max_norm doesn't work with gradcheck](https://github.com/pytorch/pytorch/blob/master/torch/testing/_internal/common_methods_invocations.py#L8877-L8881 ), so it's not checked.
What was happening is that `embedding_renorm` was setting `torch.no_grad()` which only turns off the backwards mode AD so functorch's jvp tests were still using forward mode AD during the `embedding_renorm` call. This makes it so that we don't use forward mode during the embedding_renorm call
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78560
Approved by: https://github.com/soulitzer , https://github.com/albanD
2022-06-02 13:40:21 +00:00
Kshiteej K
4e1f41f66a
[docs][nn] conv: complex support note ( #78351 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78351
Approved by: https://github.com/anjali411 , https://github.com/jbschlosser
2022-05-26 20:33:36 +00:00
Natalia Gimelshein
362525724b
type promote clamp ( #77035 )
...
Fixes #76630
When clamp(Tensor, Tensor) is structured, big parts of this PR won't be needed, but for now let's fix type promotion to make behavior more regular.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/77035
Approved by: https://github.com/mruberry
2022-05-09 05:54:17 +00:00
vitrioil
f92cddd890
Removed direct doc formatting
...
Fixes #76034
This does not make python remove all `__doc__` because in some places `__doc__` is assigned to a string.
Example:
04b3313379/torch/nn/modules/conv.py (L174-L233)
Since there are quite a few of these, I will add all of them together in this PR later. (Basically still a lot of docstring will persist even with `-OO` enabled.)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76619
Approved by: https://github.com/albanD
2022-05-02 14:14:33 +00:00
Yuge Zhang
3ac27e78ca
Fix typehint of multi_head_attention_forward
...
Fixes #76169
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76170
Approved by: https://github.com/jbschlosser
2022-04-27 13:47:43 +00:00
Peter Bell
cb37e7a080
Remove F.pad python implementation
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/73433
Approved by: https://github.com/albanD , https://github.com/jbschlosser
2022-04-23 00:13:20 +00:00
vitrioil
29b004be7a
Corrected documentation for supported padding
...
Fixes #72521
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76117
Approved by: https://github.com/jbschlosser
2022-04-20 17:36:01 +00:00
Mike Ruberry
b09769992f
Improves the OpInfo out= tests
...
Edit: OpInfos separated into their own PRs to debug an ASAN failure that doesn't identify the failing test properly. This PR now just updates the out tests.
Adds OpInfos for:
- nn.functional.smooth_l1_loss
- nn.functional.l1_loss
- nn.functional.pdist
- nn.functional.binary_cross_entropy
- nn.functional.triplet_margin_loss
- nn.functional.triplet_margin_with_distance_loss
- nn.functional.max_unpool{1, 2, 3}D
- nn.functional.alpha_dropout
- nn.functional.soft_margin_loss
- nn.functional.multilabel_soft_margin_loss
- nn.functional.multilabel_margin_loss
- nn.functional.multi_margin_loss
- nn.functional.margin_ranking_loss
These OpInfos were taken from https://github.com/pytorch/pytorch/pull/67560 , https://github.com/pytorch/pytorch/pull/67823 , https://github.com/pytorch/pytorch/pull/68625 , and https://github.com/pytorch/pytorch/pull/67079 . The sample input update from https://github.com/pytorch/pytorch/pull/67017 is also rolled into this PR.
cc @zou3519 @nikitaved @pmeier @vfdev-5 @dagitses
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75782
Approved by: https://github.com/ngimel
2022-04-15 06:16:01 +00:00
Edward Z. Yang
0a1bc5f501
Miscellaneous __torch_function__ fixes
...
I figured these out by unconditionally turning on a no-op torch function
mode on the test suite and then fixing errors as they showed up. Here's
what I found:
- _parse_to failed internal assert when __torch_function__'ed because it
claims its name is "to" to the argument parser; added a name override
so we know how to find the correct name
- Infix operator magic methods on Tensor did not uniformly handle
__torch_function__ and TypeError to NotImplemented. Now, we always
do the __torch_function__ handling in
_wrap_type_error_to_not_implemented and your implementation of
__torch_function__ gets its TypeErrors converted to NotImplemented
(for better or for worse; see
https://github.com/pytorch/pytorch/issues/75462 )
- A few cases where code was incorrectly testing if a Tensor was
Tensor-like in the wrong way, now use is_tensor_like (in grad
and in distributions). Also update docs for has_torch_function to
push people to use is_tensor_like.
- is_grads_batched was dropped from grad in handle_torch_function, now
fixed
- Report that you have a torch function even if torch function is
disabled if a mode is enabled. This makes it possible for a mode
to return NotImplemented, pass to a subclass which does some
processing and then pass back to the mode even after the subclass
disables __torch_function__ (so the tensors are treated "as if"
they are regular Tensors). This brings the C++ handling behavior
in line with the Python behavior.
- Make the Python implementation of overloaded types computation match
the C++ version: when torch function is disabled, there are no
overloaded types (because they all report they are not overloaded).
Signed-off-by: Edward Z. Yang <ezyangfb.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75484
Approved by: https://github.com/zou3519
2022-04-11 16:52:16 +00:00
Scott Wolchok
87f40ee6d6
[PyTorch] Existing MHA: fuse the attn_mask addition ( #73219 )
...
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/73219
Saw a report that this elementwise add is causing overhead. IIUC this is easy to fuse?
ghstack-source-id: 152549975
Test Plan:
CI, review
Ran benchmark_transformers.par mha --batch-size 64 --max-sequence-length 128 --avg-sequence-length 256 --large --use-real-data-distribution --use-mask
and looked at the PT time number
```
before:
B=64, T=128, Half=True, GPU=True, Seed=1234, Padded tokens=54.92%, Use Mask=True PT Time: 1.24ms, NativePT Time: 1000000000.00ms, HF Time: 1.10ms, PT FLOPS: 59.07TFLOP/s, NativePT FLOPS: 0.00TFLOP/s, HF FLOPS: 66.46TFLOP/s
B=64, T=128, Half=True, GPU=True, Seed=1234, Padded tokens=54.92%, Use Mask=True PT Time: 1.23ms, NativePT Time: 1000000000.00ms, HF Time: 1.09ms, PT FLOPS: 59.57TFLOP/s, NativePT FLOPS: 0.00TFLOP/s, HF FLOPS: 66.75TFLOP/s
B=64, T=128, Half=True, GPU=True, Seed=1234, Padded tokens=54.92%, Use Mask=True PT Time: 1.24ms, NativePT Time: 1000000000.00ms, HF Time: 1.09ms, PT FLOPS: 58.87TFLOP/s, NativePT FLOPS: 0.00TFLOP/s, HF FLOPS: 66.77TFLOP/s
after:
B=64, T=128, Half=True, GPU=True, Seed=1234, Padded tokens=54.92%, Use Mask=True PT Time: 1.22ms, NativePT Time: 1000000000.00ms, HF Time: 1.10ms, PT FLOPS: 60.07TFLOP/s, NativePT FLOPS: 0.00TFLOP/s, HF FLOPS: 66.51TFLOP/s
B=64, T=128, Half=True, GPU=True, Seed=1234, Padded tokens=54.92%, Use Mask=True PT Time: 1.22ms, NativePT Time: 1000000000.00ms, HF Time: 1.09ms, PT FLOPS: 59.80TFLOP/s, NativePT FLOPS: 0.00TFLOP/s, HF FLOPS: 66.69TFLOP/s
B=64, T=128, Half=True, GPU=True, Seed=1234, Padded tokens=54.92%, Use Mask=True PT Time: 1.21ms, NativePT Time: 1000000000.00ms, HF Time: 1.09ms, PT FLOPS: 60.21TFLOP/s, NativePT FLOPS: 0.00TFLOP/s, HF FLOPS: 66.86TFLOP/s
```
Inspected a Kineto trace and confirmed that an elementwise add was fused into baddbmm.
Additional opportunity: I see a copy_ inside baddbmm that wasn't happening with the bmm path and I'm not sure why. Perhaps something went wrong with the structured kernels port by ezyang?
Reviewed By: ezyang
Differential Revision: D34160547
fbshipit-source-id: 78d406fb035e6f3bf13af2c9443a886eada35ac4
(cherry picked from commit aaffc39b24058742cb9ae42105f95b3eafe9d7f5)
2022-04-04 20:31:22 +00:00
Peter Bell
7f051b4d2b
Implement F.pad in ATen
...
This moves the C++ torch pad function into ATen proper. Once the
forward-compatibility period is over, the python interface can use
this directly.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/73431
Approved by: https://github.com/ezyang
2022-04-01 01:10:12 +00:00
Davit Kobaladze
8e12d2bf25
fixes torch.jit.script lp_pool bug. ( #73287 )
...
Summary:
Fixes https://github.com/pytorch/pytorch/issues/60258
I used the solution proposed in https://github.com/pytorch/pytorch/issues/61275 . His solution failed unit tests and there was no progress after 08/07/2021. I'm willing to fix problems if they arise during CI.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/73287
Reviewed By: navahgar, zou3519
Differential Revision: D35057812
Pulled By: eellison
fbshipit-source-id: 8e82e9f73b9536979aecf476c5c65336cdffc93a
(cherry picked from commit e85e912a4edec1111623c5cbbba4171fe3bc5b1d)
2022-03-28 23:16:07 +00:00
Peter Bell
f86bb2d6e4
Implement _pad_circular in ATen
...
Closes #44459
This migrates the python implementation of `_pad_circular` to ATen and
removes the old C++ implementation that had diverged from python.
Note that `pad` can't actually use this until the
forward-compatibility period is over.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/73410
Approved by: https://github.com/ezyang
2022-03-25 02:09:01 +00:00
Kushashwa Ravi Shrimali
452c26bbeb
Fix functional.max_poolNd warning spam in the CI
...
Fixes https://github.com/pytorch/pytorch/issues/71257 .
Warnings have been removed, please see [this](https://github.com/pytorch/pytorch/pull/71258#issuecomment-1058503649 ) comment.
cc: @Lezcano @jbschlosser @zou3519
Pull Request resolved: https://github.com/pytorch/pytorch/pull/71258
Approved by: https://github.com/Lezcano , https://github.com/jbschlosser
2022-03-04 18:42:23 +00:00
Scott Wolchok
28339ddc25
[PyTorch] Hit fused addmm path in linear() for existing MHA ( #72871 )
...
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/72871
We do this same trick in the native MHA implementation; backport it for purposes of fair comparison.
ghstack-source-id: 149526858
Test Plan: CI
Reviewed By: ngimel
Differential Revision: D34176090
fbshipit-source-id: 8b578c29c4dcf0d85bae74dfbbb82db9a8f32dc7
(cherry picked from commit fd50170935 )
2022-02-22 19:33:46 +00:00
Joel Schlosser
f670179c0a
Fix doc regressions for various modules and functional forms ( #73014 )
...
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/73014
Fixes #72501
Fixes #72502
Fixes #72503
Fixes #72504
Fixes #72505
Fixes #72506
Fixes #72507
Fixes #72509
Fixes #72510
Test Plan: Imported from OSS
Reviewed By: albanD
Differential Revision: D34305640
Pulled By: jbschlosser
fbshipit-source-id: 62f341633fdb0316eaa346cf7247865290eb830a
(cherry picked from commit 8362d264e7 )
2022-02-17 22:40:18 +00:00
Vitaly Fedyunin
81fbeea760
Add docstrings to native_channel_shuffle ( #72919 )
...
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/72919
Test Plan: Imported from OSS
Reviewed By: bdhirsh
Differential Revision: D34274717
Pulled By: VitalyFedyunin
fbshipit-source-id: fa42f91ef2335e2594b19ef65d914c711f7a94fd
(cherry picked from commit a6f6fe9112 )
2022-02-17 02:33:08 +00:00
Ryan Spring
4f8b986e28
Implement Tanh Gelu Approximation ( #61439 )
...
Summary:
1. Implements https://github.com/pytorch/pytorch/issues/39853
2. Adds approximate boolean flag to Gelu
3. Enables Tanh Gelu approximation
4. Adds double backward support for Gelu
5. Enable Tanh Gelu in NvFuser
```
def gelu(x, approximate : str = 'none'):
if approximate == 'tanh':
# sqrt(2/pi) = 0.7978845608028654
return 0.5 * x * (1.0 + torch.tanh(0.7978845608028654 * (x + 0.044715 * torch.pow(x, 3.0))))
else:
return x * normcdf(x)
```
Linking XLA PR - https://github.com/pytorch/xla/pull/3039
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61439
Reviewed By: VitalyFedyunin
Differential Revision: D33894937
Pulled By: jbschlosser
fbshipit-source-id: b65e8fb6ea66168af8f34f45ed50e92737a33851
(cherry picked from commit 6e986f91a9 )
2022-02-14 03:40:32 +00:00
kshitij12345
02f6226bff
[fix] Dropout2d-3d no-batch-dim ( #69885 )
...
Summary:
Fixes https://github.com/pytorch/pytorch/issues/69801
TODO:
* [x] Update C++ API
cc albanD mruberry jbschlosser walterddr kshitij12345
Pull Request resolved: https://github.com/pytorch/pytorch/pull/69885
Reviewed By: mruberry
Differential Revision: D33175470
Pulled By: jbschlosser
fbshipit-source-id: c9d7d9e0f59ba290a0157725c338a345f3d58b9f
(cherry picked from commit 7e4271a156 )
2022-02-02 16:40:32 +00:00
pejato
b8a4ee5e35
Clean up old warnings in F.interpolate ( #72093 )
...
Summary:
Fixes https://github.com/pytorch/pytorch/issues/71720
This PR removes the old warnings for `recompute_scale_factor` and `align_corners`.
Looking at this, I realize that the tests I modified don't really catch whether or not a warning is created for `recompute_scale_factor`. If desired, I can add a couple lines into the tests there to pass a floating point in the `scale_factors` kwarg, along with `recompute_scale_factor=None`.
Let me know how this looks, thanks so much!
Pull Request resolved: https://github.com/pytorch/pytorch/pull/72093
Reviewed By: mruberry
Differential Revision: D33917615
Pulled By: albanD
fbshipit-source-id: e822f0a15b813ecf312cdc6ed0b693e7f1d1ca89
(cherry picked from commit c14852b85c )
2022-02-01 21:18:29 +00:00
Peter Bell
e8d226cd9a
Remove some unnecessary python functional wrappers ( #61608 )
...
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61608
See #61544 for an example of issues created by functional wrappers. In this
case, these are directly wrapping the native function with no added
functionality. One exception was `bilinear` which was just missing the default
argument in C++, but was otherwise the same.
I've kept the symbol `torch.functional.istft` because it looks like public API,
but it could just as easily be moved to `_torch_docs.py`.
Test Plan: Imported from OSS
Reviewed By: ngimel
Differential Revision: D31401361
Pulled By: albanD
fbshipit-source-id: 162b74d0b2d4f2e5c4834687a94541960cefdd52
(cherry picked from commit 700cd73ca1 )
2022-02-01 16:59:26 +00:00
Nikita Shulga
74c44ba9d6
Revert D33850228: [pytorch][PR] Implement Tanh Gelu Approximation
...
Test Plan: revert-hammer
Differential Revision:
D33850228 (23d03025dc )
Original commit changeset: 3cc33fb298e4
Original Phabricator Diff: D33850228 (23d03025dc )
fbshipit-source-id: 9436e7df73c2b2e2011f321674f24973316d3692
(cherry picked from commit c9efb58223 )
2022-01-31 17:44:19 +00:00