Skip to content

Commit 7ac88b4

Browse files
authored
Merge pull request #259 from deephealthproject/develop
Develop
2 parents 8fd26ff + 32b8c43 commit 7ac88b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2003
-756
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.git/
22
cmake-*/
3-
build/
3+
/[Bb]uild*
4+
_build/
45
Dockerfile

Dockerfile

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
FROM ubuntu:20.04
2+
3+
# Install minimum dependencies ******************
4+
RUN apt-get update
5+
RUN apt-get install -y build-essential ca-certificates apt-utils checkinstall # Essentials
6+
RUN apt-get install -y git wget vim
7+
8+
# Install miniconda
9+
RUN wget \
10+
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
11+
&& mkdir /root/.conda \
12+
&& bash Miniconda3-latest-Linux-x86_64.sh -b \
13+
&& rm -f Miniconda3-latest-Linux-x86_64.sh
14+
15+
# Activate conda
16+
ENV PATH="/root/miniconda3/bin:$PATH"
17+
RUN conda --version
18+
19+
# Set working directory
20+
WORKDIR /eddl
21+
22+
# Environment first (to reduce the building time if something has change)
23+
COPY environment.yml .
24+
25+
# Install dependencies
26+
RUN conda update conda && \
27+
conda env create -f environment.yml
28+
29+
# Copy repo
30+
COPY . .
31+
32+
# Make RUN commands use the new environment:
33+
SHELL ["conda", "run", "-n", "eddl", "/bin/bash", "-c"]
34+
35+
# Build EDDL
36+
RUN mkdir build
37+
RUN cd build && \
38+
cmake .. \
39+
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
40+
-DBUILD_SUPERBUILD=OFF \
41+
-DBUILD_TARGET=CPU \
42+
-DBUILD_HPC=OFF -DBUILD_TESTS=ON \
43+
-DBUILD_DIST=OFF -DBUILD_RUNTIME=OFF
44+
RUN cd build && \
45+
make -j$(nproc) && \
46+
make install
47+
48+
# Test EDDL
49+
RUN cd build/bin/ && ./unit_tests
50+
51+
# Build docs (optional, check .dockerignore)
52+
RUN cd docs/doxygen/ && doxygen
53+
RUN cd docs/sphinx/source/ && make clean && make html
54+

docker/Dockerfile

Lines changed: 0 additions & 40 deletions
This file was deleted.

docs/markdown/benchmarks.md

Lines changed: 159 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,57 @@ Benchmarks for development.
1414

1515
**Default flags:**
1616

17+
**Version: v0.9**
18+
```
19+
Setup
20+
-------
21+
VERSION: v0.9
22+
TARGET: CUDNN
23+
CORES: 16
24+
EPOCHS: 5
25+
-- C++ flags: -fopenmp
26+
-- C++ flags (release): -O3 -march=native -mtune=native -Ofast -msse -mfpmath=sse -ffast-math -ftree-vectorize
27+
-- C++ flags (debug): -O0 -g
28+
29+
Training/Evaluation:
30+
--------------------
31+
Epoch 1
32+
Batch 300 softmax4 ( loss[softmax_cross_entropy]=0.2405 metric[categorical_accuracy]=0.9279 ) -- 0.0049 secs/batch
33+
1.4780 secs/epoch
34+
Epoch 2
35+
Batch 300 softmax4 ( loss[softmax_cross_entropy]=0.0799 metric[categorical_accuracy]=0.9760 ) -- 0.0043 secs/batch
36+
1.2766 secs/epoch
37+
Epoch 3
38+
Batch 300 softmax4 ( loss[softmax_cross_entropy]=0.0507 metric[categorical_accuracy]=0.9841 ) -- 0.0041 secs/batch
39+
1.2286 secs/epoch
40+
41+
Memory:
42+
--------
43+
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
44+
4516 salvaca+ 20 0 12,3g 1,8g 544700 R 350,0 11,7 0:13.12 cifar_conv
45+
46+
GPU Memory:
47+
Wed Feb 17 12:56:16 2021
48+
+-----------------------------------------------------------------------------+
49+
| NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.2 |
50+
|-------------------------------+----------------------+----------------------+
51+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
52+
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
53+
| | | MIG M. |
54+
|===============================+======================+======================|
55+
| 0 GeForce GTX 1070 On | 00000000:09:00.0 On | N/A |
56+
| 49% 67C P2 100W / 190W | 1939MiB / 8118MiB | 83% Default |
57+
| | | N/A |
58+
+-------------------------------+----------------------+----------------------+
59+
60+
```
61+
62+
**Version: v0.7**
1763
```
1864
Setup
1965
-------
2066
VERSION: v0.7
21-
TARGET: CPU
67+
TARGET: GPU
2268
CORES: 16
2369
EPOCHS: 1
2470
C++ flags (release): -O3
@@ -47,13 +93,45 @@ GPU Memory:
4793
| 0 GeForce GTX 1070 Off | 00000000:09:00.0 On | N/A |
4894
| 54% 71C P2 76W / 190W | 1188MiB / 8118MiB | 71% Default |
4995
+-------------------------------+----------------------+----------------------+
50-
5196
```
5297

