Commit Graph

1944 Commits

Author SHA1 Message Date
Pooya Davoodi
56fa6ec66a [caffe2] Change iteritems in trt/transform.py to items for python3 compatibility (#7599) 2018-05-15 20:32:06 -07:00
anderspapitto
284f13b814
make sure that pytorch and caffe2 usage lines up with onnx rnn spec (#7511) 2018-05-14 15:42:56 -07:00
bddppq
c84fdda582 Skip onnx backend tests for inverse trigonometric ops (#7533) 2018-05-13 08:41:28 -07:00
Xiaomeng Yang
921dece2d7
Update Im2ColNd functions (#7505)
Update Im2ColNd functions
2018-05-12 15:59:50 -07:00
Yinghai Lu
ed3b12e1ba
[Caffe2] Ideep net optmization passes (#7514)
* Transform ideep net

* Add conv+relu transformation

* Add verification and address comments
2018-05-11 23:50:18 -07:00
Yinghai Lu
2863d935b9
[Caffe2] Fix of the performance issue of IDEEP (#7503)
* Sketch fix of the performance issue of IDEEP

* Revert CMakefile

* Fix tests

* format

* comments

* Print error

* review comments
2018-05-11 13:43:41 -07:00
Paul Jesse Hellemn
b875fb281c
Update from facebook (#7451)
* [bootcamp] Improve "Shape" operator to support axes specification

To improve .shape operator of Caffe2 to support x.shape(tensor, axes), which takes an optional int array "axes" as input. For example, x.shape(tensor, [1, 0]) will return the dimension for axis 1 and 0 following the specified order. For current version, "axes" input allows duplications and can have arbitrary length.

* Back out "Add barrier net that runs before training nets"

Original commit changeset: b373fdc9c30f. Need additional changes to some callers to support barrier failures.

* Change warning to verbose log to reduce log spam

The `LOG(WARNING)` was a bit spammy for regular use so lets just make it a `VLOG`.

* Extract the shared code from different caffe2_benchmark binaries

The OSS benchmark and Internal benchmark will share most functions in the benchmark.

* Support MFR in sequence training

As titled.

* Make knowledge distillation work with using logged prediction feature as teacher label.

1) Add loading raw dense feature as teacher label.
2) Optional calibration function for teacher label
3) Add teacher label into generic unit test
4) Deprecated TTSN workflow version using feature_options to config teacher label

* [C2/CUDA]: unjoined cross entropy sigmoid

as desc

* Add async_scheduling executor into deferrable_net_exec_test

Add async_scheduling into tests and fix some exception cases

* Fix Event disabled error

When disabling event in RNN ops make sure we don't call Finish on disabled
event from op's RunAsync

* cuda ensure cpu output op can handle both TensorCPU and TensorCUDA

as desc.

* [C2 Core] Infer input device option in C2 hypothesis_test checkers

Improve how we default input blob device options.
Previously it defaults as where op lives but it is not necessarily the case.

For example:
CopyCPUToGPU

* [C2 Op]SplitByLengthsOp CPU/GPU implementation

[C2 Op]SplitByLengthsOp CPU/GPU implementation

* fix undefined symbol error

not sure why we're getting undefined symbol even with link_whole = True
Need to figure out why but need this workaround for now

* Add tools in DAIPlayground platform to help debugging models

Add additional tools to allow Plauground override individual method defined in AnyExp.  This will allow user to create module that specificly change certain default method behavior.  An example included in this diff is deactivating test model and checkpointing.  When debugging any model problems, switching off components helps me quickly narrow down the location of the bug.  The technique is extensively used in task T27038712 (Steady memory increase in EDPM, eventually resulting in gloo/cuda.cu:34: out of memory)

* add shape and type inference for int8 conversion operator

* Fix flaky test for group_norm

Fix flaky test for group_norm

* Fix group_norm_op_test flaky

Fix group_norm_op_test flaky

* Implementation of composite learning rate policy

In many state-of-the-arts deep learning works, people use a simple trick to
schedule the learning rate: use a fixed learning rate until error plateaus
and then switch to a different fixed learning rate, and so on. In this diff,
we implemented a simple version of the composite learning rate. The user gives
a set of learning rates policies and corresponding iteration nums, and the
optimizer will change the learning rate policy based on the number of iterations so far.

For example, the user give two learning rate policies, one is FixedLearningRate
and PolyLearningRate, with an iteration number of 1k. Then the first 1k iteration,
we use FixedLearningRate. For the following iterations, we use PolyLearningRate.

* Split two use cases of CachedReader into two classes, DBFileReader and CachedReader

# Use Cases:

1). input: DB file -> output: DatasetReader.

Use DBFileReader.

2). input: Reader -> build cache DB file -> output: DatasetReader.

Use CachedReader.

# Changes to CachedReader:

1). Move db_path to the constructor.
Because in mock reader. cache will always be built ahead.

# Changes to tests:

1). Make a separate TestCase class for CachedReader and DBFileReader.

2). Make it possible to add more test functions by adding setUp, tearDown and _make_temp_path.

3). Make delete db_path more general. `db_path` could be a file for `log_file_db`, but could also be a directory for `leveldb`.

* Back out "On Mobile phones, call GlobalInit with no arguments in predictor in case we need to perform initialization"

Original commit changeset: 4489c6133f11

* Fix LARS bug

Fixed a bug in the LARS implementation which caused all subsequent blobs not using LARS to have the LARS learning rate multiplier applied to them.

* [tum] support sparse init & add uniformFill option

as title

* Propagate exception for async nets

Capture the exception when an exception is thrown in async nets and re-throw it after wait().  This allows exceptions to be propagated up to the caller.

This diff was a part of D7752068.  We split the diff so that C2 core files changes are in a separate diff.

* Automatic update of fbcode/onnx to 69894f207dfcd72d1e70497d387201cec327efbc

Previous import was 403ccfbd0161c38f0834413d790bad0874afbf9a

