-
Notifications
You must be signed in to change notification settings - Fork 135
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 optimizer writeStep final (if optimization ends for reaching the limit number of iterations) #2387
Conversation
…is stopped not for a convergence but for reaching the limit)
…b/raven into alfoa/fixOptimizerWriteStepFinal
Job Test qsubs sawtooth on 39c5a39 : invalidated by @joshua-cogliati-inl failed in fetch fatal: fetch-pack: invalid index-pack output |
1 similar comment
Job Test qsubs sawtooth on 39c5a39 : invalidated by @joshua-cogliati-inl failed in fetch fatal: fetch-pack: invalid index-pack output |
tests/framework/Optimizers/GeneticAlgorithms/discrete/unconstrained/testGAMaxwoRepConvAHDp.xml
Outdated
Show resolved
Hide resolved
…ained/testGAMaxwoRepConvAHDp.xml
Job Mingw Test on e8b15fd : invalidated by @alfoa |
Job Test qsubs sawtooth on e8b15fd : invalidated by @alfoa |
Job Mingw Test on e8b15fd : invalidated by @alfoa |
@joshua-cogliati-inl ray test fails in Windows (but this merge request should not influence that test). Is it a random failure? |
Yes, the ray test is not the most reliable test, so that is probably random. |
Job Mingw Test on e8b15fd : invalidated by @alfoa |
…b/raven into alfoa/fixOptimizerWriteStepFinal
dependencies.xml
Outdated
@@ -68,7 +68,7 @@ Note all install methods after "main" take | |||
<dask source="pip" pip_extra="[complete]"/> | |||
<ray source="pip" pip_extra="[default]">2.6</ray> | |||
<!-- redis is needed by ray, but on windows, this seems to need to be explicitly stated --> | |||
<redis source="pip" os='windows'/> | |||
<redis source="pip" os='windows'>5.1</redis> |
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 is required because redis released a new version on Oct 24 2024 (5.2) and this new version is not compatible with ray 2.6 (causing the Windows test to fail).
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.
well changing the dependency does not help.... @joshua-cogliati-inl no idea
dependencies.xml
Outdated
@@ -68,7 +68,7 @@ Note all install methods after "main" take | |||
<dask source="pip" pip_extra="[complete]"/> | |||
<ray source="pip" pip_extra="[default]">2.6</ray> | |||
<!-- redis is needed by ray, but on windows, this seems to need to be explicitly stated --> | |||
<redis source="pip" os='windows'/> | |||
<redis source="pip" os='windows'>5.1.0</redis> |
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.
is there a reason behind the choice of this particular version?
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.
yeah...trying out the latest version of redis that seemed to work . Now I tried another one
@@ -148,6 +148,8 @@ def run(self): | |||
if self.options['type'] == 'csv': | |||
filename = dictOptions['filenameroot'] | |||
rlzIndex = self.indexPrinted.get(filename,0) | |||
if rlzIndex and rlzIndex >= len(self.sourceData[index]): |
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.
I am not sure if these two lines are needed
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 is needed when the printing of the dataset is not finished (e.g. point set) and this is triggered in the multi run step (right before exiting the step). We check here the index and the length in case the printing is finished before reaching the ned of the step
@@ -1,22 +1,22 @@ | |||
trajID,sigma-A,sigma-B,decay_A,decay_B,sum,age,batchId,fitness,iteration,accepted,AHDp,conv_AHDp |
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.
while the previous csv contains new rows the the bottom of the file as expected, this file contains some differences thorughout the rows, any possible explanation here?
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.
the rows are swapped.
Job Mingw Test on 50828f1 : invalidated by @alfoa |
ravenframework/Steps/MultiRun.py
Outdated
for myLambda, outIndex in self._outputCollectionLambda: | ||
if isinstance(outputs[outIndex], OutStreamEntity): | ||
myLambda([None,outputs[outIndex]]) | ||
self.raiseAMessage(f'Finalized output "{inDictionary["Output"][outIndex].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.
@alfoa The proposed changes can resolve the issue. However, it can be confusing since these lines are almost similar to collection part in the same function. Could you provide more details why previous collection can not collect the final solution? Is it possible to make some modifications inside the optimizer to enable it? I have two concerns for the proposed approach:
- Two collections in the same function, which make it very confusing. Either add more explanations or find a way to avoid it.
- It is also very confusing in the FilePrint.py, since the new added lines to check the rlzIndex seem very unnecessary. I see the changes make the final collection possible, but it is really hard to understand why these lines are needed unless the developers fully understand the collections in the steps.
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.
The lines in the FilePrint are not unnecessary. They are required when the collection in triggered on data objects that are not "collected/created" by the Optimizers.
Basically, the "SolutionExport" in the Optimizers is "updated" with the final solution after the collection is triggered (at the begin of the processing of the "last job"). So the Outstream is not invoked before exiting the Multirun loop.
This modification was the "minimal viable" solution to trigger an out stream call at the end of the multi run.
Maybe another approach could be to split the calls to the output collection:
- Right after a Job is finished for data objects (DataObjects/Databases)
- After the call to the
finalizeActualSampling
for OutStreams
This issue is being solved in #2326. I can close this PR. |
Pull Request Description
What issue does this change request address? (Use "#" before the issue to link it, i.e., #42.)
Closes #2386
What are the significant changes in functionality due to this change request?
Added a print of the out streams at the end of the finalizeSampler call in the MultiRun step to make sure that the "final" solution is printed if an out stream is requested in a MultiRun step
For Change Control Board: Change Request Review
The following review must be completed by an authorized member of the Change Control Board.
<internalParallel>
to True.raven/tests/framework/user_guide
andraven/docs/workshop
) have been changed, the associated documentation must be reviewed and assured the text matches the example.