Skip to content

Use c10::List#20871

Closed
smessmer wants to merge 170 commits intoexport-D15476434from
export-D15476433
Closed

Use c10::List#20871
smessmer wants to merge 170 commits intoexport-D15476434from
export-D15476433

Conversation

@smessmer
Copy link
Contributor

@smessmer smessmer commented May 23, 2019

Stack:
    :black_circle:  #20871 Use c10::List  💛
    :white_circle:  #21164 List  💚

Integrate c10::List into IValue and the c10 dispatcher.

Differential Revision: D15476433

Ailing Zhang and others added 6 commits May 23, 2019 09:44
…20782)

Summary:
fix #20781 #20757
hmm I don't know an easy way to add a test to make sure it runs against a package installed as .egg. But i tested it locally with torchvision.
Pull Request resolved: #20782

Differential Revision: D15443600

Pulled By: ailzhang

fbshipit-source-id: 285eb0d9a44d6edb8e93618fa293f4feb431d2ae
Summary:
When adding custom scalars like this
```python
from torch.utils.tensorboard import SummaryWriter

with SummaryWriter() as writer:
    writer.add_custom_scalars({'Stuff': {
        'Losses': ['MultiLine', ['loss/(one|two)']],
        'Metrics': ['MultiLine', ['metric/(three|four)']],
    }})
```
This error is raised:
```
TypeError: Parameter to MergeFrom() must be instance of same class: expected tensorboard.SummaryMetadata.PluginData got list.
```

Removing the square brackets around `SummaryMetadata.PluginData(plugin_name='custom_scalars')` should be enough to fix it.
Pull Request resolved: #20580

Differential Revision: D15469700

Pulled By: orionr

fbshipit-source-id: 7ce58034bc2a74ab149fee6419319db68d8abafe
Summary: Pull Request resolved: #20832

Pulled By: driazati

Differential Revision: D15464693

fbshipit-source-id: 244f24d6917b17dde5e33ff852c716fb053b7ca5
Summary:
Pull Request resolved: #20829

as title

Reviewed By: jamesr66a

Differential Revision: D15461937

fbshipit-source-id: 02c7150c0e8d020030ae8898008f718c74850dca
Summary: Pull Request resolved: #20813

Differential Revision: D15466836

Pulled By: Krovatkin

fbshipit-source-id: ffdb418592b76dc67c65c59f4dc7303f08734f97
Differential Revision: D15476433
Differential Version: 82905568
@pytorchbot pytorchbot added caffe2 oncall: jit Add this issue/PR to JIT oncall triage queue module: cpp Related to C++ API module: internals Related to internal abstractions in c10 and ATen labels May 23, 2019
@smessmer smessmer mentioned this pull request May 23, 2019
Jonas1312 and others added 10 commits May 23, 2019 12:11
Summary:
Close #20642

Possibly broken by #19816
Pull Request resolved: #20853

Differential Revision: D15474620

Pulled By: jerryzh168

fbshipit-source-id: 99b52d92a93bac7cab52537f1ebdbd286d4b2cfe
Summary: Pull Request resolved: #20799

Reviewed By: wanchaol

Differential Revision: D15447891

fbshipit-source-id: e34de946c79282fb934a5c52ff1def41c7993c75
Summary: Pull Request resolved: #20800

Differential Revision: D15447892

fbshipit-source-id: 78e76523c5412c020a2bc22d6998ff7b36356720
Summary: Pull Request resolved: #20820

Reviewed By: dzhulgakov

Differential Revision: D15455866

fbshipit-source-id: 712b06dfbd441051dc284a1acdf94926df09bc1d
Summary:
Minor typo fix.
Pull Request resolved: #20797

Differential Revision: D15469308

Pulled By: ezyang

fbshipit-source-id: 3288ad69316e296e46d861737c5b09e0ea1e694b
Summary:
This PR changes CPU implementation of `AdaptiveAveragePool2D` by
- move dispatch to outside the OpenMP loop
- support fp16
Pull Request resolved: #20366

Differential Revision: D15456069

Pulled By: ezyang

fbshipit-source-id: 00fa2916f8b136af9f5c8b5db0eca4619f9f5bac
Summary:
Pull Request resolved: #20620
ghimport-source-id: 7c09c24

Differential Revision: D15454050

Pulled By: ezyang

