Commit graph

23 commits

Author SHA1 Message Date
Simon Layton
d4bbcab558 Setup MPI before test start
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
2016-12-19 15:59:32 -08:00
Ahmed Taei
a8ae63c3e0 HuffmanTreeHierarchy operator
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
2016-12-16 10:59:48 -08:00
Yangqing Jia
42bbdda8c4 MKLDevice and MKLOperator
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
2016-12-15 19:59:24 -08:00
Maxime Boucher
dd74c5d3b8 Implement rank loss method using logit function and pairwise comparisons
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
2016-12-15 12:01:31 -08:00
Yangqing Jia
4858a6bc6f snapshot -> checkpoint
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
2016-12-15 12:01:30 -08:00
Maxime Boucher
4cd263db74 Last N window collector
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
2016-12-15 12:01:30 -08:00
Aapo Kyrola
6191de7ac9 gradients for CopyGPUToCPU and CopyCPUToGPU + unit test + schema
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
2016-12-15 12:01:29 -08:00
Aapo Kyrola
68cfc52452 MomemtumSGDUpdate -- version of MomentumSGD with update.
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
2016-12-15 12:01:29 -08:00
Ahmed Taei
2a95bd5239 Incremental MeanReducer segment Ops
Summary: Adding {Sorted|Unsorted}SegmentMean{Gradient|} operators.

Reviewed By: dzhulgakov

Differential Revision: D4185094

fbshipit-source-id: d4431e2a5a10a59570a491d63962668f248c0606
2016-11-29 15:18:38 -08:00
Yangqing Jia
be1f3ed1d7 Add a snapshot test for Simon Layton
Summary: This is mainly for the OSS side checking.

Reviewed By: dzhulgakov

Differential Revision: D4238349

fbshipit-source-id: 061da3f721341c4a1249e1cc6c8c842fc505860f
2016-11-29 15:18:38 -08:00
Yangqing Jia
5eb836880d Add unittest.main() lines to test scripts under python/operator_test
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
2016-11-29 15:18:37 -08:00
Aapo Kyrola
2fbf774e99 make ReshapeOp work with CUDA
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
2016-11-29 15:18:36 -08:00
Yangqing Jia
589398950f fbsync at f5a877 2016-11-18 15:41:06 -08:00
Yangqing Jia
238ceab825 fbsync. TODO: check if build files need update. 2016-11-15 00:00:46 -08:00
Yangqing Jia
44509f9f91 fbsync: mostly lint changes, added mkl files 2016-10-11 22:45:06 -07:00
Yangqing Jia
d1e9215184 fbsync 2016-10-07 13:08:53 -07:00
Yangqing Jia
b23e51d467 chunky sync 2016-09-06 15:55:19 -07:00
Yangqing Jia
05512d1e10 sync 2016-08-10 11:02:15 -07:00
Yangqing Jia
c15e45c9bb chunky sync again 2016-08-01 20:58:46 -07:00
Yangqing Jia
bcea409c82 sync 2016-07-28 15:06:43 -07:00
Yangqing Jia
09bed67e4f add untracked files 2016-07-21 11:26:41 -07:00
Yangqing Jia
6463eebc7b chunky sync - build scripts to be written 2016-07-21 10:16:42 -07:00
Yangqing Jia
559053d3a8 chunky sync 2016-05-13 14:43:48 -07:00