Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ framework of the ERDF Operative Programme for Catalunya 2014-2020.
- H2020 PerMedCoE Center of Excellence (Contract 951773)
- Horizon Europe CAELESTIS project (Contract 101056886)
- Horizon Europe DT-Geo project (Contract 101058129)
- Horizon Europe CyclOps project (Contract 101135513)

## License

Expand Down
65 changes: 30 additions & 35 deletions dislib/eddl/encapsulate_function_distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class EncapsulatedFunctionsDistributedEddl(object):
- Synchronous training: At the end of each epoch, the weights are
synchronized and the update is computed.
- Partially asynchronous: The weights of each worker are updated
commutatively with the general weights and viceversa.
- Asynchronous training: A synchronization and update of the weigths is
commutatively with the general weights and vice versa.
- Asynchronous training: A synchronization and update of the weights is
done after executing all the epochs or each n specified epochs.

Attributes
Expand All @@ -29,8 +29,8 @@ class EncapsulatedFunctionsDistributedEddl(object):
weights and biases of the different layers of the network that
is being trained.
compss_object: list
List that contains objects of type PytorchDistributed, each of the
objects in this list makes a small part of the epoch training in
List that contains objects of type EddlDistributedConmutativo, each of
the objects in this list makes a small part of the epoch training in
parallel to the rest.
num_workers: int
Number of parallel trainings existing.
Expand All @@ -41,9 +41,8 @@ def __init__(self, num_workers=10):

def build(self, net, optimizer, loss, metric, num_gpu=0, num_nodes=0):
"""
Builds the model to obtain the initial parameters of the training
and it also builds the model in each worker
in order to be ready to start the training.
Builds the model to obtain the initial training parameters and
prepares a copy in each worker, ready to start the training.

Parameters
----------
Expand Down Expand Up @@ -120,8 +119,8 @@ def fit_synchronous_shuffle_every_n_epochs_with_GPU(self, x_train,
num_epochs,
n_epocs_sync=1):
"""
Training of the neural network performing a syncrhonization every n
specified epochs, it performs a total shuffle of the dataset used.
Training of the neural network performing a synchronization every n
specified epochs, performing a total shuffle of the dataset.