5398
#### CPU only
5499

55100
**Default flags:**
56101

102+
103+
**Version: v0.9**
104+
```
105+
Setup
106+
-------
107+
VERSION: v0.7
108+
TARGET: CPU
109+
CORES: 16
110+
EPOCHS: 5
111+
-- C++ flags: -fopenmp
112+
-- C++ flags (release): -O3 -march=native -mtune=native -Ofast -msse -mfpmath=sse -ffast-math -ftree-vectorize
113+
-- C++ flags (debug): -O0 -g
114+
115+
Training/Evaluation:
116+
--------------------
117+
Epoch 1
118+
Batch 300 softmax4 ( loss[softmax_cross_entropy]=0.2374 metric[categorical_accuracy]=0.9297 ) -- 0.0406 secs/batch
119+
12.1930 secs/epoch
120+
Epoch 2
121+
Batch 300 softmax4 ( loss[softmax_cross_entropy]=0.0790 metric[categorical_accuracy]=0.9764 ) -- 0.0337 secs/batch
122+
10.1122 secs/epoch
123+
Epoch 3
124+
Batch 300 softmax4 ( loss[softmax_cross_entropy]=0.0515 metric[categorical_accuracy]=0.9839 ) -- 0.0485 secs/batch
125+
14.5351 secs/epoch
126+
127+
Memory:
128+
--------
129+
PID USER PRI NI VIRT RES S CPU% MEM% TIME+ Command
130+
309406 salvaca+ 20 0 872076 318928 13228 R 1444 1,9 11:58.60 mnist_mlp
131+
132+
```
133+
134+
**Version: v0.7**
57135
```
58136
Setup
59137
-------
@@ -179,6 +257,49 @@ Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
179257

180258
**Default flags:**
181259

260+
**Version: v0.9**
261+
```
262+
Setup
263+
-------
264+
VERSION: v0.9
265+
TARGET: CUDNN
266+
CORES: 16
267+
EPOCHS: 1
268+
-- C++ flags: -fopenmp
269+
-- C++ flags (release): -O3 -march=native -mtune=native -Ofast -msse -mfpmath=sse -ffast-math -ftree-vectorize
270+
-- C++ flags (debug): -O0 -g
271+
272+
Training/Evaluation:
273+
--------------------
274+
5 epochs of 500 batches of size 100
275+
Epoch 1
276+
Batch 500 softmax6 ( loss[softmax_cross_entropy]=1.6524 metric[categorical_accuracy]=0.3853 ) -- 0.0074 secs/batch
277+
3.6942 secs/epoch
278+
Epoch 2
279+
Batch 500 softmax6 ( loss[softmax_cross_entropy]=1.1562 metric[categorical_accuracy]=0.5863 ) -- 0.0069 secs/batch
280+
3.4294 secs/epoch
281+
Epoch 3
282+
Batch 500 softmax6 ( loss[softmax_cross_entropy]=0.9170 metric[categorical_accuracy]=0.6756 ) -- 0.0067 secs/batch
283+
3.3702 secs/epoch
284+
285+
Memory:
286+
--------
287+
PID USER PRI NI VIRT RES S CPU% MEM% TIME+ Command
288+
12366 salvaca+ 20 0 11,137g 1,011g 191004 R 1562 6,5 0:28.25 cifar_conv
289+
290+
GPU Memory:
291+
+-----------------------------------------------------------------------------+
292+
| NVIDIA-SMI 440.82 Driver Version: 440.82 CUDA Version: 10.2 |
293+
|-------------------------------+----------------------+----------------------+
294+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
295+
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
296+
|===============================+======================+======================|
297+
| 0 GeForce GTX 1070 Off | 00000000:09:00.0 On | N/A |
298+
| 58% 77C P2 88W / 190W | 1369MiB / 8118MiB | 94% Default |
299+
+-------------------------------+----------------------+----------------------+
300+
```
301+
302+
**Version: v0.7**
182303
```
183304
Setup
184305
-------
@@ -213,15 +334,49 @@ GPU Memory:
213334
| 0 GeForce GTX 1070 Off | 00000000:09:00.0 On | N/A |
214335
| 58% 77C P2 88W / 190W | 1369MiB / 8118MiB | 94% Default |
215336
+-------------------------------+----------------------+----------------------+
216-
217-
218337
```
219338

220339

221340
#### CPU only
222341

223342
**Default flags:**
224343

344+
**Version: v0.9**
345+
```
346+
Setup
347+
-------
348+
VERSION: v0.7
349+
TARGET: CPU
350+
CORES: 16
351+
EPOCHS: 3
352+
-- C++ flags: -fopenmp
353+
-- C++ flags (release): -O3 -march=native -mtune=native -Ofast -msse -mfpmath=sse -ffast-math -ftree-vectorize
354+
-- C++ flags (debug): -O0 -g
355+
356+
Training/Evaluation:
357+
--------------------
358+
3 epochs of 500 batches of size 100
359+
Epoch 1
360+
Batch 500 softmax6 ( loss[softmax_cross_entropy]=1.6671 metric[categorical_accuracy]=0.3816 ) -- 0.1481 secs/batch
361+
74.0601 secs/epoch
362+
Epoch 2
363+
Batch 500 softmax6 ( loss[softmax_cross_entropy]=1.1738 metric[categorical_accuracy]=0.5817 ) -- 0.1678 secs/batch
364+
83.8880 secs/epoch
365+
Epoch 3
366+
Batch 500 softmax6 ( loss[softmax_cross_entropy]=0.9311 metric[categorical_accuracy]=0.6737 ) -- 0.1466 secs/batch
367+
73.3027 secs/epoch
368+
Evaluate with batch size 100
369+
Batch 100 softmax6 ( loss[softmax_cross_entropy]=0.9291 metric[categorical_accuracy]=0.6796 ) --
370+
371+
Memory:
372+
--------
373+
PID USER PRI NI VIRT RES S CPU% MEM% TIME+ Command
374+
335469 salvaca+ 20 0 10,4g 1,4g 127808 R 1406 9,2 32:51.72 cifar_conv
375+
376+
```
377+
378+
**Version: v0.7**
379+
225380
```
226381
Setup
227382
-------

