Commit Graph

857 Commits

Author SHA1 Message Date
Ben Zhang
f937e4bffb Revert D5288993: Memonger Graph Equality into Memonger
Summary: This reverts commit b9f105ce00148b2673eed2dd390ab74f82f990ad

Differential Revision: D5288993

fbshipit-source-id: 8f2e69c0ca21e142eb43b450d0b52ba76a5e429f
2017-06-21 13:45:50 -07:00
Peizhao Zhang
8464ec5c3a Fixed a bug in compute_interference_graph() when using with multiple in-place operators.
Summary:
compute_interference_graph() was not able to handle the case when a blob is reused twice for operators supporting in-place parameters. For example, for the following network with operators Mul and Sub

(blob) -> [Mul] -> (blob) -> [Sub] -> (blob)

an incorrect edge will be added from [Sub] to [Mul] and causes nx.is_directed_acyclic_graph() to fail.

Reviewed By: ajtulloch

Differential Revision: D5271604

fbshipit-source-id: f6095b6f8e1dba556ba223a82c8170be7f744529
2017-06-21 12:01:37 -07:00
Ahmed Taei
a531d74dde ELU CUDA implementation
Reviewed By: wickedfoo

Differential Revision: D5290111

fbshipit-source-id: 95bd0b5467fe064f2fe1b21cb8ec31f150b35e3f
2017-06-21 11:47:13 -07:00
Tao Wu
4be5337cca add support for weight in batch_softmax_loss
Summary: weighted batch_softmax_loss when weight exists in input_record

Reviewed By: kittipatv

Differential Revision: D5291646

fbshipit-source-id: f1bcd386ad1fc0e95e0a0315ec1c36531c792495
2017-06-21 10:32:15 -07:00
Ben Zhang
f222e226b4 Memonger Graph Equality into Memonger
Summary: Make verify_graph_equality get called by share_grad_blobs and optimize_inference_for_dag

Reviewed By: akyrola

Differential Revision: D5288993

fbshipit-source-id: b9f105ce00148b2673eed2dd390ab74f82f990ad
2017-06-21 10:09:15 -07:00
Luke Yeager
d46fe736c8 Fix flaky test in dataset_ops_test.py
Summary:
```
while pytest caffe2/python/operator_test/dataset_ops_test.py::TestDatasetOps::test_collect_tensor_ops; do sleep 0.1; done
```
Run this long enough and you'll see an error like this:
```
Sample histogram: [ 92 109  65 103  99 104  99 125 100 104]
...
>       self.assertTrue(all(hist > 0.7 * (num_to_collect / 10)))
E       AssertionError: False is not true
```
I've seen values like 65, 68, 69, 70. Setting the cutoff at 60 instead of 70 seems safe enough.

/cc Yangqing (or whoever authored a56b881c4a).
Closes https://github.com/caffe2/caffe2/pull/840

Differential Revision: D5292120

Pulled By: akyrola

fbshipit-source-id: 2ea4cbb58e206268759bd9d3639e8921623f519c
2017-06-21 05:35:44 -07:00
Luke Yeager
005156f6b4 Fix gradient checking for softplus op
Summary:
kmatzen why did you set the stepsize in ff84e7dea6?

The test is flaky before this change. Solid afterwards.
Closes https://github.com/caffe2/caffe2/pull/841

Differential Revision: D5292112

Pulled By: akyrola

fbshipit-source-id: c84715261194ff047606d4ec659b7f89dac3cbb1
2017-06-21 05:35:43 -07:00
Luke Yeager
e2107fffba Fixes for test_recurrent in hypothesis_test.py
Summary:
/cc akyrola is it possible this test has been broken ever since 5614816fce?

More generally, why do we still have `hypothesis_test.py` at all? In the case of this test, surely one of these files does more than this one old test:

* `operator_test/cudnn_recurrent_test.py`
* `operator_test/recurrent_network_test.py`
* `operator_test/rnn_cell_test.py`
Closes https://github.com/caffe2/caffe2/pull/843

Differential Revision: D5292109

Pulled By: akyrola

fbshipit-source-id: 6df5df6353a9741d1ae1b796adaab98382857527
2017-06-21 05:35:42 -07:00
Alisson Gusatti Azzolini
c24dabb414 Enable runtime cloning of tasks.
Summary:
Funnily, the biggest issue when trying to increase number of trainers from 5 to 20 is not model convergence (it is worse but still converges without tuning); it is the initialization time: it took around 30 min to generate the job.

