Commit Graph

1604 Commits

Author SHA1 Message Date
Pooya Davoodi
37dec493a5 Scope MultiRNN blobs with name as well as layers (#2025)
* Scope MultiRNN blobs with name as well as layers

Also don't double scope MultiRNN in case of multiple layers.

* Scope input projection of first layer with name

We don't scope it with layers because the projection is done
outside of the layer.

* Avoid scoping input blob in MemongerTest.test_rnn

* Rectify input_blob in prepare_input

Revert change in memonger_test because rectifying input will solve the problem.
2018-03-02 22:21:07 -08:00
Qinqing Zheng
d013e16cf4 [C2] Enable LARS on GPU (#2115) 2018-03-02 18:06:19 -08:00
Joseph Spisak
11a736b682 Sqrt op (#2101)
* First attempt on sqrt op

* Adding the Sqrt op along with the test cases

* Made changes per @Yangqing's questions re: tensor format and used hypothesis to generate input tensor
2018-03-02 16:19:45 -08:00
Mohammad Hossain
349238f5bf Mean Op (#2072)
* Mean Op

* Mean Op

* Mean Op

* Fix gradients and include seed for randomized input generation

* Update test strategies parameters
2018-03-02 16:18:17 -08:00
Xiaomeng Yang
558e2a92df Revert update on top_k_op (#2119) 2018-03-02 16:07:45 -08:00
Xiaomeng Yang
c70beed31c Add axis to top_k_op. 2018-03-02 15:21:31 -08:00
Alexander Sidorov
1af7df6e78 fix rnn_cell_test in fbcode (#2107) 2018-03-01 21:02:52 -08:00
Lu Fang
1981557751 Add README and ONNXOpCoverage doc back (#2102)
* Add README and ONNXOpCoverage doc back

* Polish the coverage table again

* Remove onnx-caffe2 from title
2018-03-01 17:05:25 -08:00
Lu Fang
aa5145bf14 Enable onnx backend test on pow, ceil and floor (#2103) 2018-03-01 15:33:58 -08:00
anderspapitto
c0304c83b1 Copy some outputs in order to decouple storage (#2105)
so that mutating one of them does not mutate the others
2018-03-01 13:25:31 -08:00
anderspapitto
749a17661c Introduce padding op to mimic pytorch semantics in ONNX export (#2069)
In pytorch, after pad_packed_sequence, the "extra" elements (after the
ends of the sequences) are reset. In the equivalent Caffe2 graph
exported via ONNX, they contained some leftover values, which caused
tests to fail. Probably no one depends on these values, but just in
case, set them to zero to mimic pytorch semantics.
2018-02-28 15:44:54 -08:00
Orion Reblitz-Richardson
5c381bbc57 Patch cuda-convnet2 from internal Facebook changes.
* Unfortunately this needs to be manually monkey patched.
* This should get it so GitHub and fbcode versions match.
2018-02-28 14:20:48 -08:00
Lu Fang
eb612b09e9 Fix Caffe2 ==> ONNX converter to handle three models (#2058)
* Handle legacy pad in Caffe2==>ONNX converter, also remove fake initializer

* Address the comments, 1) have filtering fake initializer before ssa rewrite, 2) polish the legacy padding handling logic

* Add test cases to cover the code just added

* Nit
2018-02-28 11:55:49 -08:00
anderspapitto
76304300a8 Transpose shape inference (#2057)
* fix variable name

* enhance shape inference to handle transpose

in the case arising from pack_padded(..., batch_first=True)
2018-02-27 11:51:10 -08:00
anderspapitto
ec547ce640 RNN ONNX export: concat hidden/cell states on the right axis (#2055)
Test Plan: existing tests in onnx-fb-universe catch this, modulo a bug
in the tests which I am fixing in a separate diff
2018-02-26 11:04:04 -08:00
Orion Reblitz-Richardson
028bc2f23f [C2 OSS][GPU]exposing totalGlobalMem info to workspace python
exposing totalGlobalMem info to GetDeviceProperties method so that users
can have better understanding
2018-02-26 10:26:25 -08:00
Orion Reblitz-Richardson
c55a642d83 [c2] update SparseFeatureHash layer
The diff makes following changes for this layer: copy length blob; add nameScope for output schema; add layer tests
2018-02-26 10:26:25 -08:00
Orion Reblitz-Richardson
e397367db0 GatherRangesToDenseOp supporting sorting with keys
Added functionality to GatherRangesToDenseOp such that it supports an optional input KEY, and will sort DATA according to KEY for each example per feature.
2018-02-26 10:26:25 -08:00
Qinqing Zheng
7cafdab69b [C2] Implement Layer-wise Adaptive Rate Scaling (LARS) (#2034)
* [C2] Implement Layer-wise Adaptive Rate Scaling (LARS)

* [C2] Implement Layer-wise Adaptive Rate Scaling (LARS)

* add unit test for Lars

* set default value for lars to be None

* remove lars for subclasses of SgdOptimizer
2018-02-25 14:58:31 -08:00
PengBo
07646e405e no_bias in resnet32x32 (#1817) 2018-02-24 16:58:23 -08:00
Lu Fang
c1919b370b Skip Cast ONNX backend test, which is not supported in Float16 case (#2005) 2018-02-24 03:51:08 -08:00
Qinqing Zheng
b3fdfa7bd6 [DT] [4/n] Make epoch_group explicit for JobRunner (#2018) 2018-02-23 10:41:52 -08:00
Yinghai Lu
c249f49ddd Rename caffe2_ref_test.py to c2_ref_test.py (#2016)
* Rename caffe2_ref_test.py to c2_ref_test.py

* Rename the module name doc too
2018-02-22 20:22:39 -08:00
Bram Wasti
51897e52da fix all the broken tests from adding debug info (#2013) 2018-02-22 17:43:53 -08:00
anderspapitto
38f18c1daa add third output in onnx -> caffe2 lstm conversion (#2011) 2018-02-22 17:43:33 -08:00
Bram Wasti
4e5df5cda6 added debug info to OperatorDef 2018-02-22 15:53:49 -08:00
Orion Reblitz-Richardson
3ee9b5edca [PR] Floor and Ceil Op
Closes https://github.com/caffe2/caffe2/pull/1932
GitHub Author: Mohammad Hossain <zem@devgpu242.prn2.facebook.com>
2018-02-21 18:31:45 -08:00
Orion Reblitz-Richardson
ccea6924a2 Implementing Pow operator (this merges existing pow with a scalar and new pow with a tensor exponent). Second Try.
The old pow operator has been deleted in math_ops.cc, math_ops.cu and math_ops.h, while the new operator supporting scalar and tensor exponent has been added in pow_op.cc, pow_op.h an elementwise_op.cu.
2018-02-21 18:31:45 -08:00
Yinghai Lu
cc7e61c88d Move onnx-caffe2 inside caffe2 (#1921)
* Move onnx-caffe2 inside caffe2

* Update to the lastest onnx-caffe2 and update jenkins env

* Rename onnx_caffe2 to onnx

* Add __init__.py to caffe2/python/onnx

* Change CI check variable to JENKINS_URL

* Cherrypick recent onnx-caffe2 update
2018-02-20 13:56:52 -08:00
Yan Zhu
36c49c9f4a change schema's __repr__() flat output to pprint style indented output
Summary: as title. This is similar with python pprint utility for nested json data structure. It can be useful for checking schema during debugging.

Reviewed By: kittipatv

Differential Revision: D6710767

fbshipit-source-id: e450aa5477fa1ad4f93c4573f8108a2f49956da8
2018-02-16 16:26:11 -08:00
Frank Jiang
c809d89810 Fix RowWiseSparseAdam implementation
Summary: The original implementation averaged the momentum across the embedding dimensions, which doesn't make any sense. This meant all the embedding dimensions received the same update, becoming a very memory-expensive one-dimensional embedding.

Differential Revision: D7003135

fbshipit-source-id: ed54e3427bc13895a4e949e96b4b17f6ebfb6d53
2018-02-16 13:28:26 -08:00
Andrey Malevich
60dc3ca66f Use 8-bit quantization only in cases when it makes sense.
Summary:
In some cases we were doing quantization even we we should not. This diff is
preventing this from happening.

Reviewed By: rayleichen

Differential Revision: D6953547

fbshipit-source-id: 7c65baaf969e5e1bddb68ca8182f4f3b43f2431d
2018-02-15 19:33:03 -08:00
Xianjie Chen
c5497a34f6 Add CPU_ONLY tag for sparse_feature_hash layer
Summary: as desc.

Differential Revision: D6997841

fbshipit-source-id: 75a33ea146224979f149a36a063a78d6f18338ee
2018-02-15 19:05:56 -08:00
Andrey Malevich
16cd3f4a9e Don't allow to export models where parameters are inputs/outputs
Summary:
Without this enforce it's too easy to export model overriding it's params in
predictor.

Reviewed By: rayleichen

Differential Revision: D6984506

fbshipit-source-id: 9bbf375758686c6ad12ad071723f255363e98ae6
2018-02-14 23:54:42 -08:00
Yan Zhu
0a66c76a4c detailed error output for parameter sharing
Reviewed By: xianjiec

Differential Revision: D6986239

fbshipit-source-id: 5b8bb06ea2383ce64318b5322bda7a58469f3eb0
2018-02-14 11:10:51 -08:00
Pieter Noordhuis
52fa742c51 Revert D6893040: Implementing Pow operator (this merges existing pow with a scalar and new pow with a tensor exponent).
Summary:
This reverts commit 30f614beea6f859fee25ce4f85573142885dde45

bypass-lint

An infra SEV is better than not reverting this diff.
If you copy this password, see you in SEV Review!
cause_a_sev_many_files

Differential Revision:
D6893040

Original commit changeset: 30f614beea6f

fbshipit-source-id: 5e98a24699088283f864efe31234874bdacbe3c3
2018-02-14 10:34:08 -08:00
Maxim Naumov
f7cc8e8822 Implementing Pow operator (this merges existing pow with a scalar and new pow with a tensor exponent).
Summary: The old pow operator has been deleted in math_ops.cc, math_ops.cu and math_ops.h, while the new operator supporting scalar and tensor exponent has been added in pow_op.cc, pow_op.h an elementwise_op.cu.

Reviewed By: houseroad

Differential Revision: D6893040

fbshipit-source-id: 30f614beea6f859fee25ce4f85573142885dde45
2018-02-13 17:46:35 -08:00
Yan Shang
fd28e0fa29 Add bool function to return whether a model contains loss
Summary:
Add a function to return true if the model contains loss and retuen
false if the model doesn't include a loss.

Reviewed By: kittipatv

Differential Revision: D6982444

fbshipit-source-id: 1f63b7a1eaa3077841a0ad5d8d854b471d0aa84c
2018-02-13 16:38:36 -08:00
Kittipat Virochsiri
83c494787d Allow adding to trainer_extra_schema
Summary: Sometimes we need to add some extra schema later

Reviewed By: sunnieshang

Differential Revision: D6951849

fbshipit-source-id: 564eb88f9250eae24869fd10ba3426e00a18af33
2018-02-13 14:40:36 -08:00
Kittipat Virochsiri
6f533fd8b8 Only overwrite path_prefix & path_type when not None
Summary: This breaks internal functionality

Reviewed By: aartibasant

Differential Revision: D6975222

fbshipit-source-id: ce751950b4b9217d8ea5de703690451e98642f00
2018-02-13 14:40:35 -08:00
Matan Appelbaum
d99d28b3e6 Allow custom component tagging in DeviceOptions.node_name
Summary:
Modify detect_components to take a list of valid node_name prefixes instead of values.  Users can set node_name to e.g. `'sparse_component:0'`, `'sparse_component:1'`, etc.
and pass `'sparse_component:'` as a valid prefix.  Also add `Tags.SPARSE_COMPONENT` in addition to `Tags.SPARSE_SHARDED` and `Tags.SPARSE_DONT_SHARD` and update all calls to
`detect_device_components`.

Reviewed By: azzolini

Differential Revision: D6952599

fbshipit-source-id: e1b1e6b146a6bd053b295690016044fd5990c893
2018-02-13 11:14:41 -08:00
Junjie Bai
b11ba65204 Experimental support for setup.py develop mode install
Summary:
`python setup.py develop` / `pip install -e .`
Closes https://github.com/caffe2/caffe2/pull/1926

Reviewed By: orionr

Differential Revision: D6951780

Pulled By: bddppq

fbshipit-source-id: 01249cbca90ec5326ea4107d4e500ae95a9dbd7b
2018-02-12 23:36:18 -08:00
Zhicheng Yan
d79a31761e rectangle_cropping_multi_cropping_color_jittering_lighting
Summary:
Change log
- Support rectangle cropping, where height and width of clip cropping can be set separately. This is useful when most video resolution is non-square, such as 240p, 360p and 480p where width is significantly larger than height.
  - Comparisons of training on ucf101 between using 112x112 croppings and using 112x144 cropping.
  - https://fburl.com/i0rw6y1k
- Support 14 multi-cropping per video clip at testing stage to improve classification accuracy. Take left-top, central-top, right-top, left-bottom, central-bottom, right-bottom and central-central croppings as well as their mirrorings. In total, 14 croppings.
   - Comparisons on the same model trained on UCF-101. Use 1 clip per video
      - RGB. f41014306, w/o Vs f41014868, w/ multi-cropping: `0.64099 Vs 0.65796`
      - OF. f41014889, w/o Vs f41014913, w/ multi-cropping: `0.65796 Vs 0.67624`

- Support color jittering and color lighting on RGB data for training data augmentation.
  - Comparisons of training on ucf101 from scratch with and without color jittering and lighting:
  - https://fburl.com/k69zatul

Reviewed By: HengCV

Differential Revision: D6962620

fbshipit-source-id: 9b43478945874142727fea351ee04417218e6606
2018-02-12 16:39:06 -08:00
Jesse Hellemn
1c005602fc Adding model_id argument to nets in predictor_container when modelInfo exists
Summary: Copying model_id from metaNetDef_->modelInfo in PredictorContainer for dper models. Since these model_id's are strings of <model_id>_<snapshot_id>, changed them to strings in net_observer

Reviewed By: salexspb

Differential Revision: D6752448

fbshipit-source-id: 93c91950b44c012e57240aaf909bc961449cfd7c
2018-02-12 10:38:58 -08:00
Lukasz Wesolowski
78c9a35a84 GPU support for ChannelStatsOp
Summary: Step 1 of 3 in adding support for multidevice batch normalization on GPUs. Implements ChannelStatsOp for the GPU. Next steps are to port the backprop stats op and tie things together in DPM.

Reviewed By: rbgirshick

Differential Revision: D6953411

fbshipit-source-id: cd50e53d66ea84fe66021c08b978b28290d9f347
2018-02-09 19:31:31 -08:00
Kittipat Virochsiri
51267095d5 Remove enqueue_splits() from ReaderBuilder
Summary: The interface is not used anywhere AFAICT; cleaning up to make it less confusing.

Reviewed By: kuttas

Differential Revision: D6867040

fbshipit-source-id: 3e8a77df76ef09c6864c308561825777b326f76c
2018-02-09 12:20:53 -08:00
Zhicheng Yan
06f8fc3f49 extend_operator_CostInferenceFunction
Summary:
- Extend SimpleNet::TEST_Benchmark to report extra FLOP, feature map memory, parameter memory at operator-level
- Add cost interfence function for 3D conv, sum, relu, spatial_bn, fc operators.

Reviewed By: sf-wind

Differential Revision: D6909893

fbshipit-source-id: 534492ccf2e15860e86f1e7f759ff338bf57753f
2018-02-09 10:56:29 -08:00
Lin Yang
cec7003190 only enable FloatToHalf test for GPU
Reviewed By: bddppq

Differential Revision: D6945312

fbshipit-source-id: 9550a9607c0daec6783ce63d3c9f082ff27b0303
2018-02-08 17:48:47 -08:00
Lin Yang
27b9b7b15a Make TypeInference work for HalfToFloat & FloatToHalf.
Summary: add missing type mapping.

Reviewed By: kennyhorror

Differential Revision: D6940574

fbshipit-source-id: b70cea4ce2e519cb3e72d0482a38f50dbb968b4a
2018-02-08 15:33:43 -08:00
Andrew Dye
6ecaed5021 Generate a core dump when CompleteInTimeOrDie forcefully quits
Summary: CompleteInTimeOrDie was added to detect deadlocks and proactively exit. In addition, call os.abort() to generate a core dump so that the error is actionable.

Reviewed By: bmaurer

Differential Revision: D6938343

fbshipit-source-id: 8bd36da4f4bb1195bd3398f25d133a6ebf1c66ad
2018-02-08 14:08:51 -08:00