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

Fix the dbmodel and dbscript test errors #313

Merged
merged 2 commits into from
Jul 3, 2023
Merged
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
4 changes: 4 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Description

A full list of changes and detailed notes can be found below:

- Fix tests for db models and scripts
- Fix add_ml_model() and add_script() documentation, tests, and code
- Replace `limit_app_cpus` with `limit_db_cpus` for co-located orchestrators
- Remove wait time associated with Experiment launch summary
Expand All @@ -40,6 +41,8 @@ A full list of changes and detailed notes can be found below:

Detailed notes

- Fix a defect in the tests related to database models and scripts that was
causing key collisions when testing on workload managers (PR313_)
- Fix defect where dictionaries used to create run settings can be changed
unexpectedly due to copy-by-ref (PR305_)
- The underlying code for Model.add_ml_model() and Model.add_script() was fixed
Expand Down Expand Up @@ -70,6 +73,7 @@ Detailed notes
- Typehints have been added to public APIs. A makefile target to execute static
analysis with mypy is available `make check-mypy`. (PR295_)

.. _PR313: https://github.com/CrayLabs/SmartSim/pull/313
.. _PR305: https://github.com/CrayLabs/SmartSim/pull/305
.. _PR304: https://github.com/CrayLabs/SmartSim/pull/304
.. _PR303: https://github.com/CrayLabs/SmartSim/pull/303
Expand Down
16 changes: 16 additions & 0 deletions tests/backends/test_dbmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ def test_tf_db_model(fileutils, wlmutils, mlutils):

# Create RunSettings
run_settings = exp.create_run_settings(exe=sys.executable, exe_args=test_script)
run_settings.set_nodes(1)
run_settings.set_tasks_per_node(1)

# Create Model
smartsim_model = exp.create_model("smartsim_model", run_settings)
Expand Down Expand Up @@ -226,6 +228,8 @@ def test_pt_db_model(fileutils, wlmutils, mlutils):

# Create RunSettings
run_settings = exp.create_run_settings(exe=sys.executable, exe_args=test_script)
run_settings.set_nodes(1)
run_settings.set_tasks_per_node(1)

# Create Model
smartsim_model = exp.create_model("smartsim_model", run_settings)
Expand Down Expand Up @@ -287,6 +291,8 @@ def test_db_model_ensemble(fileutils, wlmutils, mlutils):

# Create RunSettings
run_settings = exp.create_run_settings(exe=sys.executable, exe_args=test_script)
run_settings.set_nodes(1)
run_settings.set_tasks_per_node(1)

# Create ensemble
smartsim_ensemble = exp.create_ensemble(
Expand Down Expand Up @@ -380,6 +386,8 @@ def test_colocated_db_model_tf(fileutils, wlmutils, mlutils):

# Create RunSettings
colo_settings = exp.create_run_settings(exe=sys.executable, exe_args=test_script)
colo_settings.set_nodes(1)
colo_settings.set_tasks_per_node(1)

# Create colocated Model
colo_model = exp.create_model("colocated_model", colo_settings)
Expand Down Expand Up @@ -447,6 +455,8 @@ def test_colocated_db_model_pytorch(fileutils, wlmutils, mlutils):

# Create colocated RunSettings
colo_settings = exp.create_run_settings(exe=sys.executable, exe_args=test_script)
colo_settings.set_nodes(1)
colo_settings.set_tasks_per_node(1)

# Create colocated SmartSim Model
colo_model = exp.create_model("colocated_model", colo_settings)
Expand Down Expand Up @@ -504,6 +514,8 @@ def test_colocated_db_model_ensemble(fileutils, wlmutils, mlutils):

# Create RunSettings for colocated model
colo_settings = exp.create_run_settings(exe=sys.executable, exe_args=test_script)
colo_settings.set_nodes(1)
colo_settings.set_tasks_per_node(1)

# Create ensemble of two identical models
colo_ensemble = exp.create_ensemble(
Expand Down Expand Up @@ -603,6 +615,8 @@ def test_colocated_db_model_ensemble_reordered(fileutils, wlmutils, mlutils):

# Create colocated RunSettings
colo_settings = exp.create_run_settings(exe=sys.executable, exe_args=test_script)
colo_settings.set_nodes(1)
colo_settings.set_tasks_per_node(1)

# Create the ensemble of two identical SmartSim Model
colo_ensemble = exp.create_ensemble(
Expand Down Expand Up @@ -700,6 +714,8 @@ def test_colocated_db_model_errors(fileutils, wlmutils, mlutils):

# Create colocated RunSettings
colo_settings = exp.create_run_settings(exe=sys.executable, exe_args=test_script)
colo_settings.set_nodes(1)
colo_settings.set_tasks_per_node(1)

# Create colocated SmartSim Model
colo_model = exp.create_model("colocated_model", colo_settings)
Expand Down
12 changes: 12 additions & 0 deletions tests/backends/test_dbscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ def test_db_script(fileutils, wlmutils, mlutils):

# Create the RunSettings
run_settings = exp.create_run_settings(exe=sys.executable, exe_args=test_script)
run_settings.set_nodes(1)
run_settings.set_tasks_per_node(1)

# Create the SmartSim Model
smartsim_model = exp.create_model("smartsim_model", run_settings)
Expand Down Expand Up @@ -141,6 +143,8 @@ def test_db_script_ensemble(fileutils, wlmutils, mlutils):

# Create RunSettings
run_settings = exp.create_run_settings(exe=sys.executable, exe_args=test_script)
run_settings.set_nodes(1)
run_settings.set_tasks_per_node(1)

# Create Ensemble with two identical models
ensemble = exp.create_ensemble(
Expand Down Expand Up @@ -230,6 +234,8 @@ def test_colocated_db_script(fileutils, wlmutils, mlutils):

# Create RunSettings
colo_settings = exp.create_run_settings(exe=sys.executable, exe_args=test_script)
colo_settings.set_nodes(1)
colo_settings.set_tasks_per_node(1)

# Create model with colocated database
colo_model = exp.create_model("colocated_model", colo_settings)
Expand Down Expand Up @@ -297,6 +303,8 @@ def test_colocated_db_script_ensemble(fileutils, wlmutils, mlutils):

# Create RunSettings
colo_settings = exp.create_run_settings(exe=sys.executable, exe_args=test_script)
colo_settings.set_nodes(1)
colo_settings.set_tasks_per_node(1)

# Create SmartSim Ensemble with two identical models
colo_ensemble = exp.create_ensemble(
Expand Down Expand Up @@ -391,6 +399,8 @@ def test_colocated_db_script_ensemble_reordered(fileutils, wlmutils, mlutils):

# Create RunSettings
colo_settings = exp.create_run_settings(exe=sys.executable, exe_args=test_script)
colo_settings.set_nodes(1)
colo_settings.set_tasks_per_node(1)

# Create Ensemble with two identical SmartSim Model
colo_ensemble = exp.create_ensemble(
Expand Down Expand Up @@ -483,6 +493,8 @@ def test_db_script_errors(fileutils, wlmutils, mlutils):

# Create RunSettings
colo_settings = exp.create_run_settings(exe=sys.executable, exe_args=test_script)
colo_settings.set_nodes(1)
colo_settings.set_tasks_per_node(1)

# Create a SmartSim model with a colocated database
colo_model = exp.create_model("colocated_model", colo_settings)
Expand Down