After this diff, job creation time for the standard 5-7 setup goes from 125s to 8s. (15x speedup).

Another improvement is that ##net_printer.to_string(job)## becomes less complex.

This makes the startup for 20 trainers go to 32s, which is still not ideal.

Next step will be to allow passing num_instances to Node as well. This way we'll be able to create only one reader and one trainer prototype and let the framework take care of the scheduling. For this one we will need to move some DataStream and PS initialization code to C++ first. (c.c. aartibasant)

Reviewed By: dzhulgakov

Differential Revision: D5100788

fbshipit-source-id: 7b76bce108f527a96b2bfe7ed43a22ea8679b682
2017-06-21 03:18:20 -07:00
Bokai Cao
d9087edb07 add rekey in feature_processor
Differential Revision: D5270972

fbshipit-source-id: 8805c0e947f4752d2c575e2a7b8986cd804601dc
2017-06-20 23:19:09 -07:00
Aapo Kyrola
34eaa19d27 CPU data parallel model
Summary:
CPU -version of data parallel model. Great thing is that now we can run data_parallel_model_test in Sandcastle (as it does not have GPUs).

Pretty simple change, really. I did not change all variable names with "gpu" in them, to reduce risk (and being a bit lazy). Can improve later.

Reviewed By: wesolwsk

Differential Revision: D5277350

fbshipit-source-id: 682e0c5f9f4ce94a8f5bd089905b0f8268bd2210
2017-06-20 23:19:08 -07:00
Alisson Gusatti Azzolini
7d482742fd Allow tasks/execution_steps to be cloned at runtime
Summary:
Advantages of cloning the tasks/execution_steps at runtime:
- Less complexity on the python side: no need to clone nets and add prefixes to blob names
- Faster start-up: we had cases of complex plans that took up to 30min to be created.
- Better isolation: each task cloned at runtime has its own child workspace, preventing false sharing of blobs.
- Opens up possibility for dynamic scheduling: Number of threads per task can be increased on the fly, at runtime.

Reviewed By: dzhulgakov

Differential Revision: D5100730

fbshipit-source-id: 71b83193b135da4e6eaf2536d8fc266528e1fdcc
2017-06-20 22:32:07 -07:00
Jacqueline Xu
5957218cf0 Adding Dropout Layer to SparseNN Model and Flow
Summary:
- Incorporated dropout layer to the sparseNN training and testing pipeline
- Integrated an advanced model options feature on Flow UI for users to specify dropout rate
- Created an end-to-end unit test to build and run a model with dropout

Reviewed By: chocjy

Differential Revision: D5273478

fbshipit-source-id: f7ae7bf4de1172b6e320f5933eaaebca3fd8749e
2017-06-20 15:46:55 -07:00
Davin Wang
dd1525d346 fix #790 so model.init_params = False takes effect
Summary:
Given the parameter init_params=False, Weight Blob(*_w) and Bias Blob (*_b) should be suppressed in model.param_init_net. Without this fix, the init_params=False doesn't take effect in brew.conv as it does in brew.fc or other ops. This issue is the root cause of #790 [https://github.com/caffe2/caffe2/pull/790].
Closes https://github.com/caffe2/caffe2/pull/824

Reviewed By: harouwu

Differential Revision: D5276676

Pulled By: akyrola