Parameters
----------
Expand All @@ -135,7 +134,7 @@ def fit_synchronous_shuffle_every_n_epochs_with_GPU(self, x_train,
num_epochs: int
Total number of epochs to train the model
n_epocs_sync: int
Number of epochs to train before performing a syncrhonization
Number of epochs to train before performing a synchronization
and between synchronizations
Returns
-------
Expand Down Expand Up @@ -180,9 +179,9 @@ def fit_synchronous_every_n_epochs_with_GPU(self, x_train, y_train,
shuffle_blocks=True,
shuffle_block_data=True):
"""
Training of the neural network performing a syncrhonization every
n specified epochs, it performs a total shuffle of the tensors on
the ds_tensor and the elements inside each tensor
Training of the neural network performing a synchronization every
n specified epochs, shuffling the tensors of the ds_tensor and the
elements inside each tensor

Parameters
----------
Expand All @@ -196,7 +195,7 @@ def fit_synchronous_every_n_epochs_with_GPU(self, x_train, y_train,
num_epochs: int
Total number of epochs to train the model
n_epocs_sync: int
Number of epochs to train before performing a syncrhonization
Number of epochs to train before performing a synchronization
and between synchronizations
shuffle_blocks: boolean
Variable specifying to shuffle the blocks of the ds_tensor or not
Expand Down Expand Up @@ -247,9 +246,9 @@ def fit_synchronous_with_GPU(self, x_train, y_train,
num_epochs, shuffle_blocks=True,
shuffle_block_data=True):
"""
Training of the neural network performing a syncrhonization of
the weights at the end of each epoch, it performs a total shuffle
of the tensors on the ds_tensor and the elements inside each tensor
Training of the neural network performing a synchronization of
the weights at the end of each epoch, shuffling the tensors of the
ds_tensor and the elements inside each tensor

Parameters
----------
Expand Down Expand Up @@ -306,8 +305,8 @@ def fit_synchronous_shuffle_with_GPU(self, x_train, y_train,
num_batches_per_worker,
num_epochs):
"""
Training of the neural network performing a syncrhonization of
the weights every epoch, it performs a total shuffle of the dataset
Training of the neural network performing a synchronization of
the weights every epoch, performing a total shuffle of the dataset

Parameters
----------
Expand Down Expand Up @@ -359,10 +358,9 @@ def fit_asynchronous_with_GPU(self, x_train, y_train,
shuffle_blocks=True,
shuffle_block_data=True):
"""
Training of the neural network performing an asyncrhonous update of
the weights every epoch,
it performs a shuffle of the tensors on the ds_tensor and a local
shuffle of the elements inside each tensor
Training of the neural network performing an asynchronous update of
the weights every epoch, shuffling the tensors of the ds_tensor and
locally shuffling the elements inside each tensor

Parameters
----------
Expand Down Expand Up @@ -417,9 +415,8 @@ def fit_asynchronous_shuffle_with_GPU(self, x_train, y_train,
num_batches_per_worker,
num_epochs):
"""
Training of the neural network performing an asyncrhonous update of
the weights every epoch,
it performs a total shuffle of the dataset
Training of the neural network performing an asynchronous update of
the weights every epoch, performing a total shuffle of the dataset

Parameters
----------
Expand Down Expand Up @@ -471,10 +468,9 @@ def fit_asynchronous_n_epochs_with_GPU(self, x_train, y_train,
shuffle_blocks=True,
shuffle_block_data=True):
"""
Training of the neural network performing an asyncrhonous update of
the weights every n epochs,
it performs a shuffle of the tensors and locally a shuffle of the
elements inside each tensor
Training of the neural network performing an asynchronous update of
the weights every n epochs, shuffling the tensors and locally
shuffling the elements inside each tensor

Parameters
----------
Expand All @@ -488,7 +484,7 @@ def fit_asynchronous_n_epochs_with_GPU(self, x_train, y_train,
num_epochs: int
Total number of epochs to train the model
n_epocs_sync: int
Number of epochs to train before performing an asyncrhonous
Number of epochs to train before performing an asynchronous
update of the weights and between the following updates
shuffle_blocks: boolean
Variable specifying to shuffle the blocks of the ds_tensor or not
Expand Down Expand Up @@ -537,9 +533,8 @@ def fit_asynchronous_shuffle_n_epochs_with_GPU(self, x_train, y_train,
num_epochs,
n_epocs_sync=0):
"""
Training of the neural network performing an asyncrhonous update of
the weights every n epochs,
it performs a total shuffle of the dataset
Training of the neural network performing an asynchronous update of
the weights every n epochs, performing a total shuffle of the dataset

Parameters
----------
Expand All @@ -553,7 +548,7 @@ def fit_asynchronous_shuffle_n_epochs_with_GPU(self, x_train, y_train,
num_epochs: int
Total number of epochs to train the model
n_epocs_sync: int
Number of epochs to train before performing an asyncrhonous
Number of epochs to train before performing an asynchronous
update of the weights and between the following updates
Returns
-------
Expand Down
59 changes: 28 additions & 31 deletions dislib/pytorch/encapsulated_functions_distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ class EncapsulatedFunctionsDistributedPytorch(object):
- Synchronous training: At the end of each epoch, the weights are
synchronized and the update is computed.
- Partially asynchronous: The weights of each worker are updated
commutatively with the general weights and viceversa.
- Asynchronous training: A synchronization and update of the weigths is
commutatively with the general weights and vice versa.
- Asynchronous training: A synchronization and update of the weights is
done after executing all the epochs or each n specified epochs.

Attributes
Expand All @@ -86,9 +86,8 @@ def __init__(self, num_workers=10):
def build(self, net, optimizer, loss, optimizer_parameters,
num_gpu=0, num_nodes=0):
"""
Builds the model to obtain the initial parameters of the training
and it also builds the model in each worker in order to be ready
to start the training.
Builds the model to obtain the initial training parameters and
prepares a copy in each worker, ready to start the training.

Parameters
----------
Expand Down Expand Up @@ -133,8 +132,8 @@ def fit_synchronous_shuffle_every_n_epochs_with_GPU(self, x_train,
num_epochs,
n_epocs_sync=1):
"""
Training of the neural network performing a syncrhonization every n
specified epochs, it performs a total shuffle of the dataset used.
Training of the neural network performing a synchronization every n
specified epochs, performing a total shuffle of the dataset.

Parameters
----------
Expand All @@ -148,7 +147,7 @@ def fit_synchronous_shuffle_every_n_epochs_with_GPU(self, x_train,
num_epochs: int
Total number of epochs to train the model
n_epocs_sync: int
Number of epochs to train before performing a syncrhonization and
Number of epochs to train before performing a synchronization and
between synchronizations
Returns
-------
Expand Down Expand Up @@ -193,9 +192,9 @@ def fit_synchronous_every_n_epochs_with_GPU(self, x_train, y_train,
shuffle_blocks=True,
shuffle_block_data=True):
"""
Training of the neural network performing a syncrhonization every n
specified epochs, it performs a total shuffle of the tensors on the
ds_tensor and the elements inside each tensor
Training of the neural network performing a synchronization every n
specified epochs, shuffling the tensors of the ds_tensor and the
elements inside each tensor

Parameters
----------
Expand All @@ -209,7 +208,7 @@ def fit_synchronous_every_n_epochs_with_GPU(self, x_train, y_train,
num_epochs: int
Total number of epochs to train the model
n_epocs_sync: int
Number of epochs to train before performing a syncrhonization
Number of epochs to train before performing a synchronization
and between synchronizations
shuffle_blocks: boolean
Variable specifying to shuffle the blocks of the ds_tensor or not
Expand Down Expand Up @@ -260,9 +259,9 @@ def fit_synchronous_with_GPU(self, x_train, y_train,
shuffle_blocks=True,
shuffle_block_data=True):
"""
Training of the neural network performing a syncrhonization of the
weights at the end of each epoch, it performs a total shuffle of
the tensors on the ds_tensor and the elements inside each tensor
Training of the neural network performing a synchronization of the
weights at the end of each epoch, shuffling the tensors of the
ds_tensor and the elements inside each tensor

Parameters
----------
Expand Down Expand Up @@ -319,8 +318,8 @@ def fit_synchronous_shuffle_with_GPU(self, x_train, y_train,
num_batches_per_worker,
num_epochs):
"""
Training of the neural network performing a syncrhonization of
the weights every epoch, it performs a total shuffle of the dataset
Training of the neural network performing a synchronization of
the weights every epoch, performing a total shuffle of the dataset

Parameters
----------
Expand Down Expand Up @@ -371,10 +370,9 @@ def fit_asynchronous_with_GPU(self, x_train, y_train,
shuffle_blocks=True,
shuffle_block_data=True):
"""
Training of the neural network performing an asyncrhonous update
of the weights every epoch, it performs a shuffle of the tensors
on the ds_tensor and a local shuffle of the elements inside each
tensor
Training of the neural network performing an asynchronous update
of the weights every epoch, shuffling the tensors of the ds_tensor
and locally shuffling the elements inside each tensor

Parameters
----------
Expand Down Expand Up @@ -430,9 +428,8 @@ def fit_asynchronous_shuffle_with_GPU(self, x_train, y_train,
num_batches_per_worker,
num_epochs):
"""
Training of the neural network performing an asyncrhonous
update of the weights every epoch, it performs a total shuffle
of the dataset
Training of the neural network performing an asynchronous update
of the weights every epoch, performing a total shuffle of the dataset

Parameters
----------
Expand Down Expand Up @@ -484,9 +481,9 @@ def fit_asynchronous_n_epochs_with_GPU(self, x_train, y_train,
shuffle_blocks=True,
shuffle_block_data=True):
"""
Training of the neural network performing an asyncrhonous update
of the weights every n epochs, it performs a shuffle of the tensors
and locally a shuffle of the elements inside each tensor
Training of the neural network performing an asynchronous update
of the weights every n epochs, shuffling the tensors and locally
shuffling the elements inside each tensor

Parameters
----------
Expand All @@ -500,7 +497,7 @@ def fit_asynchronous_n_epochs_with_GPU(self, x_train, y_train,
num_epochs: int
Total number of epochs to train the model
n_epocs_sync: int
Number of epochs to train before performing an asyncrhonous
Number of epochs to train before performing an asynchronous
update of the weights and between the following updates
shuffle_blocks: boolean
Variable specifying to shuffle the blocks of the ds_tensor or not
Expand Down Expand Up @@ -548,8 +545,8 @@ def fit_asynchronous_shuffle_n_epochs_with_GPU(self, x_train,
num_epochs,
n_epocs_sync=0):
"""
Training of the neural network performing an asyncrhonous update
of the weights every n epochs, it performs a total shuffle of the
Training of the neural network performing an asynchronous update
of the weights every n epochs, performing a total shuffle of the
dataset

Parameters
Expand All @@ -564,7 +561,7 @@ def fit_asynchronous_shuffle_n_epochs_with_GPU(self, x_train,
num_epochs: int
Total number of epochs to train the model
n_epocs_sync: int
Number of epochs to train before performing an asyncrhonous update
Number of epochs to train before performing an asynchronous update
of the weights and between the following updates
Returns
-------
Expand Down
7 changes: 4 additions & 3 deletions docker/push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ if [[ "$1" == "--versioned" ]]; then
VERSION=$(cat "$ROOT_DIR/VERSION")
fi

docker login -u "${dh_username}" -p "${dh_password}"
docker push bscwdc/dislib:latest
docker push bscwdc/dislib:torch
if $VERSIONED; then
docker push bscwdc/dislib:${VERSION}
docker push bscwdc/dislib:${VERSION}-torch
docker tag bscwdc/dislib:latest bscwdc/dislib:v${VERSION}
docker tag bscwdc/dislib:torch bscwdc/dislib:v${VERSION}-torch
docker push bscwdc/dislib:v${VERSION}
docker push bscwdc/dislib:v${VERSION}-torch
fi
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
napoleon_use_param = False
napoleon_use_ivar = True

autodoc_mock_imports = ['pycompss', 'pyeddl', 'eddl']
autodoc_mock_imports = ['pycompss', 'pyeddl', 'eddl', 'torch']

autodoc_default_options = {
'exclude-members': (
Expand Down
Loading