docs/markdown/development.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,11 @@ cd protobuf/
138138
./autogen.sh && ./configure && make
139139
sudo make install
140140
```
141+
142+
### Docker
143+
144+
```
145+
cd eddl/
146+
docker build -f Dockerfile .
147+
148+
```

docs/sphinx/source/bundle/computing_service.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,32 @@ COMPSS
7272
**Not implemented yet**
7373

7474

75+
Serialization
76+
==============
77+
A computing service configuration can be stored and loaded to create a
78+
new equivalent computing service. To do it we serialize the configuration
79+
using protocol buffers and the ONNX standard definition.
80+
81+
Export to file
82+
------------------
83+
84+
.. doxygenfunction:: save_compserv_to_onnx_file
85+
86+
Example:
87+
88+
.. code-block:: c++
89+
90+
compserv cs = CS_GPU({1});
91+
save_compserv_to_onnx_file(cs, "my_cs.onnx");
92+
93+
94+
Import from file
95+
------------------
96+
97+
.. doxygenfunction:: import_compserv_from_onnx_file
98+
99+
Example:
100+
101+
.. code-block:: c++
102+
103+
compserv cs = import_compserv_from_onnx_file("my_cs.onnx");

docs/sphinx/source/bundle/optimizers.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,26 @@ Example:
8989

9090
opt = sgd(0.001);
9191

92+
93+
Export to file
94+
------------------
95+
96+
.. doxygenfunction:: save_optimizer_to_onnx_file
97+
98+
Example:
99+
100+
.. code-block:: c++
101+
102+
optimizer opt = sgd(0.001, 0.9);
103+
save_optimizer_to_onnx_file(opt, "my_opt.onnx");
104+
105+
Import from file
106+
------------------
107+
108+
.. doxygenfunction:: import_optimizer_from_onnx_file
109+
110+
Example:
111+
112+
.. code-block:: c++
113+
114+
optimizer opt = import_optimizer_from_onnx_file("my_opt.onnx");

docs/sphinx/source/intro/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ See the :doc:`build-options` section for more details about cmake options.
156156

157157
.. code:: bash
158158
159-
cmake .. -DBUILD_SUPERBUILD=ON -DBUILD_TARGET=CUDNN -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc -DCMAKE_CXX_COMPILER=/usr/bin/g++-7``
159+
cmake .. -DBUILD_SUPERBUILD=ON -DBUILD_TARGET=CUDNN -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc -DCMAKE_CXX_COMPILER=/usr/bin/g++-7
160160
161161
162162
Including EDDL in your project

0 commit comments

Comments
 (0)