Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow None to be returned from hooks (fixes #1269) #1718

Closed
wants to merge 1 commit into from

Conversation

lantiga
Copy link
Contributor

@lantiga lantiga commented Jun 4, 2017

This is a fix for #1269.

Currently python_hook.cpp checks that individual values returned from a hook are tensors. However, as in the example with Conv without bias, they could be None. This fix simply allows None to be returned from a hook and updates the error message accordingly.

@lantiga
Copy link
Contributor Author

lantiga commented Jun 4, 2017

To verify:

import torch
import torch.nn as nn
from torch.autograd import Variable

def hook(module, grad_input, grad_output):
    print(grad_input)
    return grad_input

a = Variable(torch.randn(1,1,3,3))
conv = nn.Conv2d(1, 1, (3,3), bias=False)
conv.register_backward_hook(hook)
b = conv(a)
b.backward()

@apaszke
Copy link
Contributor

apaszke commented Jun 4, 2017

Actually already I have a fix for this in my branch. If someone is assigned to an issue then it means they're already working on it. Sorry!

@apaszke apaszke closed this Jun 4, 2017
@apaszke
Copy link
Contributor

apaszke commented Jun 4, 2017

And thank you!

@lantiga
Copy link
Contributor Author

lantiga commented Jun 5, 2017

Whoops, sorry for the noise.

facebook-github-bot pushed a commit that referenced this pull request Jan 22, 2019
…bab70a

Summary:
Previous import was c553fb32a0902ce5dd42e1b40123e9e9b38bdbe7

Included changes:
- **[dc75285](onnx/onnx@dc75285)**: Relax constraint that the initializers must be a subset of graph inputs (#1718) <G. Ramalingam>
- **[985c8cd](onnx/onnx@985c8cd)**: Fix typo in scan shape inferencing (#1753) <Scott McKay>
- **[ab52a5d](onnx/onnx@ab52a5d)**: remove stale test cases <Lu Fang>
- **[56434bb](onnx/onnx@56434bb)**: Removing experimental ConstantFill op. <Spandan Tiwari>
- **[881c63c](onnx/onnx@881c63c)**: Show string names of data types instead of int IDs (#1749) <Shinichiro Hamaji>
- **[0a12fe4](onnx/onnx@0a12fe4)**: Update ConstantOfShape op. (#1744) <Bowen Bao>
- **[ef028e5](onnx/onnx@ef028e5)**: Update definition of Cast Op to support casting to/from string (#1704) <Raymond Yang>

Reviewed By: BIT-silence

Differential Revision: D13773962

fbshipit-source-id: b98079277994a699d4807210ba1d9c27f4672090
jjsjann123 added a commit to jjsjann123/pytorch that referenced this pull request May 24, 2022
malfet pushed a commit that referenced this pull request Jun 8, 2022
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: csarofeen#1619
2. Emulate ampere's mma 16816 with Turing's mma 1688, for a unified interface: csarofeen#1643
3. Extending the infrastructure to support mma operators on turing and ampere arch: csarofeen#1440

Commits that's actually in this PR from the csarofeen branch
```
* dd23252 (csarofeen/devel) Fusion Segmenter: Unify single kernel and multi-kernel runtime path (#1710)
* b3d1c3f Fix missing cooperative launch (#1726)
* dc670a2 Async gmem copy support on sm80+ (#1619)
* 5e6a8da Add turing mma support and test (#1643)
* d6d6b7d Fix rFactor when there are indirect root domain(s), and refactor (#1723)
* 7093e39 Mma op integration on ampere (#1440)
* fade8da patch python test for bfloat16 (#1724)
* 8fbd0b1 Fine-grained kernel profiling (#1720)
* 77c1b4f Adding dry run mode to skip arch dependent checks (#1702)
* 151d95b More precise concretization analysis (#1719)
* f4d3630 Enable complex python tests (#1667)
* 4ceeee5 Minor bugfix in transform_rfactor.cpp (#1715)
* 3675c70 Separate root domain and rfactor domain in TransformPrinter (#1716)
* f68b830 Fix scheduling with polymorphic broadcast (#1714)
* 4ab5ef7 updating_ci_machine (#1718)
* 56585c5 Merge pull request #1711 from csarofeen/upstream_master_bump_0517
* 174d453 Allow using nvFuser on CUDA extension (#1701)
* 18bee67 Validate LOOP concrete IDs have complete IterDomains (#1676)
```
Pull Request resolved: #78244
Approved by: https://github.com/csarofeen, https://github.com/malfet
facebook-github-bot pushed a commit that referenced this pull request Jun 8, 2022
Summary:
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: csarofeen#1619
2. Emulate ampere's mma 16816 with Turing's mma 1688, for a unified interface: csarofeen#1643
3. Extending the infrastructure to support mma operators on turing and ampere arch: csarofeen#1440

Commits that's actually in this PR from the csarofeen branch
```
* dd23252 (csarofeen/devel) Fusion Segmenter: Unify single kernel and multi-kernel runtime path (#1710)
* b3d1c3f Fix missing cooperative launch (#1726)
* dc670a2 Async gmem copy support on sm80+ (#1619)
* 5e6a8da Add turing mma support and test (#1643)
* d6d6b7d Fix rFactor when there are indirect root domain(s), and refactor (#1723)
* 7093e39 Mma op integration on ampere (#1440)
* fade8da patch python test for bfloat16 (#1724)
* 8fbd0b1 Fine-grained kernel profiling (#1720)
* 77c1b4f Adding dry run mode to skip arch dependent checks (#1702)
* 151d95b More precise concretization analysis (#1719)
* f4d3630 Enable complex python tests (#1667)
* 4ceeee5 Minor bugfix in transform_rfactor.cpp (#1715)
* 3675c70 Separate root domain and rfactor domain in TransformPrinter (#1716)
* f68b830 Fix scheduling with polymorphic broadcast (#1714)
* 4ab5ef7 updating_ci_machine (#1718)
* 56585c5 Merge pull request #1711 from csarofeen/upstream_master_bump_0517
* 174d453 Allow using nvFuser on CUDA extension (#1701)
* 18bee67 Validate LOOP concrete IDs have complete IterDomains (#1676)
```

Pull Request resolved: #78244

Reviewed By: ejguan

Differential Revision: D36678948

Pulled By: davidberard98

fbshipit-source-id: 0ccde965acbd31da67d99c6adb2eaaa888948105
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants