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

Fixes after verbosity merge #513

Merged
merged 65 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
5e32788
experiment preview method and tests
juliaputko Dec 19, 2023
6ab3dc7
mypy fix
juliaputko Dec 21, 2023
09285d2
lint error fix
juliaputko Dec 21, 2023
cf4adbc
experiment preview with jinja
juliaputko Jan 3, 2024
c4046c1
added jinja as dependency
juliaputko Jan 4, 2024
d9cf92b
addressing comments, and adding tests
juliaputko Jan 11, 2024
a2eace9
type change
juliaputko Jan 11, 2024
0d04640
ccreation of html templates and refactor of checking nto render function
juliaputko Jan 12, 2024
446bf98
Merge branch 'exppreview' of https://github.com/juliaputko/SmartSim i…
Jan 16, 2024
6323c7a
defining literals,changing loggin fmt, and docstring update
Jan 17, 2024
bb865fe
working on building orch items
Jan 17, 2024
cb7691d
whitespace fix
Jan 17, 2024
de5f55a
working orch preview and tests
Jan 18, 2024
9e38eb9
Merge branch 'develop' of https://github.com/CrayLabs/SmartSim into o…
Jan 18, 2024
745594e
Merge branch 'develop' of https://github.com/CrayLabs/SmartSim into e…
Jan 18, 2024
98b986f
mypy type fix
Jan 18, 2024
2e407ff
Merge branch 'exppreview' into orchpreview
Jan 18, 2024
84e48e7
added doc strings, and check verbosity_level change
Jan 19, 2024
d7acf3f
template render fix, removed unecessary lines in preview() and render…
Jan 22, 2024
e982f26
sync with develop
Jan 22, 2024
b1acec3
remove verbosity
Jan 23, 2024
4433953
mypy fixes
Jan 23, 2024
0ad027f
render and review updates, linting
juliaputko Jan 23, 2024
2449c0f
synch with develop
juliaputko Jan 23, 2024
2c97276
template fixes
Jan 30, 2024
d71743a
updated templates
Jan 31, 2024
94dbe1e
Merge branch 'develop' of https://github.com/CrayLabs/SmartSim into o…
Jan 31, 2024
8b5cafe
isort fix
Jan 31, 2024
757eea1
Merge branch 'develop' of https://github.com/CrayLabs/SmartSim into e…
Jan 31, 2024
c789f8e
isort fix
Feb 1, 2024
23f633a
black error fix
Feb 1, 2024
85ac57b
output forrmat doc + error handling
Feb 1, 2024
4055866
updated output format tests, default, docs
Feb 1, 2024
80f81cb
add port
Feb 1, 2024
4fd9f26
mypy fix
Feb 1, 2024
a1deb00
Merge branch 'develop' of https://github.com/CrayLabs/SmartSim into o…
Feb 6, 2024
2aa5b7e
manifest check in orchestrator template
Feb 6, 2024
84677be
mypy fix in manifest
Feb 6, 2024
9a6207c
mypy fix
Feb 6, 2024
7bf8de1
sync with develop
Feb 8, 2024
6179842
orchestrator verbosity level
Feb 9, 2024
9c52e6f
Merge branch 'preview' of https://github.com/CrayLabs/SmartSim into p…
Feb 15, 2024
0a87266
fix key prefix bug in template
Feb 15, 2024
33dcb87
remove bug in tests
Feb 15, 2024
f5bd33e
spacing fix in model template
Feb 16, 2024
cdbaacb
preview fixes in progress
Feb 23, 2024
9d821a7
template capitalization and spacing, reflect changes in tests, added …
Feb 23, 2024
1dab2b8
Merge branch 'develop' of https://github.com/CrayLabs/SmartSim into p…
Feb 23, 2024
b5cddec
Merge branch 'preview' into previewfix
juliaputko Feb 23, 2024
4e34784
black fix and added filters
Feb 23, 2024
056556a
orch verbosity
Feb 26, 2024
7a09ec3
model verbosity add
Feb 26, 2024
f5fc782
orch verbosity fix
Feb 27, 2024
1f55362
ensemble verbosity
Feb 27, 2024
1e69cdc
black fix
Feb 27, 2024
5415c17
Merge branch 'preview' into previewverbosity
juliaputko Feb 29, 2024
1a135cf
minor fixes in tests
Feb 29, 2024
b5c890d
added separate templates for each verbosity level
Mar 2, 2024
fe3a1ee
Merge branch 'preview' into previewverbosity
juliaputko Mar 4, 2024
25a8ca8
newline in templates and black fix
Mar 4, 2024
a43b66c
Merge branch 'preview' of https://github.com/CrayLabs/SmartSim into p…
Mar 7, 2024
bd70b1d
re-adding what was removed during a merge conflict resolution
Mar 7, 2024
a5a03ae
fixes in orch run settings
Mar 7, 2024
b1a1b39
type fix
Mar 7, 2024
61ca44c
black fix
Mar 7, 2024
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: 0 additions & 1 deletion smartsim/_core/control/previewrenderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ def render(
config=CONFIG,
verbosity_level=verbosity_level,
)
print(rendered_preview)
return rendered_preview


