-
Notifications
You must be signed in to change notification settings - Fork 110
Internalize ert_templates into storage #10617
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
Conversation
CodSpeed Performance ReportMerging #10617 will not alter performanceComparing Summary
|
src/ert/storage/local_experiment.py
Outdated
@@ -248,6 +265,19 @@ def parameter_info(self) -> dict[str, Any]: | |||
info = json.load(f) | |||
return info | |||
|
|||
@cached_property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this as cached_property? The others are just property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, if you check parameter_configuration
for instance. We don't want to access the files all the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probaby dont want this as a cached property now as we are keeping file content in memory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nitpicking 👍
d36987e
to
c5ffebf
Compare
c8b8c3b
to
c1da5e1
Compare
Semeio failure relates to something else, most likely SmootherUpdate API change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Some minor comments, and one corner case
src/ert/run_models/base_run_model.py
Outdated
from ..plugins.workflow_fixtures import ( | ||
create_workflow_fixtures_from_hooked, | ||
) | ||
from ..plugins.workflow_fixtures import create_workflow_fixtures_from_hooked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont mind this change, but should be in a different commit as it is not related to the main change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will create a new commit for these imports...
I have removed the changes to make the PR more compact.
EverestStorage, | ||
OptimalResult, | ||
) | ||
from everest.everest_storage import EverestStorage, OptimalResult |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above, fine to do, but should be its own commit
EverestCacheHitEvent, | ||
EverestStatusEvent, | ||
) | ||
from .event import EverestBatchResultEvent, EverestCacheHitEvent, EverestStatusEvent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
result_type=( | ||
"FunctionResult" | ||
if isinstance(r, FunctionResults) | ||
else "GradientResult" | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment
perturbations=( | ||
evaluator_context.perturbations.tolist() | ||
if evaluator_context.perturbations is not None | ||
else [-1] * len(model_realizations) | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment
ESSettings, | ||
UpdateSettings, | ||
) | ||
from ert.config import ConfigValidationError, ErtConfig, ESSettings, UpdateSettings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment
src/ert/storage/local_experiment.py
Outdated
for src, dst in templates: | ||
incoming_template_file_path = Path(src) | ||
template_file_path = Path( | ||
templates_path / incoming_template_file_path.name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fail in cases where I have different templates with the same name, for example snake oil:
RUN_TEMPLATE templates/seed_template.txt seed.txt
RUN_TEMPLATE seed_template.txt seed_2.txt
valid input, but it will overwrite the template.
A bit of a corner case, but something to consider? Could hash the input file name for example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed now. Each template is stored as relative path with an index enumerating the list:
[["templates/seed_template_0.txt", "seed.txt"]]
6db164f
to
b714e1a
Compare
c0102f2
to
1723f64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Some memory questions though
for ( | ||
source_file_content, | ||
target_file, | ||
) in ensemble.experiment.templates_configuration: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are loading all the template files at the same time now, but should be ok memory wise I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be loaded on the fly now.
src/ert/storage/local_experiment.py
Outdated
@@ -248,6 +265,19 @@ def parameter_info(self) -> dict[str, Any]: | |||
info = json.load(f) | |||
return info | |||
|
|||
@cached_property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probaby dont want this as a cached property now as we are keeping file content in memory?
All templates will be part of storage and thus for instance restart would rely only on templates from the storage. Additionally, this removes templates param from create_run_path, but it needs to be specified directly when calling create_experiment. Templates are stored in the experiment.mount_point / templates folder Example: [["templates/seed_template_0.txt", "seed.txt"]] It requires storage migration for run_templates.
1723f64
to
83152de
Compare
Issue
This is a necessary pre-work related to #10180
All templates will be part of storage and thus for instance restart would
rely only on templates from the storage. Additionally, this removes templates
param from create_run_path, but it needs to be specified directly when calling
create_experiment.
Templates are stored in the experiment.mount_point / templates folder
Example: [["templates/seed_template_0.txt", "seed.txt"]]
It requires storage migration for run_templates.
(Screenshot of new behavior in GUI if applicable)
git rebase -i main --exec 'just rapid-tests'
)When applicable