Summary:
With __name__ == "__main__" defined, MPI4Py was no longer being setup as intended, leading to test failures on syntax errors (_has_mpi, COMM, RANK and SIZE were no longer defined in a global scope. This is fixed via explicit use of global variables and factoring out the MPI setup into a new method.
Closes https://github.com/caffe2/caffe2/pull/59
Reviewed By: Yangqing
Differential Revision: D4348956
Pulled By: bwasti
fbshipit-source-id: ee741a0fff1df00eade1b6d5e1c281afcb38da6a
Summary:
An operator that reads labels compute their counts and generates huffman tree
hierarchy. It generates all paths from root node to leafs labels as serialized
HierarchyProto to be used as an input to HSoftmax operator.
The tree is constructed in a bottom up greedy way keeping indices to parent
nodes to in order to generate the code and the path from root to leave in
a bottom up traversal.
Note:
HSoftmax handels computing a generic hierarchy which means for the binary case
we can save one matrix x vector operation per node by representing every node as
logsitc function and also reduce the paths proto size by producing only
one integer list to represent the path / indices and bytes list for the code
per label.
Differential Revision: D4303294
fbshipit-source-id: c7f0d3c204536234c26bb2a4228cb3a1892db395
Summary:
This adds Caffe2 support for MKL operators directly with MKLMemory. Included a
Relu layer that shows how to use it.
Reviewed By: salexspb
Differential Revision: D4322144
fbshipit-source-id: 8b3392c4fd024ab1a7ba7135c349ebd3e1976799
Summary:
This is just a stub for now. I need to add a report metric as well before I can produce a complete flow.
Possible extensions:
Implement list-wise loss, allow for more than one session in a batch and create a framework for arbitrary loss functions to be applied
The data loader will be the same as for RNN
Reviewed By: xianjiec
Differential Revision: D4245176
fbshipit-source-id: 546683b6551654a37c410dc1606e556a7bf83a2a
Summary:
This renames the "Snapshot" op name to "Checkpoint" as we discussed earlier.
The early Snapshot name is still available, but we should move to the new name and
eventually deprecate the old name.
The Python SnapshotManager should be also changed, cc azzolini
Reviewed By: dzhulgakov
Differential Revision: D4272021
fbshipit-source-id: 4b8e029354416530dfbf0d538bfc91a0f61e0296
Summary: Allows to collect samples over multiple batches. The method uses a circular array and so there is no guarantee about the order of the samples. The goal is to get a view of the data accross multiple batches
Reviewed By: salexspb
Differential Revision: D4216181
fbshipit-source-id: bb9e1fa84ac7e04006dcddb53c9347a42ec83dc8
Summary: Added gradients for the Copy operators. They are simply the reverse operation. Also added a unit test to test things actually work and added the operator schema and registration to model_helper's known operators.
Differential Revision: D4306516
fbshipit-source-id: dd0633fa7f2ed01991990e56e63669794df037d9
Summary:
It gives a significant perf boost to do the parameter update inside MomentumSGD, instead of with a separate WeightedSum op.
To ensure backwards compatibility, I made it a separate op.
Also added an unit test.
Reviewed By: prigoyal
Differential Revision: D4262446
fbshipit-source-id: 38e7ee6d7677b398658ac7fe9b7a59b569e033f4
Summary: This is mainly for the OSS side checking.
Reviewed By: dzhulgakov
Differential Revision: D4238349
fbshipit-source-id: 061da3f721341c4a1249e1cc6c8c842fc505860f
Summary:
Needed by oss.
This is done by running the following line:
find . -name "*_test.py" -exec sed -i '$ a \\nif __name__ == "__main__":\n import unittest\n unittest.main()' {} \;
Reviewed By: ajtulloch
Differential Revision: D4223848
fbshipit-source-id: ef4696e9701d45962134841165c53e76a2e19233
Summary:
It was not just enough to register ReshapeOp for CUDA, since it does memory copy to/from tensors. This happened in two places: when assigning shape from a shape blob and when outputing a shape tensor.
Also changed the resizeoptest to use CUDA when available (this test was done before hypothesis-tests, so I had to do this manually)
Differential Revision: D4217342
fbshipit-source-id: 61761bac015f3731cf480ccef2563e9c80e0f4aa