fbshipit-source-id: 5b0421c56445baf19dbdbdd9680af128a5cdf443
Summary:
This tries to fix the following error on current master:
```
May 23 16:18:47 Traceback (most recent call last):
May 23 16:18:47   File "main.py", line 7, in <module>
May 23 16:18:47     from torchvision import datasets, transforms
May 23 16:18:47   File "/opt/conda/lib/python3.6/site-packages/torchvision/__init__.py", line 1, in <module>
May 23 16:18:47     from torchvision import models
May 23 16:18:47   File "/opt/conda/lib/python3.6/site-packages/torchvision/models/__init__.py", line 11, in <module>
May 23 16:18:47     from . import detection
May 23 16:18:47   File "/opt/conda/lib/python3.6/site-packages/torchvision/models/detection/__init__.py", line 1, in <module>
May 23 16:18:47     from .faster_rcnn import *
May 23 16:18:47   File "/opt/conda/lib/python3.6/site-packages/torchvision/models/detection/faster_rcnn.py", line 7, in <module>
May 23 16:18:47     from torchvision.ops import misc as misc_nn_ops
May 23 16:18:47   File "/opt/conda/lib/python3.6/site-packages/torchvision/ops/__init__.py", line 1, in <module>
May 23 16:18:47     from .boxes import nms, box_iou
May 23 16:18:47   File "/opt/conda/lib/python3.6/site-packages/torchvision/ops/boxes.py", line 2, in <module>
May 23 16:18:47     from torchvision import _C
May 23 16:18:47 ImportError: /opt/conda/lib/python3.6/site-packages/torchvision/_C.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN2at19NonVariableTypeMode10is_enabledEv
```
Pull Request resolved: #20865

Differential Revision: D15481736

Pulled By: yf225

fbshipit-source-id: 67d4fd70652ccc709b44cb15392d6e44a8fe9235
Summary:
Pull Request resolved: #20833

Att. The algorithm is still "horrendously inefficient". But since we are sunsetting Nomnigraph, I just did the minimal fix here.

Reviewed By: tracelogfb

Differential Revision: D15463880

fbshipit-source-id: 413a1280a92c1923ba49031177816a2d5f888575
Differential Revision: D15476433
Differential Version: 82944512
pk-g and others added 8 commits May 23, 2019 14:48
Summary: Pull Request resolved: #20116

Differential Revision: D15256899

Pulled By: houseroad

fbshipit-source-id: cf0dfd679d528fbb77f483e23071f4a96fb27091
Summary:
Pull Request resolved: #20669

Before, Dict was a value type, i.e. copying it did a deep copy.
Unfortunately, this doesn't work well with storing and passing Dicts around in IValues because IValues are reference types.
This diff changes Dict to be a reference type.

Reviewed By: dzhulgakov

Differential Revision: D15404911

fbshipit-source-id: dc990d3eb7cae044b74dd0253f8b704dde6a6c86
Summary: Pull Request resolved: #20890

Differential Revision: D15486657

Pulled By: bddppq

fbshipit-source-id: 3acd7386d1f070cad9bd43d6e74244b706c0dc16
Summary:
Pull Request resolved: #20760
ghimport-source-id: eb667c3

Reviewed By: jamesr66a

Differential Revision: D15486511

Pulled By: suo

fbshipit-source-id: 56ae930a01b0f6f4305a2a745135d4529b4a1ca0
Reviewed By: yns88

fbshipit-source-id: 58b230ad12620032f391733c7f9c1e44aeaa390b
Reviewed By: yns88

fbshipit-source-id: 17161d7e1e742b402715f8ed006e5b3abfa78561
Summary:
Pull Request resolved: #20180

Adding ShufflenetV2 (by Ma et. al. 2018) to the caffe2's benchmark
suite.

To run, use: `buck run mode/opt caffe2/caffe2/python/examples:imagenet_trainer -- --train_data null --batch_size 128 --epoch_size 3200 --num_epochs 2 --num_gpus 2 --model shufflenet`

Reviewed By: bddppq, xw285cornell

Differential Revision: D15094282

fbshipit-source-id: 0e1ce9c5975868e917b0f179e2c5b15647a76b4e
Summary:
As part of the Variable/Tensor merge work: #13638, we make the following changes in this PR:
1. Remove the `Variable::Impl` class and the `DifferentiableViewImpl` class
2. Change all `Variable.data()` call sites to either use `Variable` directly, or use `Variable.tensor_data()`
3. Remove `Variable.data()` API
3. Add `Variable.variable_data()` that matches `tensor.data` in Python API, which creates a new `Variable` that shares the same storage and tensor metadata with the original `Variable`, but with a completely new autograd history.