Included changes:
- **[69894f2](https://github.com/onnx/onnx/commit/69894f2)**: Use op schema.all tensor types in random like definitions (#865) <Scott McKay>
- **[b9d6b90](https://github.com/onnx/onnx/commit/b9d6b90)**: Clarify random like operators (#846) <Scott McKay>
- **[fc6b5fb](https://github.com/onnx/onnx/commit/fc6b5fb)**: Refactor shape inference implementation (#855) <anderspapitto>
- **[b7d8dc8](https://github.com/onnx/onnx/commit/b7d8dc8)**: fix cmake warning message (#863) <Eric S. Yu>
- **[f585c5d](https://github.com/onnx/onnx/commit/f585c5d)**: add pytorch-operator test for tile (#831) <Wenhao Hu>
- **[993fe70](https://github.com/onnx/onnx/commit/993fe70)**: add install step (#832) <Eric S. Yu>
- **[68bc26c](https://github.com/onnx/onnx/commit/68bc26c)**: add type inference for traditional ml ops except classifier ops. (#857) <Ke Zhang>
- **[9cc0cda](https://github.com/onnx/onnx/commit/9cc0cda)**: fix string representation of scalar types (#858) <G. Ramalingam>
- **[1078925](https://github.com/onnx/onnx/commit/1078925)**: fix y in pow test case to scalar (#852) <Wenhao Hu>
- **[c66fb6f](https://github.com/onnx/onnx/commit/c66fb6f)**: Add some math function shape inference (#845) <anderspapitto>
- **[ff667d1](https://github.com/onnx/onnx/commit/ff667d1)**: Refactor return type and docs for ONNXIFI_BACKEND_DIRECTX_ID (#853) <Marat Dukhan>
- **[11c6876](https://github.com/onnx/onnx/commit/11c6876)**: clear initializer names when clear initializer (#849) <Wenhao Hu>
- **[73c34ae](https://github.com/onnx/onnx/commit/73c34ae)**: Clarify FeatureVectorizer description. (#843) <Scott McKay>
- **[1befb9b](https://github.com/onnx/onnx/commit/1befb9b)**: Remove useless text in docs (#850) <Lu Fang>
- **[e84788f](https://github.com/onnx/onnx/commit/e84788f)**: Fix SELU attributes' default values (#839) <Lu Fang>
- **[ebac046](https://github.com/onnx/onnx/commit/ebac046)**: Add tile test case (#823) <Wenhao Hu>
- **[8b7a925](https://github.com/onnx/onnx/commit/8b7a925)**: a few more shape inference functions (#772) <anderspapitto>
- **[9718f42](https://github.com/onnx/onnx/commit/9718f42)**: Make the coefficient non optional for LinearClassifier (#836) <Jaliya Ekanayake>
- **[ef083d0](https://github.com/onnx/onnx/commit/ef083d0)**: Add save_tensor and load_tensor functions for Protos (#770) <Lu Fang>
- **[45ceb55](https://github.com/onnx/onnx/commit/45ceb55)**: Check if CMAKE_BUILD_TYPE set before project(). (#812) <Sergii Dymchenko>
- **[4b3d2b0](https://github.com/onnx/onnx/commit/4b3d2b0)**: [WIP] reenable shape inference tests (#834) <anderspapitto>
- **[22d17ee](https://github.com/onnx/onnx/commit/22d17ee)**: RNN tests: LSTM, GRU, SimpleRNN (#739) <Peyman Manikashani>
- **[de65b95](https://github.com/onnx/onnx/commit/de65b95)**: dimension denotation (#443) <Tian Jin>
- **[eccc76e](https://github.com/onnx/onnx/commit/eccc76e)**: fix field number issue in onnx operator proto and enable its build (#829) <Ke Zhang>
- **[d582beb](https://github.com/onnx/onnx/commit/d582beb)**: disable shape inference test to unbreak ci (#830) <Lu Fang>
- **[485b787](https://github.com/onnx/onnx/commit/485b787)**: function proto for composite op. (#802) <Ke Zhang>
- **[cd58928](https://github.com/onnx/onnx/commit/cd58928)**: specify defaults for attributes of Affine op (#820) <G. Ramalingam>
- **[7ee2cf9](https://github.com/onnx/onnx/commit/7ee2cf9)**: merge the dummy backend back into the main one (#743) <anderspapitto>
- **[1c03a5a](https://github.com/onnx/onnx/commit/1c03a5a)**: [Proposal] ONNX Interface for Framework Integration (previously ONNX Backend API) header and docs (#551) <Marat Dukhan>
- **[3769a98](https://github.com/onnx/onnx/commit/3769a98)**: Rename real model test case from VGG-16 to ZFNet (#821) <Lu Fang>

* [C2]ReluN Op

relu n op.

tf reference: https://www.tensorflow.org/api_docs/python/tf/nn/relu6

* Call destructor when assigning a blob value

* Add executor overrides

Add executor overrides flag to enable migration to async_scheduling executor

* Add barrier net that runs before training nets - attempt #2

Add a synchonize barrier net that is run before training nets.  With this net, shards that are faster will wait for other shards before start training.  This reduce chances of the faster shards timing out during GLOO AllReduce.
Removed explicit data_parallel_model.py.synchronize call in holmes workflow.

This change was landed previously but caused errors for some EDPM workflows - See https://fb.facebook.com/groups/1426530000692545/permalink/1906766366002237/ - because EDPM assumes any call to CreateOrCloneCommonWorld and Gloo ops are wrapped in exception handlers but in this case exception thrown in the barrier init net is not handled.

To address this issue, we add _CreateOrCloneCommonWorld to the param_init_net instead of a new barrier init net.  Since errors for param_init_net run is handled gracefully and re-rendezvous, it should fixes the problem.

* Handle empty nets in async_scheduling

Make sure we don't get stuck on empty nets

* use CUDA_ARCH for conditional compile

* [C2 fix] infer function for ensure_cpu_output_op

* Update group_norm test to reduce flaky test

* Fix lr_multiplier for GPU
2018-05-10 23:14:27 -07:00
Qinqing Zheng
6547245f1f Add return value to setup() function of PipedReaderBuilder (#7476) 2018-05-10 15:39:54 -07:00
anderspapitto
43264c3c30
add cast to ensure correct type for sequence lens argument (#7483) 2018-05-10 14:58:00 -07:00
Lu Fang
c489c6a1da
Skip upsample onnx backend test (#7477) 2018-05-10 13:17:24 -07:00
anderspapitto
ab5c391100
onnx rnn export: use spec-respecting dimensions (#7394)
fixes https://github.com/pytorch/pytorch/issues/6879
2018-05-10 08:19:17 -07:00
Jinghui
769397eb77 [Caffe2] [feature request] Add gradient operators for IDEEP (#7234)
* Add gradient operators for IDEEP

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>

* Add gradient test cases for IDEEP

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>

* Upgrade third_party/ideep

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>

* Refine SumOp for IDEEP

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>

* Share input buffer in fallback op if possible

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>

* Fallback ConvTranspose op for IDEEP

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>

* Fix bug introduced by the patch of sharing input buffer

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>

* Share output buffer in fallback operators

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>

* Remove IDEEP to resolve repo issue

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>

* Reflash IDEEP repo

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>

* Remove redundant lines in IDEEP

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>

* Fallback operators for IDEEP
(Flatten, ResizeLike, Transpose, and Reshape)

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>
2018-05-09 08:52:24 -07:00
Bram Wasti
b1fbf29b52
[caffe2][nomnigraph] Change the standard transform API to take in NNModule rather than NetDef (#7308) 2018-05-08 17:43:51 -07:00
Bram Wasti
3913e9ead3
[caffe2][nomnigraph] Batchnorm + Conv Fusion (#7057) 2018-05-08 15:40:34 -07:00
Yinghai Lu
e3935f7509
[Caffe2] Add conv+relu fusion for MKLDNN ops (IDEEP) (#7385)
* Add conv+relu fusion for MKLDNN ops (IDEEP)

* comments
2018-05-08 14:44:53 -07:00
bddppq
7b66c433bc
Use a CI specific onnx namespace to catch hardcoded ones in the code (#7369) 2018-05-08 13:40:55 -07:00
Yinghai Lu
e9f6f14555
[Caffe2] Revamp the convnet benchmark code by using models from model zoo (#7351)
* Revamp the convnet benchmark code by using models from model zoo

* Move ModelDownloader to caffe2/python/models

* Remove convnet_benchmarks.py
2018-05-08 08:53:52 -07:00
Yinghai Lu
2cb26bcd40 Fix type in TensortRT tests (#7357) 2018-05-08 07:52:04 -07:00
103yiran
79a4d27232 Correct the parameter annotation (#7367)
Make the annotation keep pace with  the parameter.
2018-05-08 00:31:16 -07:00
François Garillot
b6adecdeee correct schema.Scalar's shape for a shape argument of 1 (#6493)
The schema.Scalar class makes pretty strict assumptions (via its docstring)
on the spec of the shape of its underlying object. Because of idiosyncracies
of numpy indexing and the use of np.dtype, those assumptions are broken on an
 edge case (dtype = (scalar_type, 1)). This corrects the behavior of this
edge case to conform to the spec.
2018-05-07 18:58:11 -07:00
Bram Wasti
3642745ef9
[caffe2][nomnigraph] Add maxpool sink transform (#7207) 2018-05-07 14:52:10 -07:00
anderspapitto
67a9948d87
Refactor rnn export (#7263)
* rnn refactor: extract rnn weights and biases

* rnn refactor: make rnn with converted outputs

* rnn refactor: finish it off
2018-05-04 14:00:09 -07:00
Lu Fang
833b1e6c74
Skip the test case on ReduceLogSum (#7293) 2018-05-04 11:49:30 -07:00
anderspapitto
9e3f5bb5fd
enable onnx shape inference when converting onnx -> caffe2 (#7260) 2018-05-04 10:27:30 -07:00
bddppq
a95b7b13f9
Extend support to arbitrary ops in init net when converting c2 models to onnx (#7256) 2018-05-03 15:34:47 -07:00
Xiaomeng Yang
3ae92b3a8b
Fix lint errors (#7247) 2018-05-03 12:17:23 -07:00
Bram Wasti
e625ecc41f
[caffe2][nomnigraph] Fix NNPack conv-relu fusion for ping-pong naming, (#7199)
add test for it and make tests python3 compatible
2018-05-03 12:12:24 -07:00
Takayoshi Nishida
197412fa8f Fix typo in comment (#7183) 2018-05-02 11:58:30 -07:00
Lu Fang
664fe34e0a
[Caffe2][fbcode=>GH sync] Update from facebook 4323b18ce13c (#7116)
* [fix] Re-enable events in RNN ops

We have earlier added event disabling in RNN ops as back then we didn't use
events, with current use cases this is no longer true
(https://fburl.com/8vd0lp8y)

* use ops with cude impl

* Revert D7729695: [caffe2][fix] Re-enable events in RNN ops

This reverts commit 4b215c7496fb724656ff4c776933a15bdbbcde5e

@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

* [observer] Clean up observer_config.h

#accept2ship

* [1/n] Refactor dataio_test.py

Replace code duplication with a common function

* Add barrier net that runs before training nets

Add a synchonize barrier net that is run before training nets.  With this net, shards that are faster will wait for other shards before start training.  This reduce chances of the faster shards timing out during GLOO AllReduce.

Removed explicit data_parallel_model.py.synchronize call in holmes workflow.  Similar change in speech/asr_training workflow will come in another diff.

* Support the dnnlowp backend in caffe2_benchmark

This is for SHARE operator latency evaluation

* Migrate integral_image_op to main caffe2

migrate integral_image_op(GPU version) given by https://fburl.com/yvqezigi
to caffe2/caffe2/operators and implement its CPU version. Write up a test
using the hypothesis_test mechanism

* [pos_disc, fbcode] Implement unjoined lr loss

As explained in https://our.intern.facebook.com/intern/wiki/Model_Based_Calibration/, when the dataset is an joined data set, where labels might change later, we need to use unjoined logloss.

The implementation is almost the same as in Sigrid (https://fburl.com/1trngsls), where
    loss = y (log(p) - log(1-p)) + (1-y)(log(1-p)) = xy - (1-y)x - (1-y)log(1+exp(-x))

For x < 0, to ensure stability and avoid overflow, we reformulate the above exp as
    loss = xy - (1-y)x - (1-y)x + (1-y)log(1+exp(x)) = xy + (1-y)log(1+exp(x))

Then the final expression becomes
    loss = xy + (y - 1) x (x >= 0) - (1 - y) log(1 + exp(x - 2 x (x >= 0)))

where y is the true label, x is the dot product and p = logistic(x).

This kind of implementation is align with the current implementation of the original cross entropy in
https://phabricator.intern.facebook.com/diffusion/FBS/browse/master/fbcode/caffe2/caffe2/operators/cross_entropy_op.cc;0bae3b5d0f825897c5e0dd0ff10f489d7271bf25$7-13

* Keep the array to fix the conflict

* [C2] Compute Adagrad effective LR

The AdagradWithLR op outputs an extra blob which is contains the average effective learning rate across all weights in this blob.

* Open-source extractMetaNetDef & runGlobalInitialization, add new Predictor constructor from db file, and add run_map_outputs

1. Open-source extractMetaNetDef and runGlobalInitialization, for use in
2. new Predictor constructor from db file.
3. Add new run function that returns outputs as TensorMap

* Disable eigen cpu

Disable eigen cpu in transpose and reduce

* Introduce request_only/object_only property of ModelLayer

by default this is False

* A simple TC Caffe2 benchmark

We can run tunner, get MappingOptions and then use them to
compare against cuBLAS

currently broken due to LLVM issues. How to run:

hg checkout eec1ab31b59c03b8deded1c755a9abaf8c45be01
add D7401202
add D7434625
add D7506031
add D7540728

buck run @mode/dev-nosan tc/tc/benchmarks_python:caffe2_benchmark

* Move Caffe2 feature_maps_ops to open source

Need feature maps operators in open source project facebookresearch/BlueWhale

* Manually fix the conflicts in channel shuffle op

* Fix the inconsistency between different gh and fbcode

* Skip Adagrad GPU Test (Because some gpu implementation is missing)

* Fix another test to make sure it won't run on gpu when implementation is not available yet
2018-05-01 20:49:00 -07:00
Bram Wasti
967c4a0c18
[caffe2][nomnigraph] Fix NNPACK relu fusion for inplace relu (#7124) 2018-05-01 16:26:54 -07:00
Xiaomeng Yang
08a853b02c
Add rsqrt op in caffe2 (#7154) 2018-05-01 15:06:53 -07:00
Xiaomeng Yang
762eb3ddc8
[Caffe2] Add moments op in caffe2 (#7114)
* Add moments op in caffe2

* Use rsqrtf in float for group_norm

* Add docs for default behavior when axes is not provided.

* Update group_norm_op by using Eigen::sqrt on CPU
2018-05-01 12:19:08 -07:00
Lu Fang
5acc62ffa5
Skip Tile onnx backend to keep CI green (#7120) 2018-04-30 22:37:34 -07:00
James Reed
892bef9aa3
[ONNX] Delay external value resolution as long as possible in ONNX backend (#7111) 2018-04-30 21:30:31 -07:00
Yinghai Lu
150af6ac1e
Move ideep ops from caffe2/contrib/ideep to caffe2/ideep (#7112) 2018-04-30 21:10:46 -07:00
daquexian
f87462c65f [Caffe2] Fix the wrong argument name in collect_and_distribute_op (#7091)
* Fix the wrong argument name, FPN works!

* Fix collect_and_distribute test
2018-04-30 15:01:11 -07:00
Xiaomeng Yang
49f87320ba
[Caffe2] Add full impl of GroupNorm (#7058)
* Add full impl of GroupNorm

* Fix comments in math.h

* Remove unsed buffers

* Add #include <array> in gpu version

* Remove unused moments_buffer_

* Make inverse std to be a template.

* Add detailed comments
2018-04-29 11:26:40 -07:00
Yinghai Lu
e6ce1afe47
[Caffe2] Follow-up of onnx-trt API change (#7076)
* Follow-up of onnx-trt API change

* indent

* comments
2018-04-28 23:07:15 -07:00
James Reed
20cd27da42
[caffe2][ONNX] Implement CPU NumpyTileOp and corresponding ONNX backend (#7053)
* Implement CPU NumpyTileOp

* Address comments
2018-04-27 19:58:15 -07:00
Lu Fang
9a6c033004
Skip unsupported ONNX backend test cases (#7005) 2018-04-26 13:10:55 -07:00
Marat Dukhan
24d05662ea
[caffe2] Open-source DEPTHWISE_3x3 engine (#6601)
DEPTHWISE_3x3 engine provides an optimized implementation of depthwise 3x3 convolution, e.g. for ShuffleNet, MobileNets
Implementations exist for CPU (generic), ARM CPU, and CUDA GPU.

Originally developed by @ajtulloch
2018-04-26 02:30:51 -04:00
James Reed
7599d0c3fe
[caffe2] ONNX backend support for control nodes (#6914) 2018-04-25 15:44:00 -07:00
Yinghai Lu
8b70f7d248
[Caffe2] Clean up ideep integration (#6881)
* Clean up ideep integrtation

* .

* Remove redundant code in convnet benchmark

* MKL ON

* Do not add -mavx2 everywhere

* .

* Comments

* rename

* .
2018-04-24 18:32:35 -07:00
James Reed
3c80a2b85c
[caffe2] Add flag to ONNXWhile to skip scoping (#6910)
* [caffe2] Fix logic error in tensor filling ops in C++ ONNX backend

* [caffe2] Add flag to ONNXWhile to skip scoping
2018-04-24 16:53:22 -07:00
James Reed
6e60edb799
[caffe2] Fix logic error in tensor filling ops in C++ ONNX backend (#6909) 2018-04-24 13:53:27 -07:00
anderspapitto
750a323ca1
Work around protobuf issues by importing onnx first (#6833) 2018-04-23 15:44:04 -07:00
Bram Wasti
aa56a1211d
Update from facebook (#6871)
* Track checkpoint performance in scuba

As title.

* [C2/CUDA]: fix cross entropy sigmoid with logits

when adding log_d_trick, I forgot to add it to the cuda impl; this diff fixes
it.

* Back out "[caffe2] Unregister MKL fallbacks for NCHW conversions"

Original commit changeset: 8918dd40205a
Will land after @jongsoo's diff https://phabricator.intern.facebook.com/D7596315 lands

* [Easy][C2] Don't add blob to external outputs from output_record if it's already external output

As desc.

* On Mobile phones, call GlobalInit with no arguments in predictor in case we need to perform initialization

FACEBOOK:

The QPL logger needs the initialization code. In the past, the initialization code is put in the pipeline calling Caffe2. However, those places become obsolete quickly, as the product teams change places to call Caffe2 from time to time. We also need to track which teams use Caffe2 so that we can put the initialization code there.

With this diff, the initialization code is put in the predictor constructor, only enabled for mobile phones. This way, we can always enable QPL logging.

Once we do this, we can check how many times Caffe2 inference is called in production, and which models are more popular in production. This way, we can prioritize our effort supporting those models.

Will clean up the old code calling the init in the product in a separate diff.

* add padding op for sparse length tensor

to pad length-based sparse tensor with padding_value

* Add conv_op with cudaconvnet engine

Add conv_op with cudaconvnet engine

* [numa] Fix simple NUMA copy benchmark

Move XavierFill into init_net and also compute BW

* call roundf (device function) instead of round (host function)

* [caffe2_benchmark][observer] Make caffe2_benchmark use its own observer

1. Add ClearGlobalNetObservers()
2. Make caffe2_benchmark use its own observer and observer_reporter

* [detectron] Use roundf instead of round in the detectron module ops

* allow K larger than number of elements in top k op

one use case is to use this op together with PackSegments for sparse tensors, where the number of elements in each slice is not statistically defined.

* add ChannelShuffle DNNLOWP op

* fixup math_cpu.cc break
2018-04-23 15:01:56 -07:00
Yinghai Lu
9ed46c615c
[Caffe2] Provide option to initialize the TensorRT engine at Operator constructor time (#6809)
* Try to have a lazy conversion of onnx-trt

* .

* Make it work

* comments
2018-04-23 13:09:35 -07:00
Qinqing Zheng
90586d925f [DT] [38/n] Rename add_stop_signal to add_stop_condition (#6825)
att
2018-04-23 10:39:37 -07:00
Jinghui
26ddefbda1 [feature request] [Caffe2] Enable MKLDNN support for inference (#6699)
* Add operators based-on IDEEP interfaces

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>

* Enable IDEEP as a caffe2 device

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>

* Add test cases for IDEEP ops

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>

* Add IDEEP as a caffe2 submodule

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>

* Skip test cases if no IDEEP support

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>

* Correct cmake options for IDEEP

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>

* Add dependences on ideep libraries

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>

* Fix issues in IDEEP conv ops and etc.

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>

* Move ideep from caffe2/ideep to caffe2/contrib/ideep

Signed-off-by: Gu Jinghui <jinghui.gu@intel.com>

* Update IDEEP to fix cmake issue

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>

* Fix cmake issue caused by USE_MKL option

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>

* Correct comments in MKL cmake file

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>
2018-04-22 21:58:14 -07:00
Lu Fang
c286efb442
Quick patch for the CI (#6802) 2018-04-20 08:58:38 -07:00
Yinghai Lu
d695624efe
More trt tests (#6782) 2018-04-19 21:53:49 -07:00
bddppq
370acdf3bf
Change to use CAFFE2_HOME for specifiying caffe2 models path (#6775) 2018-04-19 11:34:52 -07:00
Yinghai Lu
7f587de4bc
[Caffe2] Let TensorRT flow use the generic graph transformer (#6696)
* Refine the transform API

* Let TensorRT flow use the generic graph transformer

* Rebase
2018-04-19 10:07:01 -07:00
Xiaomeng Yang
71c644b005
[caffe2] Add ReduceMinOp and ReduceMaxOp (#6744)
* Add gpu check for reduce_max

* Add ReduceMinOp and ReduceMaxOp

* Merge util functions in reduce_ops and math

* Expose math internal functions
2018-04-19 00:22:23 -07:00
Jongsoo Park
c40eefeef9 ChannelShuffle with NHWC layout (#6667)
* ChannelShuffle with NHWC layout

* ChannelShuffle with NHWC layout
2018-04-18 19:13:45 -07:00
Pooya Davoodi
969251962c [Caffe2] Enhance test for CollectAndDistributeOp (#6693)
* Caffe2: Enhance test for CollectAndDistributeOp

This also changes the operator and the test to use stable sort
otherwise the test will fail due to differences between the op
and the test when facing ROIs of the same score.

* Caffe2: Adjust comparator to make std::nth_element and std::sort stable

Revert the removal of std::nth_element and std::sort and adding of
std::stable_sort.
2018-04-18 13:19:05 -07:00
Orion Reblitz-Richardson
6223bfdb1d Update from Facebook (#6692)
* [GanH][Easy]: Add assertion to adaptive weighting layer

0 weight causes numeric instability and exploding ne

* [Easy] Add cast op before computing norm in diagnose options

As LpNorm only takes floats we add a manual casting here.

* Introduce a new caching device allocator

`cudaMalloc` and `cudaFree` calls are slow, and become slower the
more GPUs there are. Essentially, they grab a host-wide (not device-wide) lock
because GPU memory is transparently shared across all GPUs. Normally, this
isn't much of a concern since workloads allocate memory upfront, and reuse it
during later computation.

However, under some computation models (specifically, memory conserving
approaches like checkpoint-and-recompute, see
https://medium.com/@yaroslavvb/fitting-larger-networks-into-memory-583e3c758ff9)
this assumption is no longer true. In these situations, `cudaMalloc` and
`cudaFree` are common and frequent. Furthermore, in data parallel contexts,
these calls happen at nearly the same time from all GPUs worsening lock
contention.

A common solution to this problem is to add a custom allocator. In fact,
nVIDIA provides one out of the box: CUB, which Caffe2 already supports.
Unfortunately, the CUB allocator suffers from very high fragmentation. This is
primarily because it is a "buddy" allocator which neither splits nor merges
free cached blocks. Study
https://github.com/NVlabs/cub/blob/1.8.0/cub/util_allocator.cuh#L357 if you
want to convince yourself.

This diff adapts a caching allocator from the Torch codebase
https://github.com/torch/cutorch/blob/master/lib/THC/THCCachingAllocator.cpp
which does splitting and merging and ends up working really well, at least for
workloads like the checkpoint-and-recompute computation models noted above.

I simplified the implementation a little bit, made it a bit more C++-like. I
also removed a bunch of stream synchronization primitives for this diff. I
plan to add them back in subsequent diffs.

* Report reader progress in fblearner workflows

Integrate with fblearner progress reporting API and add support to report training progress from reader nodes.
If reader is constructed with batch limits, report based on finished batch vs total batch. The finished batch may be more than total batch because we evaludate if we should stop processing everytime we dequeue a split.
If no limit for the reader, report based on finished splits (Hive files) vs total splits. This is fairly accurate.

* [GanH][Diagnose]: fix plotting

1. ganh diagnose needs to set plot options
2. modifier's blob name is used for metric field can need to be fixed before
generating net

* Automatic update of fbcode/onnx to 985af3f5a0f7e7d29bc0ee6b13047e7ead9c90c8

* Make CompositeReader stops as soon as one reader finishes

Previously, CompositeReader calls all readers before stopping. It results in flaky test since the last batch may be read by different threads; resulting in dropped data.

* [dper] make sure loss is not nan

as desc.

* [rosetta2] [mobile-vision] Option to export NHWC order for RoIWarp/RoIAlign

Thanks for finding this @stzpz and @wangyanghan. Looks like NHWC is more
optimized. For OCR though it doesn't yet help since NHWC uses more mem b/w but
will soon become important.

* Intra-op parallel FC operator

Intra-op parallel FC operator

* [C2 Proto] extra info in device option

passing extra information in device option

design doc: https://fb.quip.com/yAiuAXkRXZGx

* Unregister MKL fallbacks for NCHW conversions

* Tracing for more executors

Modified Tracer to work with other executors and add more tracing

* Remove ShiftActivationDevices()

* Check for blob entry iff it is present

When processing the placeholders ops, ignore if the blob is not present in the blob_to_device.

* Internalize use of eigen tensor

Move use of eigen tensor out of the header file so we don't get template partial specialization errors when building other libraries.

* feature importance for transformed features.

* - Fix unused parameter warnings

The changes in this diff comments out unused parameters.
This will allow us to enable -Wunused-parameter as error.

#accept2ship

* add opencv dependencies to caffe2

The video input op requires additional opencv packages. This is to add them to
cmake so that it can build

* Add clip_by_value option in gradient clipping

Add clip_by_value option in gradient clipping

when the value is bigger than max or smaller than min, do the clip

* std::round compat
2018-04-17 23:36:40 -07:00
Yinghai Lu
6252706feb
[Caffe2] Workspace centric API for TensorRT transformation (#6678)
* Workspace centric API for trt transformation

* Merge SSA rewrite code
2018-04-17 21:23:27 -07:00
anderspapitto
4dd29ac89f fix broken code from rebasing (#6681) 2018-04-17 15:44:56 -07:00
Xiaomeng Yang
4be34ca0f3 Add broadcast and reduce gradient (#6668)
Add broadcast and reduce gradient
2018-04-17 13:31:13 -07:00
anderspapitto
e51e792cef
enable exporting bidirectional rnn with fixes seq len from onnx to caffe2 (#6566) 2018-04-17 12:27:16 -07:00
Yinghai Lu
582d47e986
[Caffe2] Scoped dummy name generator (#6458)
* Scoped dummy name generator

* Fix

* Fix

* Use class variable

* Fix build

* comment
2018-04-16 11:58:02 -07:00
bddppq
7ef14bf04c Follow the change of ONNX Cast operator "to" attribute (#6574)
* Follow the change of ONNX Cast operator "to" attribute

* Update Cast conversion in frontend and backend

* update pytorch onnx frontend
2018-04-16 14:24:42 -04:00
Xiaomeng Yang
cd2112717c
[caffe2] Update math functions with params on host. (#6602)
* Update ReduceMean

Add reduce mean to math

Add reduce mean to math

* sync reduce_ops_test

* Update math_gpu.cu
2018-04-14 21:41:41 -07:00
Yinghai Lu
434f710f3f
[Caffe2] Add support to TensorRT (#6150)
* Add support to TensorRT

* Removed License header

* Bind input/output by position

* Comments

* More comments

* Add benchmark

* Add warning for performance degradation on large batch

* Address comments

* comments
2018-04-11 17:03:54 -07:00
Yinghai Lu
ef8f556212
[Caffe2] Changes done inside Facebook (#6378)
* fix unit test for sqrt op

From the error logging:

[idx, grad, grad_estimate] are:
[[ 146.            0.5           0.45776367]
 [ 147.            0.5           0.45776367]

The gradient == 0.5 is correct, which means the SqrtOp and its gradient is doing right job. (Because y = sqrt(x), loss = y^2/2 = x/2, and then d(loss)/dx = 1/2 = 0.5; )

The test failed because of numerical problem of grad_estimate (in unit test). It can be because the step_size is small, and float precision is not high (when there are multiple elements in the tensor, we do sum(y^2) to compute loss)

This diff
- increase the step size, and also move the test cases to be further away from 0 (where sqrt(x) is not well defined) to be safe :)
- also clean up, and merge the test case for inplace Vs. non-inplace

Tested with:

`CAFFE2_HYPOTHESIS_PROFILE=debug ai_bt caffe2/caffe2/python/operator_test:elementwise_ops_test -- "test_sqrt"`

* CompositeReader & CompositeReaderBuilder

A new type of reader gluing multiple readers together.

* Back out "Revert D7394363: [GanH]: Log D Trick for Cross Entropy with Sigmoid"

Original commit changeset: 9325a4356dbe

* [dai][WIP] convert params to int8 on ps before sending to trainer

Add float->uint8 conversion in addition to float->fp16 conversion in model_saver.

* [easy] improve unit test for sparse length sum ops

as desc.

#accept2ship

* Update GitHub upstream to 771fcb3455

* move sparse hash unique ops to OOS and add unit tests

- move the SparseHash version to OOS, since 'sparsehash' is already deps of caffe2 OOS: https://fburl.com/arssw4n1
- The 'SparseHash' engine is also being used in OOS, so the SparseHash version shall be in OOS to reduce confusion: https://fburl.com/o5ea7ah2

- fix the CUDA UniqueOp for the case when batch is empty.
- add unit test

* group_norm_op for caffe2

This is the cuda op for Group Normalization (GN): https://arxiv.org/abs/1803.08494

This code implements GN in one op that computes Y=gamma * (X-mu) / sigma + beta and also its gradients. It is expected to have minimal memory consumption (similar to the BN op), without creating new blobs if GN were implemented as several ops (e.g., reshape, norm_mean/std, affine_channel).

* Resubmit D7405233: disappeared in D7464958

OOS publish causes the op missing -- however, test was still there

* [c2] add sparse hash engine for cuda unique op

The SparseHash version of UniqueOp copy input tensor to CPU, and make use of sparse hash map to get unique output, and then copy back to GPU.

* [dper][gpu] enable unit testing gpu trainer for sparse nn

to debug the GPU trainer using mock data in unit test.

make it easier to develop GPU trainer for new models.

* Reuse Gloo context for Synchronize() calls

Previously we were creating (and leaking) the Gloo context on each call to Synchronize(). Now only run the common world op and create the barrier net once, then run the barrier net on each Synchronize() call. Since timeout is associated with the Gloo context, assert that the timeout is fixed instead of trying to handle the complexity of multiple timeouts (and associated contexts).

* [GanH/WGAN][1/n]: add FC param clipping

as titled

* [mobile] minimizing changes between caffe2_benchmark and speed_benchmark

* [GanH]: enable diagnose within model

avoid finding blob names but to directly enable inside the model

* Add `net_transformer_fun` option to DPM

This callback allows for various transformations to be made to the
model after gradient operators have been added. The immediate motivation for
this is to allow transformations such has "checkpoint-and-recompute" which
allow trading off memory for additional compute.

Adding several callbacks like this has made DPM's API less than ideal at this
stage. However, I could not find any reasonable alternative.

* [DT] [33/n] Compile flow task groups

task groups need to compiled in order to pickle the object in fblearner. However I also changed the Job's compile function as creating new object is not necessary.

* Initial commit for sparse_normalize vectorization and benchmark

* [GanH]: LB Calibration for JSD

as titled

* Tracing event in async executor

Adding event tracing through TRACE_EVENT macro in async executor

* [Resubmit] D7409751 Reseting book-keeping blobs when the reservoir is reset

D7409751 got lost in D7464958

* Visualizing realtime weights values

we want to visualize the weights values as optimizer is iterating. This diff supports to visual the weights at an assigned index.
Currently, we assume the blob to be 2 dimensional.

* [GanH][Easy]: Fix Homotopy Weighting

apparantely, there was a bug in homotopy weight (alpha, beta) update

* [c2] move sparse hash unique op out of oss

so that oss do not need to depend on google hash map.

* Get rid of std::round as it's not supported on Android

* Revert changes on setup.py

* Skip shaky test on Dataio

* fix
2018-04-10 21:11:43 -07:00
Bram Wasti
7bd398b3db
Add fuseNNPACKConvRelu (#6439) 2018-04-10 16:51:16 -07:00
Qinqing Zheng
038b66ee07 [caffe2] use dictionary in Printer (#6443) 2018-04-10 10:37:07 -07:00
Qinqing Zheng
66791f54d5 Update the compile function of Job (#6323) 2018-04-09 22:44:23 -07:00
bddppq
df2e1d2962
Disallow using the OOP api workspace as context managers (#6456) 2018-04-09 22:13:54 -07:00
François Garillot
a91c88a348 Check mappings ONNX -> Caffe2 bear the same argument names (#6317)
* Check mappings ONNX -> Caffe2 bear the same argument names

When adding an extra arg to an input ONNX op, if it's not supported in Caffe2, the exporter would just silently pass it to NetDef and ignore it in the implementation. It's pretty error-prone. Caffe2 also has an OpSchema description and we can enforce that all arguments explicitly appear in schema or listed explicitly in Caffe2.

See also https://github.com/caffe2/caffe2/pull/2478

Add test for C2 argument checking

* Some operators do not log arguments, which prevents argument checks.
Invite users to file an issue to fix the schema.
2018-04-09 09:15:42 -07:00
Svetoslav Kolev
997acfd7fe [Caffe2] Some small changes to InferBlobShapesAndTypes definition and SameAsInput Schema (#6335)
* Change Same as input type deduction to work for ops with multiple outputs

* change InferBlobShapesAndTypes definition to take vector ot pointers instead of unique_ptr. The function doesn't own the objects, so no need to pass smart pointers and that prevents calling the function with existing object, since the caller has to create unique_ptr, i.e. copy an existing object just to create the pointer

* switching order of std::move<unique_ptr> and uniqur_ptr.get

* adding comma
2018-04-06 19:06:46 -07:00
Lu Fang
aab0bd3c13
Change onnx_optimizer API (#6290) 2018-04-06 13:46:53 -07:00
Lu Fang
876ad110af
Skip some unsupported onnx backend tests (#6247) 2018-04-05 21:33:35 -07:00
bddppq
8df2487de9
Properly skip the failing onnx conversion test (#6280) 2018-04-04 14:07:03 -07:00
kuttas
460e8cd376 change print to logger.warning in operator traceback code (#6216) 2018-04-03 08:01:25 -07:00
Qinqing Zheng
fd2e7cb487 Change JobRunner's __call__ function to train (#6205) 2018-04-02 21:04:36 -07:00
Paul Jesse Hellemn
771fcb3455 [caffe2] Fbcode to GitHub sync (#6208)
* [easy] allow empty tensor in cuda relu op

The diff has not enabled unit test of empty tensor, because MLKVersion of ReluOp need extra work to support

* Make blob norm plotting work with distributed trainer when the old framework is used
2018-04-02 16:35:27 -07:00
Orion Reblitz-Richardson
a409f959e8
Remove ShuffleNet from model zoo. (#6203)
* No longer supported.
2018-04-02 15:00:06 -07:00
Orion Reblitz-Richardson
cbe92abd7c Disable failing test_lengths_max_gpu 2018-03-30 21:00:45 -07:00
Ellie Wen
3d27095eec [easy] fix comments
nit: fix comments
2018-03-30 21:00:44 -07:00
Qinqing Zheng
365652229d Back out "Revert D7372460: [DT] [28/n] Lift epoch_limiter"
Original commit changeset: b0a986d16c3b
2018-03-30 21:00:44 -07:00
Andrey Malevich
b9d2ba1dbf Revert D7394363: [GanH]: Log D Trick for Cross Entropy with Sigmoid
This reverts commit d63266ccbc0c1390c58c2a71ae0b562fdec2fbc0

@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
2018-03-30 21:00:44 -07:00
Ellie Wen
363a227d19 extend bucketize op to support duplicated boundries
upgrade bucketize op to support duplicated boundaries
2018-03-30 21:00:44 -07:00
Jason Gauci
551d5fbf9a CUDA version of LengthsMax operator
CUDA version of LengthsMax operator

@override-unit-failures
2018-03-30 21:00:44 -07:00
Andrew Tulloch
0df662c67f [Caffe2] [Int8] More exhaustive unit tests for int8 ops (+ bug fix in Int8Add in-place case)
As title. This catches one bug in the Int8Add in-place case,
which wasn't tested in int8_test.cc
2018-03-30 21:00:44 -07:00
Xiaolong Wang
2b0e39f569 [GanH]: Log D Trick for Cross Entropy with Sigmoid
as titled
2018-03-30 21:00:44 -07:00
Andrey Malevich
f8eb8a66e2 Revert D7372460: [DT] [28/n] Lift epoch_limiter
This reverts commit 05bd9bec10fad5ff9dc40be88836fd7274d50ce9

@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
2018-03-30 21:00:44 -07:00
Bram Wasti
ee64200c64 [nomnigraph] Expose transformations to python
Adding a python interface to the transformations
2018-03-30 21:00:44 -07:00
Yiming Wu
03c5198331 [C2 Int8][C2 Core]fetch int8 blob
Providing Python API to fetch Int8 tensors.

  data, scale. zero_point = workspace.FetchInt8Blob(blob_name)

now returns a tuple if the blob contains a Int8TensorCPU

     'data' = int8 data array
     'scale' = fake quantization scale
     'zero_point' = fake quantization offset

Although FetchBlob shares back-end implmentation with FetchInt8Blob, we raise
error to prevent unexpected behavior of the same method
2018-03-30 21:00:44 -07:00
Lu Fang
8f3ba30266 Fix a typo
Fix a typo in optimize_onnx_test.py
2018-03-30 21:00:44 -07:00
James Reed
47a1fd208f Quick and dirty raw value substitution from zip file (#2454) 2018-03-29 19:18:58 -07:00
Lu Fang
344fa57680 Adjust the test since only the op only has CPU implementation 2018-03-27 18:10:39 -07:00
Lu Fang
0ac8495165 Fix the CMake issues caused by internal changes 2018-03-27 18:10:39 -07:00
Xiaolong Wang
af3dcdf6ae [D2]: Improve loss weight by allowing omitted weights
as titled
2018-03-27 18:10:39 -07:00
Xiaolong Wang
d6c30ee6af [GanH]: Unifying two discriminators
to improve the flexibility and combines different discriminators in one model.
2018-03-27 18:10:39 -07:00
Jongsoo Park
3300e21d52 Add SparseLengthsPositionalWeightedSum operator that fuses SparseLengthsWeightedSum, LengthsRangeFill, and Gather
add SparseLengthsPositionalWeightedSum operator that fuses SparseLengthsWeightedSum, LengthsRangeFill, and Gather
2018-03-27 18:10:39 -07:00
Xianjie Chen
e6b04ba121 fix lengths sum cuda op for empty batch
the cuda does not allow launching empty kernel
2018-03-27 18:10:39 -07:00
Xianjie Chen
6ed9a0c3f2 fix cuda elementwise ops for empty batch
CUDA will fail to launch empty kernel
2018-03-27 18:10:39 -07:00
Dehua Cheng
c6587597d8 Ignore backward step when there is no loss function;
Ignore backward step when there is no loss function;

For some customized model, we can encode the update directly in forward step and there is no backward step;
2018-03-27 18:10:39 -07:00
Xiaolong Wang
c909abd85f [GanH] Label Smooth: Add Layer and Integrate to SparseNN
as titled
2018-03-27 18:10:39 -07:00
Yan Zhu
107cb670b1 add typecast and assertion for histogram computing
as title
2018-03-27 18:10:39 -07:00
Xianjie Chen
078b6d5ad1 [layer model] remove duplicated init ops
it saves some model init time, and reduce confusion.
2018-03-27 18:10:39 -07:00
Roxie He
d2453afb1e Add SumElementsInt operator
Added a caffe2 math sum operator so that it takes integers (only int32)
Changed the SumFloatIter to SumGenericIter so that it takes >1 types.
Added a sumElementInt operator
2018-03-27 18:10:39 -07:00
James Cross
16312e8123 [fbtranslate/onnx] decoder step (pytorch -> caffe2) exporter for fbtranlsate
This code introduces a new class for exporting decoder step (ensemble) models trained with fbtranslate pytorch to Caffe2 models via ONNX, for the purpose of use in "component beam search" being developed concurrently in C++ by @juancarabina.
2018-03-27 18:10:39 -07:00
Manoj Krishnan
a92a6233b5 Enable support for placeholder ops in InjectCrossDeviceCopies
This is required to support placeholder/decorator ops which does not have operator schema. Note that the change is made in such a way that it is a no-op if placeholder Ops are not used.

Changes:
1. Since the placeholder ops always run on CPU, added a utility to infer placeholder ops blob devices.
2. Placeholder op's input/output blobs should be on CPU as well. This change takes care of dealing with output blobs - i.e. use blobs on CPU.
3. Added a Unit test - test_inject_copy_placeholder_ops
2018-03-27 18:10:39 -07:00
Jiyan Yang
8fa38f8dce Add gradient clipping (#2452)
As titled.
2018-03-27 15:10:15 -07:00
Orion Reblitz-Richardson
1d5780d42c Remove Apache headers from source.
* LICENSE file contains details, so removing from individual source files.
2018-03-27 13:10:18 -07:00
Jason Gauci
f93e820e7d Revert "[C2][GPU]LengthsMax CUDA version (#2209)" (#2444)
This reverts commit 71acc269bb573c8c04343e6d534b2557a456b29a.
2018-03-27 01:15:52 -07:00
harouwu
6740126f5c [C2][GPU]LengthsMax CUDA version (#2209)
lengthsmax CUDA version.

will provide gradient later
2018-03-27 00:19:17 -07:00
Kutta Srinivasan
0e0918cb9a dpm synchronize 2018-03-26 19:54:31 -07:00
mlappelbaum
d11fc90317 Export atomic iter count (#2379)
* Exported AtomicIterOp count

* Exported AtomicIterOp count

* Exported AtomicIterOp count

* Exported AtomicIterOp count

* Exported AtomicIterOp count

* Exported AtomicIterOp count

* Exported AtomicIterOp count

* Add axis to top_k_op. (#2416)

* Revert update on top_k_op

* Add axis to top_k_op

Add axis to top_k_op

* [auto] Update onnx to a8e4648 - Adjust link flags when built in Windows Debug mode (#647)
a8e4648a7d

* [auto] Update onnx to f4acf28 - Remove allowconsumed enforceconsumed from op schema. (#617)
f4acf281ef

* Exported AtomicIterOp count

* Exported AtomicIterOp count

* Exported AtomicIterOp count

* Exported AtomicIterOp count

* Exported AtomicIterOp count

* Exported AtomicIterOp count

* Initialize cpuinfo in the thread pool

Thread pool called cpuinfo_get_processors_count() without initializing cpuinfo. Only by luck it didn't make Caffe2 single-threaded: threadpool is initialized after NNPACK, and NNPACK initializes cpuinfo itself.

This commit also updates cpuinfo to a version that aborts with a fatal error if its used uninitialized.

* Updated Python Op and Image Pre-Processing Pipeline tutorials && Added CIFAR-10 Part 1 tutorial (#2286)

* Updated Basics tutorial: (1) Added Python 3 support with __future__ statements; (2) Various grammatical/typo fixes and minor refactoring of Markdown

* Added Python 3 support and made minor typo fixes

* Added Python 3 support with future imports, refactored and corrected errors in Markdown, added comments

* Added Python 3 support with future imports, Added use of caffe_translator.py to translate downloaded .caffemodel file to .pb files

* Upgrades to Image Pre-Processing Pipeline tutorial

* Updated Python Op tutorial

* removed markdown with empty links

* Added Part 1 of an end-to-end CIFAR-10 tutorial

* Updated MNIST Dataset and Databases tutorial with python3 support and markdown fixes

* Tweaks to markup, less training iterations

* changed permissions of CIFAR10_Part1; typo corrections in Image_Pre-Processing_Pipeline

* Typo corrections in Multi-GPU Training tutorial

* sync Python_Op py_gen with the IPython notebook

* nit typo correction

* [auto] Update onnx to 5cb999d - Minor cleanups to shape inference (#653)
5cb999ddc1

* [auto] Update onnx to ecac1c1 - Merge Rel 1.1.0 branch into master (#657)
ecac1c1624

* Strip down onnx to only pb definitions in mobile build (#2426)

* Exported AtomicIterOp count

* Exported AtomicIterOp count

* Exported AtomicIterOp count

* Exported AtomicIterOp count

* Exported AtomicIterOp count

* Exported AtomicIterOp count

* Exported AtomicIterOp count

* Exported AtomicIterOp count

* Exported AtomicIterOp count
2018-03-26 19:26:09 -07:00
Yinghai Lu
b6e80a1ec4 Caffe2-onnx exporter (#2248)
* caffe2-onnx frontend

* Remove Python part of the conversion code

* nit

* convert more ops

* Address commmetns
2018-03-26 19:23:45 -07:00
Xiaomeng Yang
a73f9af5ab Add axis to top_k_op. (#2416)
* Revert update on top_k_op

* Add axis to top_k_op

Add axis to top_k_op
2018-03-23 20:43:43 -07:00
bddppq
425361af6a Bump onnx opset version (#2402) 2018-03-23 10:48:12 -07:00
bddppq
bbb7c722df Remove legacy onnx optimizer tests (#2394) 2018-03-22 21:08:05 -07:00
Qinqing Zheng
1288c4fd79 refactor epoch_limiter (#2389)
* refactor epoch_limiter

* fix test
2018-03-22 20:32:13 -07:00
bddppq
f3b7b2f293 Remove ONNX consumed_inputs (#2278)
* Remove ONNX consumed_inputs

* Bump up opset version to 6 issued by onnx caffe2 frontend
2018-03-22 20:24:35 -07:00
Qinqing Zheng
566a25e1e4 Add keyword argument to PipeReaderBuilder (#2381)
att
2018-03-22 14:17:47 -07:00
Yinghai Lu
45da53f478 Remove Python onnx-caffe2 conversion code (#2362)
* WIP

* Remove Python onnx-caffe2 onversion code

* Fix build

* Comments

* Add comments

* Fix typo in comments
2018-03-22 11:59:03 -07:00
Xiaomeng Yang
3053618624 Add argmax and argmin ops (#2371)
* Revert update on top_k_op

* Add axis to top_k_op

* Remove do { ... } while (false)

* Revert top_k op to upstream

* Add argmin and argmax ops

Add argmin and argmax ops

* Revert top_k_test to upstream

* Add argmin and argmax ops

Add argmin and argmax ops
2018-03-22 00:52:11 -07:00
James Reed
48c70d2dbd Fix ReduceMean performance by specializing Eigen implementation for common shapes (#2355) 2018-03-21 21:48:54 -07:00
Joseph Spisak
b2c56eb219 Removed special handling for onnx sqrt (#2353) 2018-03-21 21:05:25 -07:00
Yangqing Jia
2d03ae2f85 Move ParseProtobufFromLargeString to proto_utils (#2354)
* Move ParseProtobufFromLargeString to proto_utils

* ParseProtobuf -> ParseProto to be consistent in naming
2018-03-21 17:05:14 -07:00
Orion Reblitz-Richardson
0ea8964fd6 Revert "Export number of iterations of AtomicIterOp" (#2359)
* Revert "Use -DCMAKE_BUILD_TYPE=Release for local build by default"

This reverts commit 035c62081f6420405b9f1380cc5d21b4c6ae78f6.

* Revert "Export number of iterations of AtomicIterOp (#2338)"

This reverts commit 91b7a0cb48c6b079e2ca8fd5c26819a003937d76.
2018-03-21 16:11:29 -07:00
mlappelbaum
8346088094 Export number of iterations of AtomicIterOp (#2338)
* Exported AtomicIterOp count

* Exported AtomicIterOp count
2018-03-21 12:39:30 -07:00
Lu Fang
b1684e9a3a Skip DepthToSpace and MaxPool same mode onnx backend tests (#2343) 2018-03-21 09:24:06 -07:00
Lu Fang
6cae6d3841 Update ONNXOpCoverage.md 2018-03-20 15:22:43 -07:00
Lu Fang
1c80ee1c74 Update ONNXOpCoverage.md 2018-03-20 13:56:13 -07:00
Lu Fang
ac1b7b6366 Update ONNXOpCoverage.md 2018-03-20 13:55:33 -07:00
Orion Reblitz-Richardson
42d3bcc189 Only run WeightedMultiSample test on CPU and not GPU. 2018-03-20 13:34:22 -07:00
Orion Reblitz-Richardson
6aa087d902 Revert "export num iterations of AtomicIter"
This reverts commit be9c8e5591f5d38131b9bdc2249542f27dadc221.
2018-03-20 13:34:22 -07:00
Xianjie Chen
22d0828f00 [easy] improve error messages
as desc.

#accept2ship
2018-03-20 13:34:22 -07:00
Yan Shang
69706b2ab4 Add C2 for weighted sampling
C2 operator, with input (1) index; (2) cdf; argument number_samples,
output number_samples samples from the index.
2018-03-20 13:34:22 -07:00
Xiaolong Wang
4bb73b8361 [GanH] Weighting Layers: Adaptive/Constant/Homotopy
use case: to weight multiple losses (real values) as a single composite loss for
optimization
2018-03-20 13:34:22 -07:00
Xiaolong Wang
a5279dccd4 [GanH]: homotopy JSD
as titled
2018-03-20 13:34:22 -07:00
Matan Appelbaum
fac306d3c9 export num iterations of AtomicIter
as title.  Useful for tracking number of EASGD updates.
2018-03-20 13:34:22 -07:00
Lukasz Wesolowski
f7f48989ba GPU support for ChannelBackpropStatsOp
Step 2 of 3 in adding support for multidevice batch normalization on GPUs. Implements ChannelBackpropStatsOp. Similar to D6953411.
2018-03-20 13:34:22 -07:00
Chenguang Xi
3940e7f0a7 Support computing averaged norm in blob magnitdue visualization
1. support the LpNorm operator to calculate the average LpNorm by adding one more boolean argument, i.e., LpNorm(average = true) = LpNorm(x) / size of (x)

2. integrate the average option into visualization framework
2018-03-20 13:34:22 -07:00
Manoj Krishnan
c43896732e Added device inference functions for Concat and Split Ops.
Changes:
=======
1. Added device inference functions for Concat and Split Ops.
2. Added a unit test to validate the change. See, test_device_inference_function in core_test.py
3. Fixed some formatting.
2018-03-20 13:34:22 -07:00
Wei Zhang
e0e334793c Revert D7219461: Mark full sync data parallel ops with rules
This reverts commit 79c56ec5859e25c7caec7bb6b79e80dd19307c64
2018-03-20 13:34:22 -07:00
Wei Zhang
9edbafe0de Mark full sync data parallel ops with rules
Instead of using hard-coded rules or rely on gpu_strategy to mark full sync data parallel ops, we need some generic rules that is applicable to both the single and distributed setting.
2018-03-20 13:34:22 -07:00
Kittipat Virochsiri
35b6b0747a Fix stop_if()
Making sure that stop blob is never overrided.
2018-03-20 13:34:22 -07:00
Yan Shang
40683cdf42 Allow calculating average margin rank loss
Similar to LrLoss, we allow for average loss of margin rank loss.
2018-03-20 13:34:22 -07:00
Kittipat Virochsiri
72f2cd8bcc Making preproc_output_schema explicit
Make it easier to plug in intermediate steps between preprocessing & trainer by maintaining a stable schema.

I also fixed enqueue() so that we can pass in the same blob in multiple location without causing data corruption.
2018-03-20 13:34:22 -07:00
Zhanibek Datbayev
7aeda25cfb Add type / shape inference for IndexHash op
just as title says
2018-03-20 13:34:22 -07:00
Edoardo Conti
6af3429f4f Add 2D Row-wise Arg Max Operator
Add operator to return row-wise arg max of 2D matrix.
2018-03-20 13:34:22 -07:00
Kittipat Virochsiri
9be2de507b Cleaning up ReaderBuilder interface
The way `splits()` is currently used is so convoluted. It's impossible to compose ReaderBuilder. I'm working on a composite reader so this is a prerequisite for it.

The idea is that the ReaderBuilder should maintain the states it needs to create a reader. Any setup is done through the new `setup()` method. Currently, `setup()` should only be called once, but, if needed, it should be safe to call it multiple times.
2018-03-20 13:34:22 -07:00
Kittipat Virochsiri
a4d0ef2621 Fix stop blob of processing reader
See inline comment
2018-03-20 13:34:22 -07:00
Yinghai Lu
efe1c2bd13 hypen as a valid part of model names (#2312) 2018-03-20 08:52:54 -07:00
Lu Fang
cda2f02f89 Skip the test average pool same mode tests (#2324) 2018-03-20 00:13:31 -07:00
Yinghai Lu
b0fe67aca8 Expose more APIs for onnx cpp backend (#2317) 2018-03-19 22:46:26 -07:00
Bram Wasti
aa4af1a5f9 [tiny] make debug info optional, CAFFE2_DEBUG env variable driven 2018-03-19 16:58:04 -07:00
Qinqing Zheng
23631eee5a [C2] Fix the check of current scope in optimizer (#2316)
scope.CurrentDeviceScope() can return a None type, which was not considered.
2018-03-19 16:38:55 -07:00
Yan Zhu
fb77b423f4 refactor histogram as net modifier (#2314) 2018-03-19 16:04:58 -07:00
Orion Reblitz-Richardson
00603b5e0a Add CollectAndDistributeFpnRpnProposalsOp for FPN support (#2254)
* Add CollectAndDistributeFpnRpnProposalsOp for FPN support

* Adds a C++ operator equivalent to the Python op in Detectron
* Once some additional GenerateProposalsOp changes are made this will
 let us support Detectron FPN models with straight Caffe2 C++ ops
* RetinaNet and segmentation models require additional work

* Remove some uses of conservativeResize

* Add notes about training and inputs/outputs to operator documentation
2018-03-19 14:04:43 -07:00
Lu Fang
334fc98fb0 Handle the legacy padding in global pooling case (#2292) 2018-03-18 21:28:15 -07:00
bddppq
c155842cc1 Update onnx frontend to emit new onnx Reshape (with shape as input) (#2287)
* Update onnx frontend to emit new onnx Reshape (with shape as input)

* Address comments and revert submodule change
2018-03-16 16:32:35 -07:00
James Reed
e8f14f5d37 Fix ONNX backend for MatMul (#2273)
* Fix ONNX backend for MatMul

* Update Python implementation

* Address comments
2018-03-15 14:43:52 -07:00
Paul Jesse Hellemn
74f0b270ea Fixing conda (#2123)
* Fixing conda

* Adding hypothesis and onnx to conda builds

* Updates but still not working

* Adding required changes to conda_full

* Updates

* Moving to more general build_anaconda script

* Adding check for gcc version

* Adding general ways to add/remove packages from meta.yaml?

* Changes for specific packages to build on gcc 5.4

* Fix with glog spec

* Requiring >numpy 1.12 for python 3 to satisfy opencv dependency

* Adding pydot to required testing packages

* Adding script to read conda versions for gcc ABI

* Trying to fix segfault by installing in env instead

* conda activate -> source activate

* Trying adding back leveldb

* Setting locale for ONNX + conda-search changed its format

* read_conda_versions handles libprotobuf

* Conda script updates

* Adding a protobuf-working test

* Removing changes to proto defs b/c they will require internal changes in a separate diff
2018-03-14 12:24:37 -07:00
Lu Fang
8a9925f03f Fix useless opset_import in onnx (#2243)
* Fix useless opset_import in onnx

* Set the default ir version in make_model

* Use the target_opset_version in Caffe2Frontend

* remove make_model from helper in caffe2.python.onnx
2018-03-14 10:17:32 -07:00
Mohammad Hossain
28eda01809 Reduce Sum and Reduce Mean (#2189)
* Reduce Sum and Reduce Mean

* Handle reductions with empty 'axes'

* Merge codebase and simplify tesnor reduction logic

* Restructure code and add comments.

* Fix parameter to scale

* Fix parameter to scale
2018-03-13 19:13:47 -07:00
Qinqing Zheng
edd138ba00 [C2] Support optional lengths input to ReduceFront/Back operators (#2250) 2018-03-13 13:20:26 -07:00
Yinghai Lu
7e6693991d Onnx caffe2 backend (#2039)
* C++ version of ONNX->Caffe2 backend

* use namespace ONNX_NAMESPACE

* Fix Build

* Comments

* Change namespace from onnx_caffe2 to caffe2::onnx
2018-03-12 15:18:05 -07:00
jmp84
b465bb9a8e fix post eos penalty (#2235) 2018-03-12 12:42:22 -07:00
sf-wind
602a09dde7 Update caffe2 from facebook 4f527ef46abf (#2234)
* [GanH]: two_task_discriminator

as titled

and adding label smooth

* [Dper2] Simplified UI options needed for blob magnitude visualization

* [GanH]: fix tags

as titled

* Added type and shape inference for GatherRange operator

This helps with type / shape inference when using this operator in layers.
Also just a nice to have in general.

* Demonstrate Caffe2 exception handling with StoreHandlerTimeoutError in Python

We'd like to catch and recover from certain Caffe2 net exceptions. Use this diff to demonstrate a pattern of registering a pybind exception mapping and catching in Pythonusing caffe2::StoreHandlerTimeoutException.

* Bind Gloo IoException to IoError in Python

Allow peer failure handling and recovery using an exception based mechanism. This diff registers gloo::IoException with pybind.

* [GanH]: add label smoothing to softmax with loss

as titled

* [C2] Enable LARS in Adagrad and hook it to DPER

* [DPER] Don't pass LayerModelHelper in create_trainer_nodes

Since we're planning to get rid of it eventually and I want to get access to
NetDef only interface ASAP - I'm looking towards removing all references to
LMH, where we don't really need them.

* fix bugs in LambdaRankNdcgOp

the loss and gradient in LambdaRankNdcgOp are incorrect. The loss should be negative log of probs instead of log.

* Restrict thread pool on iOS to only big cores

Historically, iPhones exposed only one type of cores, and Caffe2 thread pool used all of them.
However, iPhone 8/iPhone X exposes 2 big + 4 LITTLE cores. As our thread pool doesn't support work stealing or other forms of load balancing, fast cores end up waiting for the slow ones, and it may be better to restrict execution to only 2 fast cores, like we do on Android.

* Remove SparseLength Sum/WeightedSum/Mean operators with fp16 engine

Remove SparseLength Sum/WeightedSum/Mean operators with fp16 engine

* make clang happy and get fewer warnings

make clang happy and get fewer warnings

* [Personalization] Support add_output_schema() in layer_model_helper

Problem:
Currently the output_schema of sparse_nn can only be set once. https://fburl.com/efth5zer.

Solution:
For flexibility, we want to add fields to output_schema incrementally.

Plan:
Wrap the change of `model._output_schema` into a new function `add_output_schema()` for adding additional output_schema.

Callsite:
The add_output_schema() should be called instead at https://fburl.com/efth5zer

Reference:
The newly added `add_output_schema()` will be similar to `add_loss()` in https://fburl.com/t2ii8njh
2018-03-12 12:22:59 -07:00
Kutta Srinivasan
0ee53bf7fe Fix one more naming issue in resnet50_trainer.py for PR 2205 2018-03-09 13:51:42 -08:00
Kutta Srinivasan
ed05ca9fec Clean up naming of FP16-related code, add comments 2018-03-09 13:51:42 -08:00
James Reed
60299e03cf Report all errors during ONNX backend translation rather than failing fast (#2210) 2018-03-09 10:58:22 -08:00
Lu Fang
52460a0b30 Add outputs_info as parameter in run_node (#2161) 2018-03-09 10:44:51 -08:00
Jongsoo Park
64b33672af add GatherFused8BitRowwise operator (#2167)
* add GatherFused8BitRowwise operator

* Update gather_fused_8bit_rowwise_op.cc

* Update gather_fused_8bit_rowwise_op.cc
2018-03-09 07:42:17 -08:00
Qinqing Zheng
9acac2a513 Pass in task groups to PipedReaderBuilder (#2182) 2018-03-08 16:16:57 -08:00
Jiyan Yang
f4b1e8b334 [Dper2] Add NetModifier abstraction and support for plotting the norm of blobs (#2201) 2018-03-08 13:41:32 -08:00
Joseph Spisak
cebf44e960 Element-wise tests now use or seeded with hypothesis (#2181)
* Updated all element-wise tests to use hypothesis testing or at least use hypothesis seeds

* Updated tests to add seed to sqr function
2018-03-08 07:51:45 -08:00
Alexander Sidorov
60aa8c793d Update caffe2 from facebook (#2178)
* [C2] Don't crash kernel in case of invalid shapes for ConcatOp

Enforce correctness of the shapes for input tensors so we won't access invalid index.

* [Caffe2] Add analytical performance counters to Dynolog

Initial diff for counting analytical flops and memory writes for C2 operators.

* BBoxTransform op: Handle RoIs from multiple images per batch

BBoxTransform op used during typical Faster-RCNN inference operates only on
RoIs from a single image (no batching). Adding support to handle that with an
optional output blob containing the batch splits (i.e., the number of RoIs
belonging to each item in the batch). The code is perfectly backward compatible
and shouldn't break any existing models..

* [mkl] Make MKL-DNN cooperate with memongered nets

C2's MKL-DNN implementation caches input dims and reuses intermediate and
output buffers across net runs, which prevents memonger from being used. This
may not always be useful since input dims may vary widely in many cases and
we'll end up reallocating anyway. Added an option to force reallocation when
memonger is used.

* [oncall] fix batch gather ops for empty input

still need to bisect for the breaking change, but this shall fix the case for empty input.

the error logging is like: https://interncache-ftw.fbcdn.net/t49.3276-7/23938497_293562711176943_6500112636590424064_n.txt?_nc_log=1

@[557759185:raychen] can you help to subscribe oncall from ads side. this may affect the Sigrid online trainer.

* optimize BatchOneHotOp

We want to iterate in row-major as opposed to column-major for better
locality.

* Supported exporting model with int blobs.

Supported exporting model with int blobs. Needed by condensenet.

* BoxWithNMSLimit op: Handle boxes from mutiple images per batch

Similar to D7135360. Added support for multiple images per batch in the op.
Takes an optional additional input "batch_splits" as output by BBoxTransform
op, and returns new batch_splits after applying NMS and filtering. Otherwise,
backward compatibility is maintained.
2018-03-07 16:41:22 -08:00
Kutta Srinivasan
0a18608b43 hacks to test exception handling and python operator backtraces
Add exception handling & re-throwing to worker threads of DAGNetBase
2018-03-07 15:09:17 -08:00
ilia-cher
0c6e843028 [caffe2] Add scopes into ONNX While op (#2149)
Summary:
Executing loop's body in a separate workspace, using WorkspaceStack to
support saving and reusing of workspaces

Test Plan:
python caffe2/python/operator_test/onnx_while_test.py

Reviewers: caffe2-review, jamesreed

Subscribers:

Tasks:

Tags:
2018-03-07 12:34:11 -08:00
Dmytro Dzhulgakov
7d141d4243 Changes done internally at Facebook (#2154)
f679c644e332 dzhulgakov [caffe2] Sync script - add ability to handle rebase conflicts
51729b061a15 dzhulgakov [caffe2] Changes done on GitHub
2018-03-06 01:23:54 -08:00
Dmytro Dzhulgakov
bec8923e02 [C2] Adding Clip Tensor by Scaling op
This op is used for gradient clipping to take care of exploding / vanishing gradients.

If original_norm is larger than the threshold,
then each element of the tensor is scaled by threshold / original_norm.
2018-03-06 00:33:11 -08:00
Dmytro Dzhulgakov
6b98315a28 [GanH] Model Test
as titled
2018-03-06 00:33:11 -08:00
Dmytro Dzhulgakov
16ba087b64 [oncall]fix unittest dper/layer_models/tests:utils_test
as titled -- fix offending diff D7091725 due to added debug_info in operator
proto
2018-03-06 00:33:11 -08:00
Dmytro Dzhulgakov
496c999f7d [core] NUMA-aware pinned allocator
Using cudaHostRegister/Unregister instead of cudaMallocHost to move memory to a
specific NUMA node
2018-03-06 00:33:11 -08:00
Dmytro Dzhulgakov
9e71de398b [core] Graph-level NUMA awareness in Caffe2
Adding NUMA awareness through numa_node_id in DeviceOption. Blobs of operators
with numa_node_id are allocated on corr. memory banks, using CPU pools with
NUMA affinity set to run operators.
2018-03-06 00:33:11 -08:00
Dmytro Dzhulgakov
8b0b090ff1 fix Caffe2TensorToNumpyArray for py3
with python3 np.int defaults to int64.  This diff should fix it. I don't know if test exist for this function already, however following ASR test was breaking when i switch to py3

```
buck test caffe2/caffe2/fb/speech/asr_training/:tensor_parser_test
```
2018-03-06 00:33:11 -08:00
Dmytro Dzhulgakov
968ebb3b82 [GanH]fuse jsd with lr loss/xent
as titled
2018-03-06 00:33:11 -08:00
Dmytro Dzhulgakov
08dbd96642 Add TensorInferenceFunction for PowOp
Add TensorInferenceFunction for PowOp so that we can infer the shape and datatype of Pow output.
2018-03-06 00:33:11 -08:00
Dmytro Dzhulgakov
f2ec5b7b0e [DPER] Fix bug in uint8 quantization shortcut.
After D6953547 some of the blobs were no longer impacted by uint8 quanitzation,
but they would still generate operators expecting uint8 inputs and thus fail.

This diff is adding a temporal hack to avoid doing this quantization when layer
is not quantized.

Will fix it with switching to Net rewriting instead.
2018-03-06 00:33:11 -08:00
Dmytro Dzhulgakov
1f0a833d8e JSD fwd/bwd op
as titled
2018-03-06 00:33:11 -08:00
Kutta Srinivasan
b4b2f0d2cc Work on fp16 conv op 2018-03-05 21:13:03 -08:00
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