Expand Down
26 changes: 18 additions & 8 deletions templates/templates/preview/ensemble_plain_text_debug.template
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@

{%- for ensemble in manifest.ensembles %}
= Ensemble Name: {{ ensemble.name }} =
Members: {{ ensemble|length }}
{%- if ensemble.params %}
Ensemble Parameters:
Ensemble Parameters:
{%- for key, value in ensemble.params.items() %}
{{ key }}: {{ '{:^9}'.format(value|string)|truncate(81,true,'...')}}
{%- endfor %}
{%- endif %}
{%- endfor %}
{%- endif %}
{%- if ensemble.batch_settings %}
Batch Launch: True
Batch Command: {{ ensemble.batch_settings.batch_cmd }}
{%- endif %}
{%- if ensemble.batch_settings.batch_args %}
Batch Arguments:
{%- for key, value in ensemble.batch_settings.batch_args.items() %}
{{ key }}: {{ value }}
{%- endfor %}
{%- endif %}
{% for model in ensemble %}
- Model Name: {{ model.name }} -
{%- include 'preview/model_plain_text.template' %}
{%- if model.run_settings.colocated_db_settings %}
{% include "preview/clientconfigcolo_plain_text.template" %}
{%- endif %}
{%- if manifest.dbs %}
{%- include "preview/clientconfig_plain_text.template" %}
{%- endif %}
{% endfor %}
{% endfor %}
{% include "preview/clientconfig_plain_text.template" %}
{%- endif %}
{% endfor %}
{% endfor %}
78 changes: 46 additions & 32 deletions templates/templates/preview/model_plain_text_debug.template
Original file line number Diff line number Diff line change
@@ -1,37 +1,50 @@
{%- if model is defined %}

{%- if model is defined %}
Executable: {{ model.run_settings.exe[0] }}
Executable Arguments:
{%- for param in model.run_settings.exe_args %}
{{ param }}
{%- endfor %}
{%- if model.batch_settings -%}
{%- if model.run_settings.run_command %}
Run Command: {{ model.run_settings.run_command }}
{%- endif %}
{%- if model.run_settings.run_args %}
Run Arguments:
{%- for key, value in model.run_settings.run_args.items() %}
{{ key }}: {{ value }}
{%- endfor %}
{%- endif %}
{%- if model.batch_settings %}
Batch Launch: True
{% else %}
Batch Launch: False
{%- endif %}
{%- if model.params %}
Model Parameters:
Batch Command: {{ model.batch_settings.batch_cmd }}
Batch Arguments:
{%- for key, value in model.batch_settings.batch_args.items() %}
{{ key }}: {{ value }}
{%- endfor %}
{%- endif -%}
{%- if model.params %}
Model Parameters:
{%- for param, value in model.params.items() %}
{{ param }}: {{ value }}
{%- endfor -%}
{% endif %}
{%- if model.files %}
{%- if model.files.tagged %}
Tagged Files for Model Configuration:
Tagged Files for Model Configuration:
{%- for tagged in model.files.tagged %}
{{ tagged }}
{{ tagged }}
-> {{ model.path }}
{%- endfor %}
{%- endif -%}
{%- if model.files.copy %}
Copy Files:
Copy Files:
{%- for copy in model.files.copy %}
{{ copy }}
{{ copy }}
-> {{ model.path }}
{%- endfor %}
{%- endif %}
{%- if model.files.link %}
Symlink Files:
Symlink Files:
{%- for link in model.files.link %}
{{ link }}
-> {{ model.path }}
Expand All @@ -42,7 +55,7 @@
Colocated:
{%- if model.run_settings.colocated_db_settings.db_identifier %}
Database Identifier: {{ model.run_settings.colocated_db_settings.db_identifier }}
{%- endif %}
{% endif %}
{%- if model.run_settings.colocated_db_settings.port %}
Connection Type: TCP
TCP/IP Port(s):
Expand All @@ -57,38 +70,39 @@
{%- endif %}
CPUs: {{ model.run_settings.colocated_db_settings.cpus }}
Custom Pinning: {{ model.run_settings.colocated_db_settings.custom_pinning }}
{%- endif %}
{%- if model.run_settings.colocated_db_settings['db_scripts'] %}
{%- if model.run_settings.colocated_db_settings['db_scripts'] %}
Torch Scripts:
{%- for script in model.run_settings.colocated_db_settings['db_scripts'] %}
Script Name: {{ script.name }}
{%- for script in model.run_settings.colocated_db_settings['db_scripts'] %}
Script Name: {{ script.name }}
Script Path: {{ script.script_path }}
Backend: {{ script.device }}
Devices Per Node: {{ script.devices_per_node }}
Backend: {{ script.device }}
Devices Per Node: {{ script.devices_per_node }}