After this PR, Variable doesn't wrap a Tensor internally anymore, and both Variable and Tensor use the same TensorImpl class as its `impl_`. The only difference is that Variable always has AutogradMeta in its TensorImpl, but Tensor doesn't.

**Note that this PR is BC-breaking in the following use cases:**

**Use Case 1:**
Previously, `x.data = y` works even if `x` and `y` are of different TensorImpl type (e.g. `x` is a CPU dense tensor whose impl is of type TensorImpl, while `y` is a CPU sparse tensor whose impl is of type SparseTensorImpl). However, after this PR, `x.data = y` doesn't work anymore if `x` and `y` are of different TensorImpl type, because the underlying implementation `variable.set_data(tensor)` no longer works if `variable` and `tensor` have different TensorImpl type.

**Use Case 2:**
If a tensor `x`'s `grad` is sparse, accumulating dense gradients to `x` will change the tensor that `x.grad` is pointing to. This is better illustrated with the following example:
```python
params = torch.tensor([1.5, 1.5]).requires_grad_()
with torch.no_grad():
    # Change gradient to a sparse tensor
    params.grad = torch.sparse_coo_tensor(torch.tensor([[1, 1]]).long(), torch.tensor([1., 1.]))

grad_saved = params.grad
params.backward(torch.tensor([1.5, 1.5]))
assert id(grad_saved) == id(params.grad)  # This will fail after this PR
```
The assertion in the last line will fail after this PR, because adding dense gradients to sparse gradients will change the `params.grad` tensor reference.
Pull Request resolved: #17072

Differential Revision: D14075257

Pulled By: yf225

fbshipit-source-id: 0e681df641270dea586042dd26db59f2e76b5957
Ilia Cherniavskii and others added 4 commits May 30, 2019 00:16
Summary:
Pull Request resolved: #21122

fix a typo

Reviewed By: dzhulgakov

Differential Revision: D15553921

fbshipit-source-id: 260b0be5975d49bb6d70e45d83505efcecf02875
…from Tensor method

Differential Revision:
D15477933

Original commit changeset: c8aa81f681e0

fbshipit-source-id: ec494fbbab72e20da262bdd8657887e1fdd173cb
…ceRange and report in highlight

Differential Revision:
D15552424

Original commit changeset: 78d0f0de03f7

fbshipit-source-id: cc24f62189b7bbcdc1406912cfb3d4ca52b8e67e
Summary:
Pull Request resolved: #21142
ghimport-source-id: 4666c0731d9c08e9990ffafd0ae88fa1e7896348

Differential Revision: D15555285

Pulled By: ezyang

fbshipit-source-id: 9e5bfacf202ceba37bd29cfd5dcb651b7f79068d
@smessmer smessmer closed this May 30, 2019
Differential Revision: D15476434
Differential Version: 83701491
@smessmer smessmer reopened this May 30, 2019
Differential Revision: D15476433
Differential Version: 83701493
@pytorchbot pytorchbot added module: build Build system issues module: ci Related to continuous integration module: docs Related to our documentation, both in docs/ and docblocks module: infra Relates to CI infrastructure module: third_party labels May 30, 2019
@smessmer smessmer mentioned this pull request May 30, 2019
smessmer added 5 commits May 30, 2019 13:57
Differential Revision: D15476434
Differential Version: 83720045
Differential Revision: D15476433
Differential Version: 83720048
Differential Revision: D15476433
Differential Version: 83736530
Differential Revision: D15476434
Differential Version: 83738373
Differential Revision: D15476433
Differential Version: 83738374
@smessmer
Copy link
Contributor Author

Something screwed up this PR. Will re-export

@smessmer smessmer closed this May 30, 2019
@smessmer smessmer deleted the export-D15476433 branch May 30, 2019 22:37
@smessmer
Copy link
Contributor Author

new version: #21177

@smessmer smessmer mentioned this pull request May 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

caffe2 module: build Build system issues module: ci Related to continuous integration module: cpp Related to C++ API module: docs Related to our documentation, both in docs/ and docblocks module: infra Relates to CI infrastructure module: internals Related to internal abstractions in c10 and ATen module: third_party oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.