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

[DEFECT] BayesianOptimizer crashes if R&R + <writeSteps> doesn't not have effect #2451

Open
3 of 13 tasks
alfoa opened this issue Mar 7, 2025 · 0 comments
Open
3 of 13 tasks

Comments

@alfoa
Copy link
Collaborator

alfoa commented Mar 7, 2025

Thank you for the defect report

Defect Description

BayesianOptimizer crashes if R&R where:

  • outer: Optimizer: BayesianOptimizer, CodeInterface:RAVEN, :Linked to Inner Solution Export
  • inner: Optimizer: BayesianOptimizer

The error is as follows:
RuntimeError: Expected to find entry with prefix "1" in TargetEvaluation! Found: <xarray.DataArray 'prefix' (RAVEN_sample_ID: 3283)> Size: 26kB array(['1_0', '1_1', '1_2', '1_3', '1_4', '1_5', '1_6', '1_7', '1_8', '1_9', '1_10', '1_11', '1_12', '1_13', '1_14', '1_15', '1_16', '1_17', '1_18', '1_19', '1_20', '1_21', '1_22', '1_23', '1_24', '1_25', '1_26', '1_27', '1_28', '1_29', '1_30', '1_31', '1_32', '1_33', '1_34', '1_35', '1_36', '1_37', '1_38', '1_39', '1_40', '1_41', '1_42', '1_43', '1_44', '1_45', '1_46', '1_47', '1_48', '1_49', '1_50', '1_51', '1_52', '1_53', '1_54', '1_55', '1_56', '1_57', '1_58', '1_59', '1_60', '1_61', '1_62', '1_63', '1_64', '1_65', '1_66', '1_67', '1_68', '1_69', '1_70', '1_71', '1_72', '1_73', '1_74', '1_75', '1_76', '1_0', '1_1', '1_2', '1_3', '1_4', '1_5', '1_6', '1_7', '1_8', '1_9', '1_10', '1_11', '1_12', '1_13', '1_14', '1_15', '1_16', '1_17', '1_18', '1_19', '1_20', '1_21', '1_22', '1_23', '1_24', '1_25', '1_26', '1_27', '1_28', '1_29', '1_30', '1_31', '1_32', '1_33', '1_34', '1_35', '1_36', '1_37', '1_38', '1_39', '1_40', '1_41', '1_42', '1_43', '1_44', '1_45', '1_46', '1_47', '1_48', '1_49', '1_50', '1_51', '1_52', '1_53', '1_54', '1_55', '1_56', '1_57', '1_58', '1_59', '1_60', '1_61', '1_62', '1_0', '1_1', '1_2', '1_3', '1_4', '1_5', '1_6', '1_7', '1_8', '1_9', '1_10', '1_11', '1_12', '1_13', '1_14', '1_15', '1_16', '1_17', '1_18', '1_19', '1_20', '1_21', '1_22', '1_23',

The reason is that in the inner RAVEN the solutionExport data object contains all the "samples" of the inner optimization, and consequentially the RAVEN interface changes the "prefix" for each OUTER iteration.

If <writeSteps>every</writeSteps> is modified to <writeSteps>final</writeSteps> it seems the optimizer does not "care" and still prints all the "samples".

Only solution is to use the SampleSelector PP
<PostProcessor name="PPindex" subType="SampleSelector" verbosity="debug"> <criterion value='-1'> index </criterion> </PostProcessor>
but it should be needed or an error should be raised at the begin of the RUN.

In addition, it seems the "prefix" nomenclature of the sampler changes on the fly:

  • First "batch" uses the batch syntax
  • second and sub sequential batches uses the "Sampler" syntax. See screenshoot below:
Image

Steps to Reproduce

Raven running Raven with both outer and inner using a BayesianOptimizer without the usage of the SampleSelector PP

Expected Behavior

No Crash and Functional.

Screenshots and Input Files

No response

OS

Linux

OS Version

No response

Dependency Manager

PIP

For Change Control Board: Issue Review

  • Is it tagged with a type: defect or task?
  • Is it tagged with a priority: critical, normal or minor?
  • If it will impact requirements or requirements tests, is it tagged with requirements?
  • If it is a defect, can it cause wrong results for users? If so an email needs to be sent to the users.
  • Is a rationale provided? (Such as explaining why the improvement is needed or why current code is wrong.)

For Change Control Board: Issue Closure

  • If the issue is a defect, is the defect fixed?
  • If the issue is a defect, is the defect tested for in the regression test system? (If not explain why not.)
  • If the issue can impact users, has an email to the users group been written (the email should specify if the defect impacts stable or master)?
  • If the issue is a defect, does it impact the latest release branch? If yes, is there any issue tagged with release (create if needed)?
  • If the issue is being closed without a pull request, has an explanation of why it is being closed been provided?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant