Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dataloaders to use Aggregation Lists #264

Merged
merged 28 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
77e56ad
First commit
al-rigazzi Feb 27, 2023
7287875
Tests work, need docs
al-rigazzi Feb 27, 2023
17c3a48
Update docs
al-rigazzi Feb 27, 2023
766da9a
Update tutorial, changelog
al-rigazzi Feb 28, 2023
be114e4
Print output and error for failed dataloader tests
al-rigazzi Feb 28, 2023
2b8daa2
Address reviewers' feedback
al-rigazzi Mar 10, 2023
b674caf
Merge branch 'develop' into update_dataloaders
al-rigazzi Mar 10, 2023
7980435
Add test for DataInfo.__repr__
al-rigazzi Mar 10, 2023
67c4a9e
Make style
al-rigazzi Mar 10, 2023
6563fb5
Address reviewer's comments
al-rigazzi Mar 15, 2023
c4b53f1
Fix numpy type in sim
al-rigazzi Mar 16, 2023
1cd096c
Merge branch 'develop' into update_dataloaders
al-rigazzi Mar 16, 2023
b303f92
Merge branch 'develop' into update_dataloaders
al-rigazzi Mar 17, 2023
c90c777
Make tests local for coverage
al-rigazzi Mar 19, 2023
ea4b5f0
Add test for wrong type
al-rigazzi Mar 19, 2023
9b9482b
Remove unused files
al-rigazzi Mar 19, 2023
afc2f65
Reduce workers in pytorch dataloader test
al-rigazzi Mar 19, 2023
e9d8902
Remove train_torch
al-rigazzi Mar 19, 2023
e889219
Augment coverage
al-rigazzi Mar 19, 2023
b52fbc0
Fix crashing torch dl
al-rigazzi Mar 21, 2023
82bedb2
Remove pragma dir
al-rigazzi Mar 21, 2023
2c85470
Make pytorch dataloader less aggressive
al-rigazzi Mar 21, 2023
08781ab
Use main thread for workers
al-rigazzi Mar 21, 2023
70999e1
Remove prefetch factor
al-rigazzi Mar 21, 2023
c702914
Revert last changes
al-rigazzi Mar 22, 2023
33e8eca
Use external training process for torch
al-rigazzi Mar 22, 2023
cd92c9a
Fix coverage for unreachable code
al-rigazzi Mar 22, 2023
7959514
Merge branch 'develop' into update_dataloaders
al-rigazzi Mar 22, 2023
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
3 changes: 3 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ This section details changes made in the development branch that have not yet be

Description

- Update ML data loaders to make use of SmartRedis's aggregation lists
- Drop support for Ray
- Allow for models to be launched independently as batch jobs
- Update to current version of Redis
Expand All @@ -31,6 +32,7 @@ Description

Detailed Notes

- The PyTorch and TensorFlow data loaders were update to make use of aggregation lists. This breaks their API, but makes them easier to use. (PR264_)
- The support for Ray was dropped, as its most recent versions caused problems when deployed through SmartSim.
We plan to release a separate add-on library to accomplish the same results. If
you are interested in getting the Ray launch functionality back in your workflow, please get in touch with us! (PR263_)
Expand All @@ -49,6 +51,7 @@ Detailed Notes
- The release of RedisAI 1.2.7 allows us to update support for recent versions of PyTorch, Tensorflow, and ONNX (PR234_)
- Make installation of correct Torch backend more reliable according to instruction from PyTorch

.. _PR264: https://github.com/CrayLabs/SmartSim/pull/264
.. _PR263: https://github.com/CrayLabs/SmartSim/pull/263
.. _PR258: https://github.com/CrayLabs/SmartSim/pull/258
.. _PR256: https://github.com/CrayLabs/SmartSim/pull/256
Expand Down
1 change: 0 additions & 1 deletion smartsim/_core/control/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ def _launch(self, manifest):
raise SmartSimError(msg)
self._launch_orchestrator(orchestrator)


if self.orchestrator_active:
self._set_dbobjects(manifest)

Expand Down
8 changes: 0 additions & 8 deletions smartsim/_core/control/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def __init__(self, *args):
self._check_names(self._deployables)
self._check_entity_lists_nonempty()


@property
def db(self):
"""Return Orchestrator instances in Manifest
Expand All @@ -69,7 +68,6 @@ def db(self):
_db = deployable
return _db


@property
def models(self):
"""Return Model instances in Manifest
Expand All @@ -83,7 +81,6 @@ def models(self):
_models.append(deployable)
return _models


@property
def ensembles(self):
"""Return Ensemble instances in Manifest
Expand All @@ -103,7 +100,6 @@ def ensembles(self):

return _ensembles


@property
def all_entity_lists(self):
"""All entity lists, including ensembles and
Expand All @@ -119,7 +115,6 @@ def all_entity_lists(self):

return _all_entity_lists


def _check_names(self, deployables):
used = []
for deployable in deployables:
Expand All @@ -130,7 +125,6 @@ def _check_names(self, deployables):
raise SmartSimError("User provided two entities with the same name")
used.append(name)


def _check_types(self, deployables):
for deployable in deployables:
if not (
Expand All @@ -141,15 +135,13 @@ def _check_types(self, deployables):
f"Entity has type {type(deployable)}, not SmartSimEntity or EntityList"
)


def _check_entity_lists_nonempty(self):
"""Check deployables for sanity before launching"""

for entity_list in self.all_entity_lists:
if len(entity_list) < 1:
raise ValueError(f"{entity_list.name} is empty. Nothing to launch.")


def __str__(self):
s = ""
e_header = "=== Ensembles ===\n"
Expand Down
7 changes: 6 additions & 1 deletion smartsim/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,12 @@ def summary(self, format="github"):
)
else:
return tabulate(
values, headers, showindex=True, tablefmt=format, missingval="None", disable_numparse=True
values,
headers,
showindex=True,
tablefmt=format,
missingval="None",
disable_numparse=True,
)

def _launch_summary(self, manifest):
Expand Down
7 changes: 1 addition & 6 deletions smartsim/ml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,4 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from .data import (
DynamicDataDownloader,
StaticDataDownloader,
TrainingDataUploader,
form_name,
)
from .data import DataDownloader, DataInfo, TrainingDataUploader, form_name
Loading