{%- endfor %}
{%- endif %}
{%- if model.run_settings.colocated_db_settings['db_models'] %}
ML Models:
{%- endif %}
{%- if model.run_settings.colocated_db_settings['db_models'] %}
ML Models:
{%- for mlmodel in model.run_settings.colocated_db_settings['db_models'] %}
Model Name: {{ mlmodel.name }}
Model Path: {{ mlmodel.model_file }}
Model Name: {{ mlmodel.name }}
Backend: {{ mlmodel.backend }}
Device: {{ mlmodel.device }}
Model Path: {{ mlmodel.model_file }}
Device: {{ mlmodel.device }}
Devices Per Node: {{ mlmodel.devices_per_node }}
{%- if mlmodel.device == "GPU" %}
First Device: {{ mlmodel.first_device }}
{%- endif %}
{%- for input in mlmodel.inputs %}
Inputs:
{{ input }}
Inputs:
{{ input }}
{%- endfor %}
{%- for output in mlmodel.outputs %}
Outputs:
Outputs:
{{ output }}
{%- endfor %}
{%- endfor %}
{%- endif %}
{%- if model.query_key_prefixing()%}
{%- endfor %}
{%- endif %}
{%- endif %}
{%- if model.query_key_prefixing()%}
Key Prefix: {{ model.name }}
{%- endif %}
{%- endif %}
{%- endif %}
23 changes: 18 additions & 5 deletions templates/templates/preview/orchestrator_plain_text_debug.template
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@

= Database Identifier: {{ db.name }} =
Shards: {{ db.num_shards }}
TCP/IP Port(s):
TCP/IP Port(s):
{%- for port in db.ports %}
{{ port }}
{%- endfor %}
Network Interface: {{ db._interfaces[0] }}
Type: {{ config.database_cli | get_dbtype }}
Executable: {{ config.database_exe }}
Batch Launch: {{ db.batch }}
{%- if db.run_command %}
Run Command: {{ db.run_command }}
{%- if db.batch_settings %}
Batch Launch: True
Batch Command: {{ db.batch_settings.batch_cmd }}
Batch Arguments:
{%- for key, value in db.batch_settings.batch_args.items() %}
{{ key }}: {{ value }}
{%- endfor %}
{%- endif -%}
{%- if db.run_settings %}
Run Command: {{ db.run_settings.run_command }}
{%- if db.run_settings.run_args %}
Run Arguments:
{%- for key, value in db.run_settings.run_args.items() %}
{{ key }}: {{ value }}
{%- endfor %}
{% endif %}
{%- endif %}
16 changes: 8 additions & 8 deletions tests/test_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ def test_orchestrator_preview_render(test_dir, wlmutils, choose_host):
assert "Network Interface" in output
assert "Type" in output
assert "Executable" in output
assert "Batch Launch" in output

db_path = _utils.get_db_path()
if db_path:
Expand All @@ -137,7 +136,6 @@ def test_orchestrator_preview_render(test_dir, wlmutils, choose_host):
assert orc._interfaces[0] in output
assert db_type in output
assert CONFIG.database_exe in output
assert str(orc.batch) in output
assert orc.run_command in output
assert str(orc.db_nodes) in output

Expand All @@ -154,7 +152,9 @@ def test_preview_to_file(test_dir, wlmutils):
filename = "test_preview_output_filename.txt"
path = pathlib.Path(test_dir) / filename
# Execute preview method
exp.preview(output_format="plain_text", output_filename=str(path))
exp.preview(
output_format="plain_text", output_filename=str(path), verbosity_level="debug"
)

# Evaluate output
assert path.exists()
Expand Down Expand Up @@ -345,7 +345,7 @@ def test_preview_multidb_active_infrastructure(wlmutils, test_dir, choose_host):
assert "Type" in output
assert "TCP/IP" in output

exp.stop(orc)
exp.stop(db, db2)


def test_preview_multidb_active_infrastructure(wlmutils, test_dir, choose_host):
Expand Down Expand Up @@ -1326,10 +1326,10 @@ def test_preview_batch_model(fileutils, test_dir, wlmutils):
preview_manifest = Manifest(model)

# Execute preview method
output = previewrenderer.render(exp, preview_manifest)
output = previewrenderer.render(exp, preview_manifest, verbosity_level="debug")

assert "Batch Launch: True" in output
assert "Batch Commands" in output
assert "Batch Command" in output
assert "Batch Arguments" in output
assert "nodes" in output
assert "time" in output
Expand Down Expand Up @@ -1362,10 +1362,10 @@ def test_preview_batch_ensemble(fileutils, test_dir, wlmutils):
preview_manifest = Manifest(ensemble)

# Execute preview method
output = previewrenderer.render(exp, preview_manifest)
output = previewrenderer.render(exp, preview_manifest, verbosity_level="debug")

assert "Batch Launch: True" in output
assert "Batch Commands" in output
assert "Batch Command" in output
assert "Batch Arguments" in output
assert "nodes" in output
assert "time" in output
Expand Down
Loading