Repository: systemml Updated Branches: refs/heads/gh-pages 2cfd77491 -> 7c4907095
[SYSTEMML-540] Allow for `allreduce_parallel_batches` for multi-GPU training - Introduced `allreduce_parallel_batches` for multi-GPU training as per Mike's suggestion. - Moved `train_algo` and `test_algo` from solver specification to Python API to conform with Caffe as per Berthold's suggestion. - Updated the documentation for Caffe2DML. Closes #543. Project: http://git-wip-us.apache.org/repos/asf/systemml/repo Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/7c490709 Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/7c490709 Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/7c490709 Branch: refs/heads/gh-pages Commit: 7c4907095eaec6f70da6884e20ef6888c64f7fd8 Parents: 2cfd774 Author: Niketan Pansare <npan...@us.ibm.com> Authored: Fri Jun 16 10:14:44 2017 -0800 Committer: Niketan Pansare <npan...@us.ibm.com> Committed: Fri Jun 16 11:14:44 2017 -0700 ---------------------------------------------------------------------- beginners-guide-caffe2dml.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/systemml/blob/7c490709/beginners-guide-caffe2dml.md ---------------------------------------------------------------------- diff --git a/beginners-guide-caffe2dml.md b/beginners-guide-caffe2dml.md index b44b113..f15e025 100644 --- a/beginners-guide-caffe2dml.md +++ b/beginners-guide-caffe2dml.md @@ -94,6 +94,8 @@ lenet.setStatistics(True).setExplain(True) # If you want to force GPU execution. Please make sure the required dependency are available. # lenet.setGPU(True).setForceGPU(True) +# Example usage of train_algo, test_algo. Assume 2 gpus on driver +# lenet.set(train_algo="allreduce_parallel_batches", test_algo="minibatch", parallel_batches=2) # (Optional but recommended) Enable native BLAS. lenet.setConfigProperty("native.blas", "auto") @@ -108,6 +110,16 @@ lenet.predict(X_test) For more detail on enabling native BLAS, please see the documentation for the [native backend](http://apache.github.io/systemml/native-backend). +Common settings for `train_algo` and `test_algo` parameters: + +| | PySpark script | Changes to Network/Solver | +|--------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------| +| Single-node CPU execution (similar to Caffe with solver_mode: CPU) | `caffe2dml.set(train_algo="minibatch", test_algo="minibatch")` | Ensure that `batch_size` is set to appropriate value (for example: 64) | +| Single-node single-GPU execution | `caffe2dml.set(train_algo="minibatch", test_algo="minibatch").setGPU(True).setForceGPU(True)` | Ensure that `batch_size` is set to appropriate value (for example: 64) | +| Single-node multi-GPU execution (similar to Caffe with solver_mode: GPU) | `caffe2dml.set(train_algo="allreduce_parallel_batches", test_algo="minibatch", parallel_batches=num_gpu).setGPU(True).setForceGPU(True)` | Ensure that `batch_size` is set to appropriate value (for example: 64) | +| Distributed prediction | `caffe2dml.set(test_algo="allreduce")` | | +| Distributed synchronous training | `caffe2dml.set(train_algo="allreduce_parallel_batches", parallel_batches=num_cluster_cores)` | Ensure that `batch_size` is set to appropriate value (for example: 64) | + ## Frequently asked questions #### What is the purpose of Caffe2DML API ? @@ -282,4 +294,13 @@ train_df.write.parquet('kaggle-cats-dogs.parquet') #### Can I use Caffe2DML via Scala ? Though we recommend using Caffe2DML via its Python interfaces, it is possible to use it by creating an object of the class -`org.apache.sysml.api.dl.Caffe2DML`. It is important to note that Caffe2DML's scala API is packaged in `systemml-*-extra.jar`. \ No newline at end of file +`org.apache.sysml.api.dl.Caffe2DML`. It is important to note that Caffe2DML's scala API is packaged in `systemml-*-extra.jar`. + + +#### How can I view the script generated by Caffe2DML ? + +To view the generated DML script (and additional debugging information), please set the `debug` parameter to True. + +```python +caffe2dmlObject.set(debug=True) +```