fbshipit-source-id: 8f7088a8e1976658f67e027223e555375b3a2392
2017-06-20 14:08:35 -07:00
Aapo Kyrola
5084ff3b9b improve blob sharing
Summary:
Since D5193393 introduced a "token" system for memonger that prevents sharing of blobs across parallel branches, we can be more aggressive in blob sharing. Thus, this removes the tracking of 'unused free blobs' and just relies on the token system.
For forward-only resnet50, this reduces the number of shared blobs to 5 (optimal accorsing to akirillov's calculation).

This requires careful testing, so I will not land it soon.

Reviewed By: asaadaldien

Differential Revision: D5208985

fbshipit-source-id: 2e520c4ea2351a2ec327b6c5f2e3af24234d1c9a
2017-06-20 12:08:57 -07:00
Luke Yeager
5e084a9112 Don't require pydot for Python tests
Summary:
Working towards https://github.com/caffe2/caffe2/pull/817.
```
>       graph = pydot.Dot(name, rankdir=rankdir)
E       AttributeError: 'NoneType' object has no attribute 'Dot'
```
https://travis-ci.org/caffe2/caffe2/jobs/243867951
Closes https://github.com/caffe2/caffe2/pull/827

Differential Revision: D5276691

Pulled By: akyrola

fbshipit-source-id: 047ee869c029002ace29d84c6b56534b7f23f87b
2017-06-19 23:02:00 -07:00
Aapo Kyrola
a5c45e18b5 MaxGradientOp for CUDA + unit test
Summary: As title. Pretty straightforward. Could actually run each kernel in parallel, but we can optimize later if needed.

Reviewed By: Yangqing

Differential Revision: D5278415

fbshipit-source-id: 29f59afe28f37fc4152ec7eb7cd6c1ab65f2cb8c
2017-06-19 22:35:45 -07:00
Bokai Cao
d2b1cb22a4 rekey layer
Differential Revision: D5210095

fbshipit-source-id: dc66a10d95842e0f10cb53a5afb7ddcc3fcac0de
2017-06-19 18:47:28 -07:00
Alexander Sidorov
83e6a0bec8 Revert uuid change to OperatorDef protobuf
Summary:
a few issues:

1. Randomization hurts memoization
1. Even if we make it non random, then we can get key colisions when loading it back.
2. RNNs use prototxt for step net and apparently its not forward compatible like normal protobuf is

I am thinking of a better less invasive solution now.

Reviewed By: jamesr66a

Differential Revision: D5272118

fbshipit-source-id: ab577fad04fbfc632e1fceffa923377a0d3da1be
2017-06-19 16:47:31 -07:00
Dmytro Dzhulgakov
a6fcecaa71 Allow AliasOp to work on empty tensor
Summary: Ran into it while working on a dper benchmark. Apparently it works harmless even with empty tensors.

Reviewed By: akyrola

Differential Revision: D5273672

fbshipit-source-id: a968ae03a659d6c1a215f12cc35f7ba68448e833
2017-06-19 15:24:02 -07:00
Jacqueline Xu
6150d9bef2 Building dropout as layer
Summary: Dropout layer and unittest for DPer2

Reviewed By: chocjy

Differential Revision: D5254866

fbshipit-source-id: 5eaea81808ddf8e0c7a7d76209ea44cda2ee28aa
2017-06-19 14:46:52 -07:00
Luke Yeager
31e700910d Fix entropy error coming from test_div
Summary:
Working towards https://github.com/caffe2/caffe2/pull/817.

`E           InvalidArgument: Insufficient bytes of entropy to draw requested array.  shape=(4, 2, 5, 1, 3, 5, 5, 1), dtype=float32.  Can you reduce the size or dimensions of the array?  What about using a smaller dtype?  If slow test runs and minimisation are acceptable, you  could increase settings().buffer_size from 8192 to at least 24576000.`

https://travis-ci.org/caffe2/caffe2/jobs/243867951
Closes https://github.com/caffe2/caffe2/pull/828

Differential Revision: D5276723

Pulled By: akyrola

fbshipit-source-id: f7d0e2dd8ef8b6a2354bd4ff7c7446c377c954b4
2017-06-19 13:47:29 -07:00
Xiaoti Hu
969831ea33 Deprecate CNNModelHelper in lmdb_create_example
Reviewed By: akyrola

Differential Revision: D5233793

fbshipit-source-id: bae745791f071bc36fd45bd81145ce86c8ba9ed0
2017-06-19 13:04:02 -07:00
Wael Abdelghani
4b4022ded7 Make test_lstm_main more stable
Summary: Title

Reviewed By: Yangqing

Differential Revision: D5268569

fbshipit-source-id: f79c38376ef2dd0684fd438668b0762341d982cf
2017-06-19 12:36:29 -07:00
Luke Yeager
2579be1227 Skip fp16 initializer test for CPU-only builds
Summary:
Working towards https://github.com/caffe2/caffe2/pull/817.
```
E           AttributeError: Method FloatToHalf is not a registered operator. Did you mean: []
```
https://travis-ci.org/caffe2/caffe2/jobs/243867951

/cc slayton58
Closes https://github.com/caffe2/caffe2/pull/829

Differential Revision: D5276796

Pulled By: akyrola

fbshipit-source-id: 34edca6090a9ce7ab39ae1fdc0e83b5c3b7e4f49
2017-06-19 12:21:25 -07:00
Luke Yeager
90a52c3904 Skip TestInferDevice if no GPU support
Summary:
Working towards https://github.com/caffe2/caffe2/pull/817.
```
E           AttributeError: Method CopyCPUToGPU is not a registered operator. Did you mean: []
```
https://travis-ci.org/caffe2/caffe2/jobs/243867951
Closes https://github.com/caffe2/caffe2/pull/818

Differential Revision: D5276735

Pulled By: akyrola

fbshipit-source-id: 35d9df19330ae522037e8a5d721d83dc2e5aa4dc
2017-06-19 12:21:24 -07:00
Luke Yeager
932cf9eb92 Fix entropy error coming from utility_ops_test
Summary:
Working towards https://github.com/caffe2/caffe2/pull/817.

`E           InvalidArgument: Insufficient bytes of entropy to draw requested array.  shape=(20, 12, 22), dtype=float32.  Can you reduce the size or dimensions of the array?  What about using a smaller dtype?  If slow test runs and minimisation are acceptable, you  could increase settings().buffer_size from 8192 to at least 43253760.`

https://travis-ci.org/caffe2/caffe2/jobs/243867951

/cc kittipatv
Closes https://github.com/caffe2/caffe2/pull/830

Differential Revision: D5276639

Pulled By: akyrola

fbshipit-source-id: 0c21be25ecd931837dc8b0c2cc17048f531350d1
2017-06-19 12:09:32 -07:00
Ben Zhang
1ec0b89361 Memonger Graph Verifier
Summary:
We want to make sure that a graph optimized by memonger doesn't have any possibility of two threads writing into the same output blob at the same time, when blobs are renamed.

Creates a graph where edges are built such that a parents node's output blob is a child node's input blob, and there is no node in between the parent and child node that writes to the same blob. If two nets generate the same such graph, then the "path" of data is the same.

Reviewed By: akyrola

Differential Revision: D5210385

fbshipit-source-id: 6317fc4e16289339b50c2dcd86ec8b32d2d544a5
2017-06-19 00:46:32 -07:00
Jeff Johnson
3f860af050 Implement TopKOp for GPU
Summary:
This is a real implementation (not GPUFallbackOp) of the TopKOp for GPU.

There are two algorithm implementations:

-for k <= 512, it maps to a warp-wide min-heap implementation, which requires only a single scan of the input data.
-for k > 512, it maps to a multi-pass radix selection algorithm that I originally wrote in cutorch. I took the recent cutorch code and removed some cutorch-specific things as it made sense.

Also added several utility files that one or the other implementations use, some from the Faiss library and some from the cutorch library.

Reviewed By: jamesr66a

Differential Revision: D5248206

fbshipit-source-id: ae5fa3451473264293516c2838f1f40688781cf3
2017-06-17 08:47:38 -07:00
James Reed
21dc425e07 Optimize SumSqrElementsOp for CUDA
Summary: The old version used one block with 128 threads. Throughput was too low for the NMT use case (calculating squared gradient norms for every parameter), so this increases the throughput. Shaves 7% off CNN model training time per step

Reviewed By: wickedfoo

Differential Revision: D5263748

fbshipit-source-id: adc3bacd11e49ea00c60381d613d993050e899be
2017-06-16 17:03:38 -07:00
Dmytro Dzhulgakov
12094b5114 Add random shuffle through the data to the benchmark workflow
Reviewed By: kdub0

Differential Revision: D5171727

fbshipit-source-id: 1d9182bb820224b479682fc0ca5014f909ba19d5
2017-06-16 13:22:46 -07:00
Alexander Sidorov
eefd4b0bb2 Static RNN: gpu support and lstm_benchmark integration
Summary:
While this is not intended to be the best performat and
general solution, we can see from the test plan in some cases static DAG RNN could
perform better than our own implementation. Hopefully we will get
dynamic RNN DAG execution at least as fast as this one. Then we will
not need this one in production, only for testing.

Still putting it into our benchmark for comparison purposes

Reviewed By: akyrola

Differential Revision: D5210038

fbshipit-source-id: fa44baf51c455872abd6ec5f5d151cf06e15b1fa
2017-06-16 11:31:43 -07:00
Aapo Kyrola
2a9cb7d4a9 use brew for Tranpose --> major perf regression fix
Summary: I accidentaly noticed that we were calling the non-CUDNN version of Transpose with attention, and it is super slow. This broke when rnn_cell was changed to use ModelHelper instead of CNNModelHelper in D5062963, but calls to transpose were not "brewed".

Reviewed By: jamesr66a

Differential Revision: D5264248

fbshipit-source-id: b61494ae210f34597245f1195d20547f5b5cd8b5
2017-06-16 11:02:48 -07:00
Aapo Kyrola
96f19fefc0 add warning if data parallel model is created for gpus that we dont have
Summary: Don't want to assert since it can be useful to sometimes create models that are not run (for example, unit tests).

Reviewed By: pietern

Differential Revision: D5258905

fbshipit-source-id: f1beee0605bfef235ed0f23f7e78259109720254
2017-06-16 07:02:37 -07:00
Simon Layton
176a841087 Fixes for CuDNNDropoutOp
Summary: Closes https://github.com/caffe2/caffe2/pull/809

Differential Revision: D5263514

Pulled By: akyrola

fbshipit-source-id: 1f1e5bdb6fa551cb1f9beb3e5d3ad9c0c8813ed0
2017-06-15 22:51:12 -07:00
Kittipat Virochsiri
fc2a8d045c adding flatten indices output to TopK
Summary: This makes it easier to gather top-K by group of rows. This is useful in the situation where we want to pick up top-K from batch of fixed length sessions. Let `N` be number of sessions, and `M` be number of examples in a sessions. We would have a batch of `N * M` rows. We can reshape the score blob to `N x M`, and use it as input to `TopK` to select top score for each session. However, without the new output, it's would be inconvenient to gather the rows corresponding to the top scores. The indices are in `[0, K-1)` range. The new output can be used directly as input to `Gather`.

Reviewed By: chocjy

Differential Revision: D5171459

fbshipit-source-id: 69f7b41456c3f9670650ae07afc8fef8328485e9
2017-06-15 15:32:29 -07:00
Luke Yeager
84cc82cf3f Fix stats_ops_test
Summary:
The global StatRegistry doesn't get reset when the workspace is reset.
```
>       self.assertTrue(len(workspace.FetchBlob('k3')) == 2)
E       AssertionError: False is not true
```
https://travis-ci.org/lukeyeager/caffe2/jobs/240162665

/cc azzolini

NOTE: this error doesn't show up if you just run `stats_ops_test.py` directly. It shows up when you run other tests in the same session before this test:
```
pytest -v caffe2/python/
```
Closes https://github.com/caffe2/caffe2/pull/788

Differential Revision: D5259232

Pulled By: salexspb

fbshipit-source-id: 3c72633af6bb61c4fda62195298b1e9574b4cbef
2017-06-15 15:07:57 -07:00
Po-Yen Chou
5ce9cbae70 Upgrades python/hypothesis_test.py to use brew instead of CNNHelperModel
Summary: Upgrades this file to use brew instead of CNNHelperModel

Reviewed By: harouwu

Differential Revision: D5252089

fbshipit-source-id: 6df4350717c1d42bc4bcc63d255cd422f085ee05
2017-06-15 15:07:56 -07:00
Dmytro Dzhulgakov
e9cba7e69f Option to read from dataset indefinitely.
Summary: Useful for benchmarking

Reviewed By: kdub0

Differential Revision: D5226758

fbshipit-source-id: 6f3e6dd256f2c40ab71e598a7ce47cd06099adff
2017-06-15 15:07:53 -07:00
James Reed
d9d89b191d implement SliceOp for GPU
Summary: Implementation of the SliceOp for CUDA

Reviewed By: akyrola

Differential Revision: D5254287

fbshipit-source-id: 0a1660e1aa161fd088a2d8f886e019c05a1919a2
2017-06-15 14:34:34 -07:00
Luke Yeager
f61e4ca070 Fixes in tests to support numpy >= 0.12
Summary:
```
  File "/data/caffe2/install/caffe2/python/hypothesis_test.py", line 1911, in test_batch_to_space
    (w + 2 * pad) / block_size).astype(np.float32)
  File "mtrand.pyx", line 1404, in mtrand.RandomState.randn (numpy/random/mtrand/mtrand.c:19843)
  File "mtrand.pyx", line 1534, in mtrand.RandomState.standard_normal (numpy/random/mtrand/mtrand.c:20368)
  File "mtrand.pyx", line 167, in mtrand.cont0_array (numpy/random/mtrand/mtrand.c:6127)
TypeError: 'float' object cannot be interpreted as an index
```
```
  File "/data/caffe2/install/caffe2/python/operator_test/tile_op_test.py", line 101, in tile_ref
    tiled_data = np.tile(X, tuple(dims))
  File "/data/caffe2/venv/local/lib/python2.7/site-packages/numpy/lib/shape_base.py", line 881, in tile
    return c.reshape(shape_out)
TypeError: only integer scalar arrays can be converted to a scalar index
```
I also tested to make sure this still works with 0.11.
Closes https://github.com/caffe2/caffe2/pull/787

Differential Revision: D5248087

Pulled By: salexspb

fbshipit-source-id: eff69482a8eabb8ace330003fa326c832b53865f
2017-06-15 14:17:20 -07:00
Sen Li
9d8a194cef Deprecate CNNModelHelper in python/workspace_test.py
Summary: Deprecate CNNModelHelper in python/workspace_test.py to use Model_Helper instead of CNN

Reviewed By: harouwu

Differential Revision: D5251778

fbshipit-source-id: d634f1c76e41a95b0247ebf5d5a48aef6f8e232e
2017-06-15 14:17:18 -07:00
Hao Shi
c4c3797b0d Deprecate CNNModelHelper - Inception()
Summary:
This diff deprecates `CNNModelHelper` in `Inception()` only.

Depends on D5248848

Reviewed By: harouwu

Differential Revision: D5249312

fbshipit-source-id: 2818fb54bbae203956ed5cd5fb547508923c52a6
2017-06-15 14:03:27 -07:00
Hao Shi
b0625ff566 Deprecate CNNModelHelper - VGGA()
Summary:
This diff deprecates `CNNModelHelper` in `VGGA()` function.

Depends on D5247946

Reviewed By: harouwu

Differential Revision: D5248848

fbshipit-source-id: ede9113edb2024e4db8f0048f812050233e3fb40
2017-06-15 14:03:26 -07:00
Hao Shi
4aff677d3d Deprecate CNNModelHelper - OverFeat()
Summary:
This diff deprecates `CNNModelHelper` in `OverFeat()` function.

Depends on D5247004

Reviewed By: harouwu

Differential Revision: D5247946

fbshipit-source-id: 6a5299ec71f78e0b81a43212a028651522ab8f4b
2017-06-15 14:03:25 -07:00
Hao Shi
078589d7c6 Deprecate CNNModelHelper - AlexNet()
Summary:
This diff deprecates `CNNModelHelper` in the `AlexNet()` function. More diffs will be coming to deprecate the helper in other functions.

Depends on D5241738

Reviewed By: harouwu

Differential Revision: D5247004

fbshipit-source-id: eec5c5ef916a85de8289cb92d2174a6a4b8075bf
2017-06-15 14:03:24 -07:00
Hao Shi
c095b3f67f Deprecate CNNModelHelper - MLP()
Summary: This diff deprecates `CNNModelHelper` in `MLP()` function.

Reviewed By: harouwu

Differential Revision: D5241738

fbshipit-source-id: 03669a4166a02257aa5779860d06b40d7496104d
2017-06-15 14:03:23 -07:00
Luke Yeager
8ef12951e0 Fix for protobuf with unicode_literals
Summary:
Python 2.7, Protobuf 2.6

    >                   op.ClearField('uuid')
    E                   TypeError: field name must be a string

Fix: http://python-future.org/imports.html#should-i-import-unicode-literals

/cc salexspb tomdz
Closes https://github.com/caffe2/caffe2/pull/804

Differential Revision: D5258494

Pulled By: akyrola

fbshipit-source-id: 04c473c1e55bf8caac0bfde7d86171c9f95e71a1
2017-06-15 13:22:57 -07:00
Aapo Kyrola
7ffd76db51 check operator schema before calling gradient creator
Summary: Hard-to-debug problems arise when a gradient creator fails when the forward op is incorrect itself. Add checking of the schema before callig the creator. Also clarify the error messages

Reviewed By: Yangqing

Differential Revision: D5256016

fbshipit-source-id: 78550f7e2ce5b88e26b69fdae4be0eece52edfea
2017-06-15 13:04:58 -07:00
Mehdi Drissi
6500d7f307 Fixing a small bug in schema where the number of default arguments doesn't match the number of fields
Summary:
The current version of schema.py has a Metadata class with three fields. The default for it is set to
four Nones. This is just changing that to three Nones so that the number of default values matches the number
of actual fields.

Reviewed By: kennyhorror

Differential Revision: D5250463

fbshipit-source-id: 42e5650d270f5f63662614d8445b4819ed370dec
2017-06-15 10:31:56 -07:00