0.21.0
Substra 0.21.0 (first OS release) - 2022-09-12
This is our first open source release since 2021! When the product was
closed source it used to be named Connect. It is now renamed Substra.
This is an overview of the main changes, please have a look at the
changelog of every repos to have a full grasp on what has changed:
- substra
changelog - substrafl
changelog - frontend
changelog - substra-tools
changelog - backend
changelog - orchestrator
changelog
Main changes
- Admin and user roles have been introduced. The user role is the same
as the previous role. The admin role can, in addition, manage users
and define their roles. The admin can create users and reset their
password in the GUI. - BREAKING CHANGE: remove the shared local folder of the compute
plan - BREAKING CHANGE: pass the algo method to execute under the
--method-name
argument within the within the cli of the task
execution. If the interface between substra and the backend is
handled via substratools, there are no changes to apply within the
substra code but algo and metricDockerfiles
should expose a
--method-name
argument in theENTRYPOINT
. - BREAKING CHANGE: an extra argument
predictions_path
has been
added to bothpredict
and_local_predict
methods from all
TorchAlgo
classes. The user now have to use the
_save_predictions
method to save its predictions in
_local_predict
. The user defined metrics will load those saved
prediction withnp.load(inputs['predictions'])
. The
_save_predictions
method can be overwritten.
Default _local_predict
method from substrafl algorithms went from:
def _local_predict(self, predict_dataset: torch.utils.data.Dataset):
if self._index_generator is not None:
predict_loader = torch.utils.data.DataLoader(predict_dataset, batch_size=self._index_generator.batch_size)
else:
raise BatchSizeNotFoundError(
\"No default batch size has been found to perform local prediction. \"
\"Please overwrite the _local_predict function of your algorithm.\"
)
self._model.eval()
predictions = torch.Tensor([])
with torch.inference_mode():
for x in predict_loader:
predictions = torch.cat((predictions, self._model(x)), 0)
return predictions}
to
def _local_predict(self, predict_dataset: torch.utils.data.Dataset, predictions_path: Path):
if self._index_generator is not None:
predict_loader = torch.utils.data.DataLoader(predict_dataset, batch_size=self._index_generator.batch_size)
else:
raise BatchSizeNotFoundError(
\"No default batch size has been found to perform local prediction. \"
\"Please overwrite the _local_predict function of your algorithm.\"
)
self._model.eval()
predictions = torch.Tensor([])
with torch.inference_mode():
for x in predict_loader:
predictions = torch.cat((predictions, self._model(x)), 0)
self._save_predictions(predictions, predictions_path)
return predictions}
GUI
- GUI: the page size has been increased from 10 to 30 items displayed
- GUI: Fixed: keep filtering/ordering setup when refreshing an asset
list page - GUI: Fixed: filtering on compute plan duration
- GUI: Fixed: the columns
name
,status
anddates
are displayed
by default in the compute plans page - GUI: Fixed: broken unselection of compute plans in comparison page
- GUI: Fixed: CP columns and favorites disappear on logout
- GUI: the CP workflow graph now displays CPs with up to 1000 tasks,
instead of 300 - The test task rank now have the same behaviour as for other tasks
(parent task rank + 1)
Substra
-
added
list_model
to the SDK client -
Download function of the client return the path of downloaded file
-
Local mode: add a check, a task output of type performance must have
public permissions -
Fix the filters on status for compute plans and tasks. This fix also
introduces some changes: the value for the filters on status must
now be a list (like for other filters, there is a OR condition
between elements of the list) and its value must be
substra.models.ComputePlanStatus.{name of the status}.value
for
compute plans andsubstra.models.Status.{name of the status}.value
for tasks.Example:
# Return all the composite traintuples with the status \"doing\"
client.list_composite_traintuple(filters={\"status\": [substra.models.Status.doing.value]})}
- changed the
metrics
andalgo
definition relying on substra
tools. All the methods of those objects now takeinputs
and
outputs
as arguments; which areTypedDict
.
Substrafl
- Throw an error if
pytorch 1.12.0
is used. There is a regression
bug intorch 1.12.0
, that impacts optimizers that have been
pickled and unpickled. This bug occurs for Adam optimizer for
example (but not for SGD). Here is a link to one issue covering it:
pytorch/pytorch#80345 - In the PyTorch algorithms, move the data to the device (GPU or CPU)
in the training loop and predict function so that the user does not
need to do it.