Skip to content

Commit

Permalink
Merge pull request #213 from deephealthproject/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
RParedesPalacios authored Nov 3, 2020
2 parents 8c9878a + ae6c65f commit 49dca26
Show file tree
Hide file tree
Showing 139 changed files with 6,891 additions and 11,910 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-cpu-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
run: |
mkdir build
cd build
cmake -DBUILD_SUPERBUILD=ON -DBUILD_SHARED_LIBS=OFF ..
cmake -G "Visual Studio 16 2019" -A x64 -T ClangCL -DBUILD_SUPERBUILD=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_TARGET=CPU ..
shell: cmd
- name: Build
run: cmake --build build --config Release
shell: cmd
- name: Test
run: |
cd build
"bin/Release/unit_tests.exe"
cd build
"bin/Release/unit_tests.exe"
shell: cmd
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ temp/
docs/doxygen/*
!docs/doxygen/Doxyfile
docs/sphinx/source/_build
docs/sphinx/source/_static

# Other files
*.dot
Expand All @@ -32,8 +31,8 @@ old_build/example_*
old_build/test_*

# ONNX
#onnx.pb.h
#onnx.pb.cc
onnx.pb.h
onnx.pb.cc

# Files generated by CLion
cmake-build-*
Expand Down
2 changes: 1 addition & 1 deletion cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ else()

set(Protobuf_ROOT "${EP_BASE_DIR}/protobuf" PARENT_SCOPE)
set(Protobuf_INCLUDE_DIRS "${EP_BASE_DIR}/protobuf/include" PARENT_SCOPE)
set(Protobuf_LIBRARIES_DIRS "${EP_BASE_DIR}/protobuf/lib")
set(Protobuf_LIBRARIES_DIRS "${EP_BASE_DIR}/protobuf/lib") # TODO: Fix. Sometimes is /lib, and others /lib64
set(Protobuf_LIBRARIES_DIRS ${Protobuf_LIBRARIES_DIRS} PARENT_SCOPE)
# set(Protobuf_LIBRARIES "protobuf" PARENT_SCOPE)
set(Protobuf_PROTOC_EXECUTABLE "${EP_BASE_DIR}/protobuf/bin/protoc" PARENT_SCOPE)
Expand Down
17 changes: 17 additions & 0 deletions docs/markdown/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,23 @@ Drop the `formulas/brew/eddl.rb` file at `/usr/local/Homebrew/Library/Taps/homeb
Then you can also execute; `brew`


## Create conda env

```
# [YAML] Create environment
conda env create -f environment.yml
# [RAW] Create environment
conda create --name myenv
# Update environment
conda env update -f environment.yml
# Remove environment
conda remove --name eddl --all
```


## Build conda package

```
Expand Down
166 changes: 85 additions & 81 deletions docs/markdown/eddl_progress_documentation.md

Large diffs are not rendered by default.

16 changes: 12 additions & 4 deletions docs/markdown/eddl_progress_tensor.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ Numpy-like operations over a raw-tensor object
| ------------- | ---- | ---- | -------- |
| randu | ✔️ | ✔️ | Return a uniform random matrix with given shape. |
| randn | ✔️ | ✔️ | Return a normal random matrix with data from the "standard normal" distribution. |
| rand_uniform | ✔️ | ✔️ | |
| rand_signed_uniform | ✔️ | ✔️ | |
| rand_normal | ✔️ | ✔️ | |
| rand_binary | ✔️ | ✔️ | |



### Building matrices
Expand Down Expand Up @@ -99,6 +96,17 @@ Numpy-like operations over a raw-tensor object
| unsqueeze | ✔️ | ✔️ | Expand the shape of an array. `[3, 4, 7] => [1, 3, 4, 7]` |


### Value operations

| Functionality | CPU | GPU | Comments |
| ------------- | ---- | ---- | -------- |
| fill | ✔️ | ✔️ | Fills a tensor in-place, with a constant value |
| fill_rand_uniform | ✔️ | ✔️ | Fills a tensor in-place, with values randomly sampled from a uniform distribution |
| fill_rand_signed_uniform | ✔️ | ✔️ | Fills a tensor in-place, with values randomly sampled from a signed uniform distribution |
| fill_rand_normal | ✔️ | ✔️ | Fills a tensor in-place, with values randomly sampled from a normal distribution |
| fill_rand_binary | ✔️ | ✔️ | Fills a tensor in-place, with values randomly sampled from a binary distribution |


### Joining arrays

| Functionality | CPU | GPU | Comments |
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions docs/sphinx/source/_templates/searchbox.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!--<div>-->
<!-- <h3>{{ _('Quick search') }}</h3>-->
<!-- <script>-->
<!-- (function() {-->
<!-- var cx = 'aaa06ecc8743366d5';-->
<!-- var gcse = document.createElement('script');-->
<!-- gcse.async = true;-->
<!-- gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;-->
<!-- var s = document.getElementsByTagName('script')[0];-->
<!-- s.parentNode.insertBefore(gcse, s);-->
<!-- })();-->
<!-- </script>-->
<!-- <gcse:search></gcse:search>-->
<!--</div>-->
10 changes: 8 additions & 2 deletions docs/sphinx/source/bundle/computing_service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ Example:
GPU
====

.. doxygenfunction:: eddl::CS_GPU(const vector<int>, int, string)
.. doxygenfunction:: eddl::CS_GPU(const vector<int>, string)
.. doxygenfunction:: eddl::CS_GPU(const vector<int> g)

.. doxygenfunction:: eddl::CS_GPU(const vector<int> g, int lsb)

.. doxygenfunction:: eddl::CS_GPU(const vector<int> g, int lsb, string mem)

.. doxygenfunction:: eddl::CS_GPU(const vector<int> g, string mem)


Example:

Expand Down
12 changes: 0 additions & 12 deletions docs/sphinx/source/bundle/initializers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,6 @@ Example:

layer RandomUniform(layer l, float min=0.0,float max=0.1, float seed=1234);

HeUniform
-------------

.. doxygenfunction:: HeUniform

Example:

.. code-block:: c++
:linenos:

layer HeUniform(layer l,int seed=1234);


Constant
-------------
Expand Down
12 changes: 9 additions & 3 deletions docs/sphinx/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
# -- Project information -----------------------------------------------------

project = 'EDDL'
copyright = '2020, eddl'
author = 'Pattern Recognition and Human Language Translation Research Center.'
copyright = '2020, EDDL'
author = 'Pattern Recognition and Human Language Technology research center'


# -- General configuration ---------------------------------------------------
Expand All @@ -31,6 +31,8 @@
extensions = [
'breathe',
'sphinx_tabs.tabs',
# 'sphinxprettysearchresults',
# 'sphinxcontrib.lunrsearch',

'sphinx.ext.autodoc',
'sphinx.ext.doctest',
Expand All @@ -45,7 +47,7 @@
breathe_default_project = "eddl"

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -68,3 +70,7 @@
html_static_path = ['_static']

pygments_style = 'sphinx'

# html_sidebars = {
# '**': ['searchbox.html'],
# }
11 changes: 1 addition & 10 deletions docs/sphinx/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,27 +105,18 @@ The code is open source, and `available on github`_.
datasets/segmentation.rst


.. toctree::
:maxdepth: 1
:caption: Miscellaneous

misc/misc.rst


.. toctree::
:maxdepth: 1
:caption: Tensor

tensor/create.rst
tensor/manipulation.rst
tensor/binary.rst
tensor/image.rst
tensor/indexing.rst
tensor/input_output.rst
tensor/linear_algebra.rst
tensor/logic_functions.rst
tensor/mask_ops.rst
tensor/math.rst
tensor/misc.rst


Indices and tables
Expand Down
43 changes: 32 additions & 11 deletions docs/sphinx/source/installation/build-options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,33 @@ environment by running the following commands **from the source directory**:
conda env create -f environment.yml
conda activate eddl
You can also update your environment with:

.. code:: bash
conda env update -f environment.yml
If you decide to manually install these dependencies in your system (make sure they are at standard paths):

.. code::
- cmake>=3.9.2
- eigen>=3.3.7
- zlib=1.2.*
- protobuf=3.11.*
- protobuf
- libprotobuf # We need to avoid problems with paths (idk why)
- zlib
- cudatoolkit
- gtest
- graphviz # Build & Run
- wget
- doxygen # Docs
- python
- pip
- pip:
- sphinx==3.0.3
- sphinx_rtd_theme==0.4.3
- sphinx-tabs==1.1.13
- breathe==4.16.0
- sphinx==3.2.1
- sphinx_rtd_theme==0.5.0
- sphinx-tabs==1.3.0
- breathe==4.22.1
.. note::
Expand Down Expand Up @@ -125,6 +131,10 @@ troubleshoot the compilation process (see: :doc:``troubleshoot``).
-DCMAKE_PREFIX_PATH=/path/to/dir
.. note::

If using conda, get the path by activating the environment, and typing ``echo $CONDA_PREFIX``


- **Installation paths:** To change the installation paths, use the following cmake option:

Expand All @@ -135,13 +145,14 @@ troubleshoot the compilation process (see: :doc:``troubleshoot``).
.. note::

Defaults to ``/usr/local`` on UNIX and ``c:/Program Files`` on Windows.
If using conda, get the path by activating the environment, and typing ``echo $CONDA_PREFIX``


- **C++ compiler:** If you have problems with the default g++ compiler, try setting ``EIGEN3_INCLUDE_DIR``, such as:

.. code:: bash
-DCMAKE_CXX_COMPILER=/path/to/c++compiler
-DCMAKE_CXX_COMPILER=/path/to/c++compiler # /usr/bin/g++-8
.. note::

Expand All @@ -152,25 +163,35 @@ troubleshoot the compilation process (see: :doc:``troubleshoot``).

.. code:: bash
-DCMAKE_CUDA_COMPILER=/path/to/cuda compiler
-DCMAKE_CUDA_COMPILER=/path/to/cuda compiler #/usr/bin/nvcc
.. note::

You can also create a symbolic link: (unix) ``sudo ln -s usr/local/cuda-{VERSION} /usr/local/cuda``


- **CUDA host compiler:** If cmake have problems finding your cuda host compiler, try setting ``CMAKE_CUDA_COMPILER``, such as:

.. code:: bash
-DCMAKE_CUDA_HOST_COMPILER=/path/to/cuda compiler # /usr/bin/g++-8
.. note::

You can also create a symbolic link: (unix) ``sudo ln -s usr/local/cuda-{VERSION} /usr/local/cuda``

- **CUDA Toolkit:** If CMake is unable to find CUDA automatically, try setting ``CUDA_TOOLKIT_ROOT_DIR``, such as:

.. code:: bash
-DCUDA_TOOLKIT_ROOT_DIR=/path/to/cuda
-DCUDA_TOOLKIT_ROOT_DIR=/path/to/cuda # /usr/local/cuda-11.1
- **Eigen3:** At the core of many numerical operations, we use Eigen3_. If CMake is unable to find Eigen3 automatically, try setting ``Eigen3_DIR``, such as:

.. code:: bash
-DEigen3_DIR=/path/to/eigen
-DEigen3_DIR=/path/to/eigen # /usr/lib/cmake/eigen3
- **Use OpenMP:** To enable/disabled OpenMP, use the setting ``BUILD_OPENMP``, such as:
Expand Down
43 changes: 24 additions & 19 deletions docs/sphinx/source/installation/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,47 @@ FAQ
===


Python library
---------------

Is there a Python version?
--------------------------
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Yes, the PyEDDL_ is the EDDL version for the Python lovers


Can I contribute?
------------------
Is the PyEDDL develop by the same team
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Yes, but first open a new issue to explain and discuss your contribution.
Sort of. We all are part of the DeepHealth project, and although each team is specialized
in developing and supporting different libraries, we all contribute to the other projects so that all the DeepHealth
ecosystem can work smoothly.


Can I control the memory consumption?
-------------------------------------
Contributions
---------------

Yes, we offer several memory levels to control the memory-speed trade-off. These levels are:

Can I contribute?
^^^^^^^^^^^^^^^^^^

Yes, but first open a new issue to explain and discuss your contribution.

- ``full_mem`` (default): No memory bound (highest speed at the expense of the memory requirements)
- ``mid_mem``: Slight memory optimization (good trade-off memory-speed)
- ``low_mem``: Optimized for hardware with restricted memory capabilities.

Performance
---------------

Is it faster than PyTorch/TensorFlow/etc
----------------------------------------
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Depends... Generally, there are many nuances so that a high-performance can be achieved (see benchmark section) and many of
those nuances are strongly tied to the classical memory-speed trade-off. To sum up, matrix multiplications on the CPU
are a 300% faster than their TensorFlow counterpart. Convolution times on GPU (no cuDNN) are slightly faster than on the
EDDL than PyTorch (210ms vs. 246ms), and using cuDNN will get the cuDNN performance.
Check our benchmakrs: `EDDL benchmarks`_


Is it more memory-efficient than PyTorch/TensorFlow/etc
-------------------------------------------------------

Depends on your memory setting (see the "Can I control the memory consumption?" answer).
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Depends on your memory setting, see the "Can I control the memory consumption?" answer.
Also, you can take a look at our benchmakrs: `EDDL benchmarks`_

.. _PyEDDL: https://github.com/deephealthproject/pyeddl
.. _PyEDDL: https://github.com/deephealthproject/pyeddl
.. _`EDDL benchmarks`: https://github.com/jofuelo/eddl_benchmark
Loading

0 comments on commit 49dca26

Please sign in to comment.